This project simulates a traffic light using an Arduino UNO and three LEDs: Red, Yellow, and Green.
Each LED turns ON for a specific amount of time to represent a real traffic signal.
| Light | Duration |
|---|---|
| 🔴 Red | 30 seconds |
| 🟢 Green | 15 seconds |
| 🟡 Yellow | 5 seconds |
The cycle repeats continuously.
- Arduino UNO
- Breadboard
- Red LED
- Yellow LED
- Green LED
- 3 × 220Ω resistors
- Jumper wires
| LED | Arduino Pin | Resistor | Ground |
|---|---|---|---|
| Red | D2 | 220Ω | GND |
| Yellow | D3 | 220Ω | GND |
| Green | D4 | 220Ω | GND |
Note:
- Long leg (anode) → Arduino pin
- Short leg (cathode) → resistor → GND
- Open your Arduino project file (
.ino) - Connect your Arduino UNO
- Upload the code
- Build the circuit as shown above
- Create a new Arduino Uno project
- Paste your Arduino code into
sketch.ino - Add LEDs and resistors
- Start the simulation
This project is ideal for beginners learning:
- Arduino digital output
- LED control
- Timing and delays
- Basic traffic signal logic