Meta Description:
Simulate a real-world traffic light system using Arduino UNO in this hands-on tutorial. Includes circuit diagram, code, components list, working demo, and expansion ideas.
Introduction
In this beginner-friendly hands-on project, we will simulate a Traffic Light Control System using an Arduino UNO. The project is designed to mimic the role of real traffic lights at a road intersection. It uses three LEDs β Red, Yellow, and Green.
What the Project Does
It simulates a traffic signal system by turning ON/OFF three LEDs in a timed sequence (Red β Green β Yellow β Red…).
Real-World Use Case
Traffic light control is a foundational concept in automation and embedded systems. It is often used in smart city infrastructure and pedestrian safety systems.
Skill Level
Beginner to Intermediate
Expected Outcome
Youβll understand basic sequential programming, digital outputs, and timing control in Arduino. You’ll also gain confidence working with multiple outputs.
Components Required
Quantity | Part | Description | Buy Link |
---|---|---|---|
1 | Arduino UNO Board | Main micro controller board | Buy on Elecsynergy |
1 | Breadboard | For easy prototyping | Buy on Elecsynergy |
3 | LEDs (Red, Yellow, Green) | To represent traffic lights | Buy on Elecsynergy |
3 | 220 ohm Resistors | To protect LEDs from overcurrent | Buy on Elecsynergy |
6 | Male to Male Jumper Wires | For connections | Buy on Elecsynergy |
Circuit Diagram + Explanation
Connection Summary:
- Red LED β Pin 10
- Yellow LED β Pin 9
- Green LED β Pin 8
- Each LED connects to its respective Arduino digital pin through a 220 ohm resistor
- Cathode of each LED goes to GND
Visual Diagram:
π§ Tip: Always use resistors in series with LEDs to prevent burning them.
Arduino Code
// Traffic Light Simulation Using Arduino
int redLED = 10;
int yellowLED = 9;
int greenLED = 8;
void setup() {
pinMode(redLED, OUTPUT);
pinMode(yellowLED, OUTPUT);
pinMode(greenLED, OUTPUT);
}
void loop() {
// Red Light
digitalWrite(redLED, HIGH);
digitalWrite(yellowLED, LOW);
digitalWrite(greenLED, LOW);
delay(5000); // 5 seconds
// Green Light
digitalWrite(redLED, LOW);
digitalWrite(greenLED, HIGH);
delay(5000); // 5 seconds
// Yellow Light
digitalWrite(greenLED, LOW);
digitalWrite(yellowLED, HIGH);
delay(2000); // 2 seconds
}
Working Explanation
- pinMode() sets digital pins as output
- LEDs turn ON/OFF based on
digitalWrite()
method - delay() is used to control how long each light remains on
- The sequence mimics standard traffic signals in real life
Demo / Output Preview
π‘ You will see:
- Red LED ON for 5s
- Green LED ON for 5s
- Yellow LED ON for 2s
- Loop continues indefinitely
Troubleshooting & Tips
- Check LED orientation (long leg = anode)
- Make sure correct resistor values (220Ξ© to 330Ξ©)
- Confirm your Arduino port is selected in the IDE
Project Expansion Ideas
- Add a pedestrian cross button with separate green signal
- Control LEDs using Bluetooth via mobile app
- Add sound output using buzzer during pedestrian signal
- Use Real-Time Clock module for time-based traffic control
Conclusion
Youβve now built your own Traffic Light Simulator using Arduino! This project teaches core programming concepts like sequencing and digital output control. Itβs a great stepping stone toward more advanced automation projects.
Stay tuned for the next project in our Arduino Series and tag us when you recreate this project!
π Buy the Complete Kit
#ArduinoProjects #TrafficLightWithArduino #InnovateYourself #Elecsynergy