Traffic Light Control System
Traffic Light Control System
This is a project based on a real life traffic control system. It is not the real one but this project
gives us an idea about traffic light controlling systems.
At the beginning the green LED of road-1 will be active and in other two roads the red LED will
be active. This condition will stay until the 7-segment display counts 9 to 0.
After this countdown, yellow LEDs on road-1 and road-2 will be activated. This condition will be
active until the 7-segment display counts from 4 to 0. At the same time the red led in road-3 will
stay active.
After that the green LED of road-2 will be active and this condition will continue until the 7-
segment display counts from 9 to 0.
After this countdown, yellow LEDs on road-2 and road-3 will be activated. This condition will be
active until the 7-segment display counts from 4 to 0. At the same time the red led in road-3 will
stay active.
After that the green LED of road-3 will be active and this condition will continue until the 7-
segment display counts from 9 to 0.
After this countdown, yellow LEDs on road-3 and road-1 will be activated. This condition will be
active until the 7-segment display counts from 4 to 0. At the same time the red led in road-2 will
stay active.
Codding :
First, select the pins for 7-segment display and for LEDs
Then in void setup I declare that all pins are for OUTPUT.
Inside void loop,
Here is the code when road-1 is active and road-2 and road-3 are not active. This will continue
until the 7-segment display count 9 to 0.
Code when yellow LED is active on road-1 and road-2. This will continue until the 7-segment
display count 4 to 0.
Then the green LED of road-2 will be active and the other two road red LEDs will be active.
Yellow LEDs are active on road-2 and road-3. This will continue until the 7-segment display
count 4 to 0.
Then the green LED of road-3 will be active. In road-1 and road-2 red LEDs will be active.
Then yellow LEDs are active on road-3 and road-1. This will continue until the 7-segment
display count 4 to 0.
Then the green LED of road-1 will be active again and the whole code will be run sequentially
as a loop.