The Traffic Light System project teaches you one of the most common real-world uses of embedded systems and automation.
In this project, Arduino controls three LEDs that look like a real traffic signal. The Red LED means Stop. The Yellow LED means Wait. The Green LED means Go.
Using digital outputs and timing logic, Arduino automatically switches between different traffic light states, creating a realistic traffic signal sequence.
This project teaches Multiple Output Control, Timing and Delays, Sequential Programming, Automation Systems, and Real-World Traffic Signal Logic.
By finishing this project, you’ll know how microcontrollers can automate tasks and control multiple devices in a specific sequence.
To build this circuit, collect these specific items from your kit:
Arduino Uno × 1, Breadboard × 1, Red LED × 1, Yellow LED × 1, Green LED × 1, 220Ω Resistor × 3, Jumper Wires × 6, USB Cable × 1
Connect the Arduino GND pin to the negative rail of the breadboard. This creates a shared ground connection for all LEDs.
Put the Red LED into the breadboard. Connect the long leg (Anode) to Arduino Pin 8 through a 220Ω resistor. Connect the short leg (Cathode) to the breadboard GND rail.
Put the Yellow LED into the breadboard. Connect the long leg (Anode) to Arduino Pin 9 through a 220Ω resistor. Connect the short leg (Cathode) to the breadboard GND rail.
Put the Green LED into the breadboard. Connect the long leg (Anode) to Arduino Pin 10 through a 220Ω resistor. Connect the short leg (Cathode) to the breadboard GND rail.
Check all LED directions and resistor placements before you power up the circuit.
Important: Every LED must have its own 220Ω current-limiting resistor to stay safe.
In setup(), Arduino sets Pin 8, Pin 9, and Pin 10 as output pins. These pins control the Red, Yellow, and Green LEDs.
The Red LED turns ON while the Yellow and Green LEDs stay OFF. This is the STOP signal.
The Red and Yellow LEDs turn ON together. This means the signal is about to change.
The Green LED turns ON while the Red and Yellow LEDs turn OFF. This is the GO signal.
The sequence repeats inside the loop() function, creating a complete traffic light system.
The sequence repeats inside the loop() function, creating a complete traffic light system.
After uploading your code, here is what happens:
Red LED turns ON for 5 seconds. Red and Yellow LEDs turn ON together for 2 seconds. Green LED turns ON for 5 seconds. Yellow LED turns ON for 2 seconds. The sequence repeats continuously.
The circuit works like a real traffic signal.
One LED Does Not Turn ON :- Check the LED direction and verify the resistor connection.
Incorrect Sequence :- Make sure each LED connects to the correct Arduino pin.
All LEDs Stay ON :- Check your uploaded code and confirm the pin numbers match your wiring.
Upload Errors :- Verify the correct board and COM port are selected in Arduino IDE.
By finishing this project, you now know :-
How to control multiple LEDs at the same time, how timing logic works using delay(), how automation systems operate, how to create sequential output patterns, and how real-world traffic lights are controlled.
In Day 7, you’ll learn how to use a Buzzer with Arduino to generate sounds and simple melodies.