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

Arduino UNO Controlled Traffic Light Module

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

Circuit Documentation

Summary of the Circuit

This circuit consists of an Arduino UNO microcontroller board interfaced with a traffic light module. The traffic light module has three outputs corresponding to the RED, YELLOW, and GREEN lights. The Arduino UNO controls these lights by providing signals to the respective pins on the traffic light module. The ground (GND) pin of the traffic light module is connected to the GND pin of the Arduino UNO to complete the circuit.

Component List

Arduino UNO

Traffic Light Module

Wiring Details

Arduino UNO

Traffic Light Module

Documented Code

The following code is intended for the Arduino UNO microcontroller to control the traffic light module. The code is written in Arduino's sketch format (.ino).

void setup() {
  // Initialize the traffic light control pins as outputs
  pinMode(9, OUTPUT); // RED light control pin
  pinMode(8, OUTPUT); // YELLOW light control pin
  pinMode(10, OUTPUT); // GREEN light control pin
}

void loop() {
  // RED light sequence
  digitalWrite(9, HIGH);   // Turn on RED light
  delay(1000);             // Keep RED light on for 1 second
  digitalWrite(9, LOW);    // Turn off RED light

  // YELLOW light sequence
  digitalWrite(8, HIGH);   // Turn on YELLOW light
  delay(1000);             // Keep YELLOW light on for 1 second
  digitalWrite(8, LOW);    // Turn off YELLOW light

  // GREEN light sequence
  digitalWrite(10, HIGH);  // Turn on GREEN light
  delay(1000);             // Keep GREEN light on for 1 second
  digitalWrite(10, LOW);   // Turn off GREEN light
}

This code sets up the Arduino UNO to control the traffic light module by setting the appropriate pins to output mode and then cycling through the RED, YELLOW, and GREEN lights in the loop function. Each light is turned on for one second before switching to the next light.