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

Arduino UNO Controlled Traffic Light System

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

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a traffic light system using two Arduino UNO microcontrollers. The system operates a traffic light by cycling through green, yellow, and red LEDs in a predefined sequence. One Arduino UNO is programmed to control the sequence of the traffic light, while the purpose of the second Arduino UNO is not defined within the provided code.

Component List

Arduino UNO

Traffic Light

Wiring Details

Arduino UNO (controlling the traffic light)

Arduino UNO (unspecified purpose)

Traffic Light

Documented Code

Code for the Arduino UNO (controlling the traffic light)

/*
 * This Arduino sketch controls a traffic light system.
 * The sequence is as follows:
 * - Green LED on for 5 seconds
 * - Yellow LED on for 2 seconds
 * - Red LED on for 5 seconds
 * The sequence repeats indefinitely.
 */

// Pin definitions
const int greenLedPin = 3;
const int yellowLedPin = 2;
const int redLedPin = 1;

void setup() {
  // Initialize the LED pins as outputs
  pinMode(greenLedPin, OUTPUT);
  pinMode(yellowLedPin, OUTPUT);
  pinMode(redLedPin, OUTPUT);
}

void loop() {
  // Green LED on for 5 seconds
  digitalWrite(greenLedPin, HIGH);
  delay(5000);
  digitalWrite(greenLedPin, LOW);

  // Yellow LED on for 2 seconds
  digitalWrite(yellowLedPin, HIGH);
  delay(2000);
  digitalWrite(yellowLedPin, LOW);

  // Red LED on for 5 seconds
  digitalWrite(redLedPin, HIGH);
  delay(5000);
  digitalWrite(redLedPin, LOW);
}

Code for the Arduino UNO (unspecified purpose)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

The second Arduino UNO does not have a specified role in the circuit based on the provided code. It is initialized with an empty setup and loop function, indicating that it may be intended for future expansion or for a separate part of the project not included in the provided documentation.