Introduction
A Traffic Light Controller is an electronic system used to control traffic flow at road intersections by automatically switching traffic lights in a predefined sequence. It helps reduce traffic congestion and prevents accidents by providing organized traffic management.
This project demonstrates an automated traffic signal system using a microcontroller.
Objective of the Project
- To design an automatic traffic signal system.
- To control traffic lights in proper sequence.
- To understand timing control using microcontrollers.
- To simulate real-world traffic management.
Working Principle
The Traffic Light Controller works on time-based sequencing.
How It Works
- Red, Yellow, and Green LEDs represent traffic signals.
- Arduino controls LEDs based on timing logic.
- Each light stays ON for a fixed duration.
- Sequence repeats continuously.
Components Required
- Arduino Uno
- LEDs (Red, Yellow, Green)
- Resistors (220Ω)
- Breadboard
- Jumper Wires
- Power Supply
Circuit Diagram
LED Connections
Red LED -> D8 (via 220Ω resistor)
Yellow LED -> D9 (via 220Ω resistor)
Green LED -> D10 (via 220Ω resistor)
All LED GND -> GND
Arduino Code for Traffic Light Controller
int red = 8;
int yellow = 9;
int green = 10;
void setup() {
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}
void loop() {
// Red light
digitalWrite(red, HIGH);
digitalWrite(yellow, LOW);
digitalWrite(green, LOW);
delay(5000);
// Green light
digitalWrite(red, LOW);
digitalWrite(yellow, LOW);
digitalWrite(green, HIGH);
delay(5000);
// Yellow light
digitalWrite(red, LOW);
digitalWrite(yellow, HIGH);
digitalWrite(green, LOW);
delay(2000);
}
Code Explanation
- LEDs are connected to Arduino digital pins.
- Arduino switches lights in sequence.
- Delay function controls timing.
- Sequence repeats continuously.
Advantages
- Automated traffic control
- Reduces human error
- Simple and reliable
- Cost-effective
Applications
- Road intersections
- Traffic simulation models
- Smart city projects
- Educational demonstrations
Future Enhancements
- Sensor-based traffic control
- Pedestrian signal integration
- IoT-based traffic monitoring
- Countdown timer display
Conclusion
The Traffic Light Controller is a simple yet important electronics project that demonstrates real-world traffic management using microcontrollers. It is an excellent learning project for students studying embedded systems and smart city solutions.
