Objective and scope of the project
Purpose of this project is to make a 'Traffic analysis based automatic traffic light control system'. The main objective of this project is to automate the traffic signal so that the lights are controlled on the basis of traffic analysis, automatically.
This system takes into consideration the amount of traffic on each side at a particular instant, unlike the existing system which has a fixed amount of time allocated for a side based on one time initial calculations. Existing system has no means of checking the traffic density. Thus our system helps in preventing the problem causing situations that may arrive from the existing system. It can be implemented in real time situations that are the actual traffic lights. Main advantages of the system are:
It completely automates the traffic lights control.
Prevent chaos creating situation that are caused by existing system.
Saves precious 'traffic-light time'.
This system can be implemented in real time situations that are the actual traffic lights. We have tried to overcome the problems of the existing traffic light control system.
Description of Existing System
This is how the existing traffic light system looks like (fig. 1.1). Each side has three lights viz. red, yellow and green. Each side is allotted a fixed ‘stoppage time’ or 'traffic light time'. Traffic on each side is allowed to move for the time period of ‘stoppage time’, i.e. light is green for that time period for that side, while all others wait with red light. Then after completion of this time period for a particular side, transition occurs , yellow light blinks for a few seconds and then the chance to move is passed on to the next side in order. This repeats in a circular fashion.
Fig. 1.1 : Existing system
At some places each side has different values of stoppage time. This value is calculated at the time this signal is constructed. It is analyzed that which side will be having more traffic and thus it is allocated more stoppage time. But again this value is constant, irresespective of the amount of traffic actually coming later. This system has no consideration about the amount of traffic whatsoever. If any side has high or low traffic density, it will have no effect on the amount of time a light is green or red.
Also the amount of traffic on a particular side might also depend on various other factors [like ‘office going’ time or ‘coming back from office’ time] and thus may lead to unequal traffic distribution on some sides depending on the time of day. In such situations the existing system doesn’t work effectively. eg.
Fig. 1.2 Traffic density during 'office going' hours ( Red arrows indicates most probable high density regions )
Fig. 1.3 Traffic density during 'returning from office' hours ( Red arrows indicates most probable high density regions )
Problems faced with Existing System
Problem 1: Consider the traffic light as shown in the figure 1.4 given below. The traffic coming from North, East and South has been stopped due to the red light. Only the traffic coming from West has been given a green signal. Now if there is less traffic on this side and it passes the crossing well before the time allotted for it to be green for this side, then two conditions arrive-
1. Either the traffic from all remaining sides wait till one of them gets the green light or
2. One of the sides breaks the rule and start moving without having the green light for it to be in on condition.
In the first case some precious time is wasted with traffic from no side moving. While in the second case, a chaos might be created as each side will like to start moving first. This situation is very common at the sites where there is an unequal traffic distribution in different directions.
Fig. 1.4
Problem 2: In the case when there is no traffic on either side, all the traffic lights keep on working as if there is traffic (or have to be switched on to ‘all yellow blinking’ mode manually).
Proposed System
We propose an automatic, Traffic analysis based, traffic light control system, as shown in the figure 1.5 below. On each of the side viz. North, East, West, South, will be connected some pressure sensors which can detect the presence of a vehicle there. These sensors are then connected to an OR gate which finally leads the output to the ATLC system. These sensors are arranged on the road such that even if a single vehicle is present on that side then atleast one of the sensors will get pressed and a signal will be passed on to the ATLC system. Due to the amount of cost and complexity involved in making and using the real sensors, we will be simulating them by corresponding on\off switches. We have taken one switch for each side while implementing the project on hardware. Our system will check these conditions-
Fig 1.5: Description of the proposed system
1. If any side has no traffic at all at the instant it is about to be given a green signal, then it will not be given green signal. Green signal is then passed on to the next side in the pool.
2. If any side has been awarded a green signal and all the traffic on its side has passed before the time that has been allotted to it, then the green signal will be passed to the next side in the round robin even before the time allotted to it is complete.
3. If there is no traffic on either side, then all the yellow lights will keep on blinking till traffic arrives on at least one side.
Proposed algorithm
count=0;
while(TRUE)
{
if there is no traffic, blink all yellow till there is traffic on at least a side.
if( signal_from_north() == TRUE )
{
Turn North green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_north() == FALSE )
break;
wait for a second
count++;
}
}
count=0;
if( signal_from_east() == TRUE )
{
Turn east green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_east() == FALSE )
break;
wait for a second
count++;
}
}
count=0;
if( signal_from_south() == TRUE )
{
Turn south green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_south() == FALSE
break;
count++;
wait for a second
}
}
count=0;
if( signal_from_west() == TRUE )
{
Turn west green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_west() == FALSE )
break;
count++;
wait for a second
}
}
count=0;
}
Benefits of this system
1. Completely automate the traffic lights control.
2. Prevent chaos creating situation.
3. Saves precious traffic-light time.
4. Removes the drawbacks of existing system.
Development environment
Hardware used:
Table 1.1: Hardware used
Many other requirements like connecting wires, resistances, soldering iron, soldering wax etc.
Circuit diagram for the system
We then designed the basic circuit diagram for the system. This is roughly how the connections are made in the circuit. While implementing we can change the input/output connections as per the requirement. We just need to make corresponding changes in the pin assignment in the software.
Fig 1.6: Complete hardware description
Software used
We have to use specialized software for programming the embedded system. We used the Keil IDE to do most of the programming and debugging the microcontroller. It provides several extensions to the standard C language for programming the embedded systems with ease.
Table 1.2: Software used
Economic feasibility
Table 1.3 : Economic feasibility
Total cost= Rs. 197 ~ Rs. 200.
Over all cost incurred will be much lesser if these materials are bought on large scale.
Testing
Test cases we considered:
1. No traffic on any side.
2. Traffic on one side.
Traffic on North side only.
Traffic on East side only.
Traffic on South side only.
Traffic on West side only.
3. Traffic on two sides
Traffic on North and East.
Traffic on East and South.
Traffic on South and West.
Traffic on West and North.
Traffic on North and South.
Traffic on East and West.
4. Traffic on three sides
Traffic on North, East and South.
Traffic on East, South and West.
Traffic on South, West and North.
5. Traffic on all sides
Limitations
Our system is based on the assumption that people will follow the traffic system and will stop at the zebra crossing. This is usually not the case in actual implementation. Moreover the traffic signals which have very large central area may have problems implementing this system.
Future enhancements
This system is very flexible and changes can be made later on too. All we have to do is to reprogram the IC and embed it back into the system. Some of the possible implementations are:
Conclusion
Traffic density based automatic traffic light system is an improvement over the existing traffic light control system and removes most of the drawbacks of the current system. If implemented, it will be of great use to the real traffic signals and will avoid certain traffic jam causing situations.
User manual
To use this system you have to follow these steps:
1. Connect the yellow wire to the positive terminal of the 9Volt power supply. You can use power supply from 8 Volt to around 30 Volt if 9V is not available as there is a 5volt regulator attached to the circuit to regulate the voltage.
2. Connect the green wire to the ground.
3. Press the reset button and the system will start.
Appendix [A] Source code
// A.T.L.C. : The Automatic Traffic Light Control System
// Version: 0.0
// [Team A11G]
/* Testing Status:
1. Normal version [Working]
2. Automatic version [Working]
3. Communication [ Not included]
*/
//_________________________________________________________________________________//
#include<reg51.h>
void my_delay( unsigned int time );
void set_all_yellow(void);
void unset_all(void);
void manual(void);
void set_north(void);
void set_east(void);
void set_south(void);
void set_west(void);
int signal_from_north(void);
int signal_from_east(void);
int signal_from_south(void);
int signal_from_west(void);
#define TRUE 1
#define FALSE 0
#define HIGH 1
#define LOW 0
#define ON 0 // An LED turns on, when port to which it is connected, is turned low.
#define OFF 1
#define STOPPAGE_TIME 5 // stoppage time for each side
#define NORTH 1
#define EAST 2
#define SOUTH 3
#define WEST 4
sbit north_red_led = P1^2 ; // Name assignment to individual bits for different ports.
sbit east_red_led = P2^6 ; // Assignment done as per the circuit.
sbit south_red_led = P2^5 ;
sbit west_red_led = P2^2 ; // Changed according to correct circuit diagram [bug 1]
sbit north_green_led = P1^0 ;
sbit east_green_led = P1^3 ;
sbit south_green_led = P2^3 ;
sbit west_green_led = P2^0 ;
sbit north_yellow_led = P1^1 ;
sbit east_yellow_led = P2^7 ;
sbit south_yellow_led = P2^4 ;
sbit west_yellow_led = P2^1 ;
sbit north_sensor = P0^0 ;
sbit east_sensor = P0^1 ;
sbit south_sensor = P0^2 ;
sbit west_sensor = P0^3 ;
int main( void )
{
unsigned int count=0;
P0=0xFF; // Make port 0 as input port.
while(TRUE) // Infinite loop, as traffic signal works infinitely.
{
// If there is no traffic, set all to sides to yellow till there is traffic on at least one side.
if( signal_from_north() == FALSE && signal_from_east() == FALSE && signal_from_south() == FALSE && signal_from_west() == FALSE )
{
while( ! ( signal_from_north() == TRUE || signal_from_east() == TRUE || signal_from_south() == TRUE || signal_from_west() == TRUE ) )
{
set_all_yellow(); // Keep blinking yellow till traffic arrives.
unset_all();
my_delay(100);
}
}
if( signal_from_north() == TRUE )
{
set_all_yellow();
set_north(); //Turn North green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_north() == FALSE )
{ //If no traffic is present, pass on to next side.
break;
}
my_delay(100);
count++;
}
}
count=0;
if( signal_from_east() == TRUE )
{
set_all_yellow();
set_east(); //Turn East green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_east() == FALSE ) // If no traffic is present, pass on to next side.
{
break;
}
count++;
my_delay(100);
}
}
count=0;
if( signal_from_south() == TRUE )
{
set_all_yellow();
set_south(); //Turn South green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_south() == FALSE )
// If no traffic is present, pass on to next side.
{
break;
}
count++;
my_delay(100);
}
}
count=0;
if( signal_from_west() == TRUE )
{
set_all_yellow();
set_west(); //Turn West green and all others red.
while( count != STOPPAGE_TIME )
{
if(signal_from_west() == FALSE ) // If no traffic is present, pass on to next side.
{
break;
}
count++;
my_delay(100);
}
}
count=0;
}
return 0;
}
void my_delay( unsigned int time ) // delays for 'time' milliseconds.
{
unsigned int i,j;
for(i=0;i<time;i++)
{
for(j=0;j<1275;j++)
{}
}
}
void unset_all() // Turn off all the LEDs.
{
north_red_led = OFF ;
east_red_led = OFF ;
south_red_led = OFF ;
west_red_led = OFF ;
north_green_led = OFF ;
east_green_led = OFF ;
south_green_led = OFF ;
west_green_led = OFF ;
north_yellow_led = OFF ;
east_yellow_led = OFF ;
south_yellow_led = OFF ;
west_yellow_led = OFF ;
}
void set_all_yellow() // Turn on all the yellow LEDs.
{
unset_all();
north_yellow_led = ON ;
east_yellow_led = ON ;
south_yellow_led = ON ;
west_yellow_led = ON ;
my_delay(100);
}
void set_north() // Set north side green and all others red.
{
unset_all();
north_green_led = ON ;
east_red_led = ON ;
south_red_led = ON ;
west_red_led = ON ;
}
void set_east() // Set east side green and all others red.
{
unset_all();
north_red_led = ON ;
east_green_led = ON ;
south_red_led = ON ;
west_red_led = ON ;
}
void set_south() // Set south side green and all others red.
{
unset_all();
north_red_led = ON ;
east_red_led = ON ;
south_green_led = ON ;
west_red_led = ON ;
}
void set_west() // Set west side green and all others red.
{
unset_all();
north_red_led = ON ;
east_red_led = ON ;
south_red_led = ON ;
west_green_led = ON ;
}
int signal_from_north() // Check the signal value from north.
{
if(north_sensor==LOW) // Assignment due to circuit.
return TRUE;
else
return FALSE;
}
int signal_from_east() // Check the signal value from east.
{
if(east_sensor==LOW) // Assignment due to circuit.
return TRUE;
else
return FALSE;
}
int signal_from_south() // Check the signal value from south.
{
if(south_sensor==LOW) // Assignment due to circuit.
return TRUE;
else
return FALSE;
}
int signal_from_west() // Check the signal value from west
{
if(west_sensor==LOW) // Assignment due to circuit.
return TRUE;
else
return FALSE;
}
Thanks to
Mr. Devendra for developing the hardware for the system.
Mr. Amit Chauhan for helping in the circuit debugging.
Special thanks
Special thanks are due to Mr. Sai Krishna for helping throughout the development. Without his guidance and encouragement, this dream would never have been realized.
> His orkut profile [ http://www.orkut.co.in/Main#Profile?rl=fpp&uid=16054498008740516920 ] (Long live orkut)
> His website [ http://kskpages.weebly.com ]
_______________________________________________________________________________________________________________________________________________________
To know more about this project or to suggest some thing more to it, please contact me at my e-mail id given below..
e-mail Id:
______________________________________________________
Home | Disclaimer | Privacy Policy
______________________________________________________