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

Arduino UNO Wi-Fi Controlled Traffic Light System with Camera Integration

View and Edit Project In Cirkit DesignerImage of Arduino UNO Wi-Fi Controlled Traffic Light System with Camera Integration

Circuit Documentation

Summary

This circuit is designed to control a traffic light system using an Arduino UNO microcontroller. The system includes a traffic light module, an ESP8266 ESP-01 WiFi module for communication, and a TTL Serial JPEG Camera for capturing images. The Arduino UNO manages the traffic light signals and communicates with the ESP8266 module to send status updates.

Component List

Arduino UNO

Traffic Light

ESP8266 ESP-01 WiFi Module

TTL Serial JPEG Camera

Wiring Details

Arduino UNO

Traffic Light

ESP8266 ESP-01 WiFi Module

TTL Serial JPEG Camera

Code Documentation

Arduino UNO Code

// Pin definitions
const int redPin = 2;
const int yellowPin = 3;
const int greenPin = 4;
const int esp8266RxPin = 8;
const int esp8266TxPin = 9;

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

  // Initialize serial communication with ESP8266
  Serial.begin(9600);
  Serial.println("Traffic Light Controller Initialized");
}

void loop() {
  // Red light on
  digitalWrite(redPin, HIGH);
  delay(5000); // Red light for 5 seconds
  digitalWrite(redPin, LOW);

  // Green light on
  digitalWrite(greenPin, HIGH);
  delay(5000); // Green light for 5 seconds
  digitalWrite(greenPin, LOW);

  // Yellow light on
  digitalWrite(yellowPin, HIGH);
  delay(2000); // Yellow light for 2 seconds
  digitalWrite(yellowPin, LOW);

  // Send status to ESP8266
  Serial.println("Traffic Light Cycle Complete");
}

This code initializes the traffic light pins as outputs and sets up serial communication with the ESP8266 module. The loop function cycles through the red, green, and yellow lights, each for a specified duration, and sends a status message to the ESP8266 module after each cycle.