The Smart Adaptive Traffic Signal System is an Arduino-based prototype that intelligently controls traffic lights based on real-time traffic density and motion detection.
It minimizes waiting time, improves traffic flow efficiency, and safely handles emergency and pedestrian situations โ making it a practical demonstration of smart city automation.
| Feature | Description |
|---|---|
| Adaptive Timing | Automatically adjusts green light duration using an ultrasonic distance sensor. |
| Motion Detection | Detects vehicle movement on the secondary lane using a PIR sensor. |
| Emergency Mode | Instantly prioritizes one lane for emergency vehicles. |
| Pedestrian Mode | Halts all lanes temporarily for safe crossing with a buzzer alert. |
| Visual Display | LCD shows real-time status: lane, distance, activity, and timers. |
| Audible Alerts | Buzzer provides transition beeps and pedestrian countdown signals. |
| Component | Quantity | Function |
|---|---|---|
| Arduino UNO | 1 | Main controller |
| HC-SR04 Ultrasonic Sensor | 1 | Measures queue distance (Lane 1) |
| PIR Motion Sensor | 1 | Detects movement (Lane 2) |
| 16x2 IยฒC LCD Display | 1 | Displays system status |
| LEDs (Red, Yellow, Green) | 6 | Simulate traffic lights |
| Push Buttons | 2 | Pedestrian and emergency triggers |
| Buzzer | 1 | Audible alerts |
| Breadboard, Jumpers, Resistors | โ | Circuit wiring and support |
-
Traffic Density Measurement
- Ultrasonic sensor measures the distance of vehicles queued in Lane 1.
- Shorter distance โ higher density โ longer green duration.
-
Motion Detection
- PIR sensor detects approaching vehicles on Lane 2.
- Detected motion increases green time for Lane 2.
-
Adaptive Control
- Each laneโs green light duration adjusts dynamically:
- High density โ 7s
- Medium โ 5s
- Low โ 3s
- Each laneโs green light duration adjusts dynamically:
-
Emergency Mode
- Pressing the emergency button immediately activates green for Lane 1.
-
Pedestrian Mode
- Pedestrian button activates an all-red state for 5 seconds with buzzer countdown.
-
Safety Transition
- Includes 2-second yellow and 1-second all-red intervals to prevent collisions.
| Component | Arduino Pin | Description |
|---|---|---|
| HC-SR04 TRIG | D2 | Ultrasonic trigger |
| HC-SR04 ECHO | D3 | Ultrasonic echo |
| PIR OUT | D4 | Motion input |
| Lane 1 LEDs | D5โD7 | Green, Yellow, Red |
| Lane 2 LEDs | D8โD10 | Green, Yellow, Red |
| Pedestrian Button | A0 | Active LOW input |
| Emergency Button | A1 | Active LOW input |
| Buzzer | A2 | Tone output |
| LCD SDA | A4 | IยฒC data |
| LCD SCL | A5 | IยฒC clock |
| +5V / GND | โ | Power to all modules |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Arduino UNO โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ HC-SR04 โ D2 (TRIG), D3 (ECHO) โ
โ PIR โ D4 โ
โ LCD IยฒC โ A4 (SDA), A5 (SCL) โ
โ Ped Btn โ A0, Emerg Btn โ A1 โ
โ Buzzer โ A2 โ
โ Lane 1 LEDs โ D5โD7 โ
โ Lane 2 LEDs โ D8โD10 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Full code is available in
Smart_Traffic_Signal.ino
The code:
- Reads sensor inputs (HC-SR04, PIR)
- Calculates adaptive green times
- Displays results on LCD
- Handles pedestrian/emergency overrides
- Controls LEDs and buzzer alerts
| Test | Expected Behavior |
|---|---|
| Power ON | LCD shows โSmart Traffic System Ready.โ |
| Ultrasonic Sensor | Move an object closer โ Lane 1 green time increases. |
| PIR Sensor | Wave hand near PIR โ Lane 2 activity increases. |
| Pedestrian Button | All lights turn red for 5 seconds; buzzer beeps. |
| Emergency Button | Lane 1 turns green immediately. |
| LCD Display | Shows lane status, sensor readings, and timers. |
Use the Serial Monitor (115200 baud) to verify sensor data and timing logic.
| Traffic Condition | Lane 1 (Ultrasonic) | Lane 2 (PIR) |
|---|---|---|
| High Density | 7 s Green | 3โ5 s Green |
| Medium Density | 5 s Green | 3โ5 s Green |
| Low Density | 3 s Green | 3 s Green |
Yellow phase โ 2 s
All red โ 0.8 s
Pedestrian crossing โ 5 s
- Technical Impact: Demonstrates adaptive embedded control using real-time sensor feedback.
- Social Impact: Reduces idle time, saves fuel, and improves pedestrian safety.
- Scalability: Can be expanded to 4-lane or IoT-connected traffic systems.
- Add Wi-Fi (ESP8266) or GSM module for remote traffic monitoring.
- Integrate multiple ultrasonic sensors for 4-way intersections.
- Add data logging for traffic analytics.
- Use machine vision (camera module) for vehicle classification.
- Hardware Platform: Arduino UNO R3
- Programming Language: C++ (Arduino IDE)
- Version: 1.0
- Project Type: Personal Academic Project
- Repository Purpose: For documentation and demonstration of embedded system design.
This project is developed solely for personal and academic demonstration purposes.
You are free to view, study, and replicate this design for learning or non-commercial projects.
Please credit the author if you reference or reuse any part of the code or documentation.