ArduinoLab
PNLProjectsAbout
ArduinoLab

Empowering the next generation of makers and engineers through open-source robotics education.

Platform

  • Explore Projects
  • About Us
  • Login

Organization

  • Pensée Nationale Libre Mahdia
  • Projet SWAFY

Support

  • heythem.94@gmail.com
  • +216 50 126 064

© 2026 ArduinoLab. All rights reserved.

Powered by AI & PNL Volunteers

Developed with ❤️ by Haythem Baganna

Traffic Light Project with Arduino Uno and 3 LEDs
Fundamentals

Traffic Light Project with Arduino Uno and 3 LEDs

Create a simple traffic light system using Arduino Uno and 3 LEDs. The project simulates a traffic light with red, yellow, and green LEDs.

Haythem
PNL Mahdia

🚀 Quick Setup

Materials List

- 1 Arduino Uno - 3 LEDs (red, yellow, green) - 3 Resistors (220 ohm) - 1 Breadboard - Jumper wires

Assembling

1. Connect the LEDs to the breadboard. 2. Connect the resistors to the LEDs. 3. Connect the jumper wires from the breadboard to the Arduino Uno pins. 4. Connect the red LED to pin 9, yellow LED to pin 10, and green LED to pin 11.

Arduino Code & Libraries

Arduino Code & Libraries

No libraries required. arduino

// Define the pin numbers for the LEDs

const int redLed = 9;

const int yellowLed = 10;

const int greenLed = 11;

void setup() {

// Set the LED pins as output

pinMode(redLed, OUTPUT);

pinMode(yellowLed, OUTPUT);

pinMode(greenLed, OUTPUT);

} void loop() {

// Red light for 5 seconds

digitalWrite(redLed, HIGH);

delay(5000);

digitalWrite(redLed, LOW);

// Yellow light for 2 seconds digitalWrite(yellowLed, HIGH);

delay(2000);

digitalWrite(yellowLed, LOW);

// Green light for 5 seconds

digitalWrite(greenLed, HIGH);

delay(5000);

digitalWrite(greenLed, LOW);

}

Project Resources

No downloadable resources added yet.

Please login to leave a comment.

0 Comments

No comments yet. Be the first to share your thoughts!