i had already done this prototype and it is being tested in few cities...
In normal operation the red and green light will work depending on the density of the traffic that means..
1. More traffic keep green light for more time.
2. less traffic .. keep green light for less time so that others on the other side of signal need not wait for long time..
Now in real time traffic signal light will be of fixed time in all directions..
Enhancement... If an ambulance is detected then the direction in which ambulance is coming will automaticall turn green and make all other sides red .. so that all the traffic and ambulance can go through without stopping...
as soon as the ambulance crosses , the traffic light returns to normal mode...
Its is already existing in some countries, and in india it will come soon.,...