Skip to content
Beginner 1.5 hours

Arduino LED Traffic Light Simulator

By Amit1379
July 13, 2026

This classic beginner project teaches you how to control digital output pins on an Arduino, create timed sequences, and understand basic circuit wiring. The finished traffic light cycles through red, amber, and green just like a real road signal.

What You’ll Need

  • Arduino Uno (or Nano)
  • Red, yellow, and green LEDs (5 mm)
  • 3 × 220 Ω resistors
  • Breadboard and jumper wires
  • USB cable for Arduino

Step-by-Step Instructions

  1. Wire the LEDs: Insert the three LEDs into the breadboard with at least one row gap between each. Connect the long leg (anode) of each LED through a 220 Ω resistor to Arduino pins 11 (red), 10 (yellow), and 9 (green). Connect all short legs (cathodes) to the GND rail.
  2. Connect GND: Run a wire from any Arduino GND pin to the breadboard’s ground rail.
  3. Write the sketch: In the Arduino IDE, define three pin constants. In loop(), turn red ON for 3 s, then red + yellow ON for 1 s, then green ON for 3 s, then yellow ON for 1 s, then repeat.
  4. Upload and test: Connect the Arduino via USB, select your board and port, and click Upload. The LEDs should begin cycling immediately.
  5. Extend it: Add a button to trigger a pedestrian-crossing phase — turn all vehicle lights red, flash green for pedestrians, then resume normal cycle.

Safety Notes

  • Always use current-limiting resistors with LEDs — omitting them will burn out the LED and can damage the Arduino pin.
  • Keep the Arduino unplugged from USB while rewiring the breadboard.

Tips & Troubleshooting

  • If an LED doesn’t light, check it isn’t inserted backwards — the long leg is positive.
  • Dim LEDs usually mean the resistor value is too high; swap to 100 Ω for brighter output.
  • This project runs on 5 V from USB — no external power supply needed.

Leave a Comment

Your email address will not be published. Required fields are marked *