Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Traffic Light Simulation

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Traffic Light Simulation

Circuit Documentation

Summary

The circuit in question is designed to simulate a traffic light system using an Arduino UNO microcontroller and a traffic light module with three LEDs (Red, Yellow, Green). The system cycles through the traffic light sequence by turning on the red, yellow, and green LEDs in a timed pattern. A resistor is included in the circuit to provide a ground path for the traffic light module.

Component List

Arduino UNO

Traffic Light

Resistor

Wiring Details

Arduino UNO

Traffic Light

Resistor

Documented Code

// sketch.ino
void setup() {
  pinMode(7, OUTPUT); // Red LED
  pinMode(6, OUTPUT); // Yellow LED
  pinMode(5, OUTPUT); // Green LED
}

void loop() {
  // Red light on, Yellow and Green off
  digitalWrite(7, HIGH);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(5000); // Wait for 5 seconds

  // Yellow light on, Red and Green off
  digitalWrite(7, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(5, LOW);
  delay(5000); // Wait for 5 seconds

  // Green light on, Red and Yellow off
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, HIGH);
  delay(5000); // Wait for 5 seconds
}

This code is designed to run on the Arduino UNO microcontroller. It initializes the digital pins 7, 6, and 5 as outputs in the setup() function. The loop() function then controls the traffic light sequence by turning on the red, yellow, and green LEDs in succession, each for a duration of 5 seconds.