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

Traffic Light Controller Circuit Documentation

Summary

This circuit is designed to control a traffic light system using an Arduino UNO microcontroller. The traffic light system consists of three LEDs (Red, Yellow, and Green) that simulate a traffic signal. The Arduino UNO cycles through the LEDs in a specific sequence: Red is on for 5 seconds, followed by Yellow for 2 seconds, and then Green for 5 seconds. This sequence repeats indefinitely to mimic the operation of a standard traffic light.

Component List

Arduino UNO

Traffic Light

Wiring Details

Arduino UNO

Traffic Light

Documented Code

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

// Pin definitions
const int redPin = 1;    // Red LED connected to pin D1
const int yellowPin = 2; // Yellow LED connected to pin D2
const int greenPin = 3;  // Green LED connected to pin D3

void setup() {
  // Initialize the digital pins as outputs
  pinMode(redPin, OUTPUT);
  pinMode(yellowPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
}

void loop() {
  // Red LED on for 5 seconds
  digitalWrite(redPin, HIGH);
  delay(5000);
  digitalWrite(redPin, LOW);
  
  // Yellow LED on for 2 seconds
  digitalWrite(yellowPin, HIGH);
  delay(2000);
  digitalWrite(yellowPin, LOW);
  
  // Green LED on for 5 seconds
  digitalWrite(greenPin, HIGH);
  delay(5000);
  digitalWrite(greenPin, LOW);
}

File Name: norlis afni.ino

Note: The pin numbers in the code correspond to the digital pins on the Arduino UNO. The code controls the state of each LED by setting the pin HIGH (LED on) or LOW (LED off) and uses delays to manage the timing of the light sequence.