Inspiration
Traffic lights in many small towns are operated by fixed timers that are not affected by the actual number of cars waiting at the intersection. Traffic jams, longer lines, and needless delays are frequently the results of this. Smart traffic management systems can be used in large cities, but smaller towns typically cannot afford or use them. For this reason, we set out to develop a straightforward, reasonably priced system that can regulate traffic lights in response to the presence of vehicles in real time. Wait times will be shortened and traffic flow will be improved.
What it does
Our system uses three IR sensors placed at a 3-way junction to detect how many vehicles are present. Depending on traffic density, the system changes the green light duration—longer green for heavy traffic and shorter for light traffic. The traffic lights are shown with red and green LEDs on a breadboard, and the green light time is displayed live on MATLAB.
How we built it
An ESP32 microcontroller, which reads the sensor data and adjusts the LEDs accordingly, is connected to the infrared sensors. The timing is set: 3 seconds for light traffic and 10 seconds for heavy traffic. In order to visually display the green light time, we linked the ESP32 to MATLAB. For demonstration, the entire setup is constructed on a breadboard.
Challenges we ran into
Because sunlight and other factors influenced the readings, it was difficult to get the IR sensors to detect cars accurately. It was also difficult to keep the LEDs and sensor data in perfect sync. It required some troubleshooting to connect the ESP32 to MATLAB and obtain real-time updates. It hasn't been thoroughly tested in actual traffic yet because we tested with objects rather than actual cars.
Accomplishments that we're proud of
We managed to combine hardware and software into a working system that reacts to traffic conditions. The project shows how simple sensors and microcontrollers can improve traffic flow. It gave us good experience working with embedded devices and data visualization.
What we learned
We learned how to program the ESP32 and integrate it with infrared sensors to precisely detect vehicles through this project. Timing logic that reacts to real-time inputs is essential for any automated control system, and we learned how to design and implement it. We learned the value of fine-tuning hardware components by calibrating sensors to minimize errors. We learned how to smoothly integrate hardware and software by connecting the microcontroller with MATLAB for real-time data visualization. Most significantly, we discovered that intelligent, adaptive control systems have the potential to significantly improve the efficiency and responsiveness of traffic management, even though fixed timing offers a solid foundation.
What's next for Smart Traffic Management System
We want to improve the system to adjust green light durations dynamically based on actual traffic trends. Using machine learning to predict traffic flow could make it smarter. Testing the system with real vehicles and multiple junctions will help make it practical. We also want to use better sensors to improve detection reliability.
Built With
- breadboard
- esp32
- ir
- leds
- matlab
- sensors
Log in or sign up for Devpost to join the conversation.