Inspiration

While driving, our member noticed delays made at intersection for emergency vehicles. These delays build over the trip and we wanted to create a solution to minimize this delay to increase the efficiency of the trip


What it does

AmbuTraffic is a real-time traffic priority system that detects approaching ambulances and changes the state of traffic lights to secure a path for the vehicle It overrides normal signal logic, manages conflicting movements like left turns, and tries to minimize delay so emergency vehicles can pass through intersections safely and as fast as possible.


How we built it

We built a traffic intersection simulator using Python and Pygame to simulate traffic behavior.

  • Modeled roads as a graph (nodes → edges → routes → intersection)
  • Vehicles follow lane-based routes (straight, left, right)
  • Traffic lights implemented as state machines with emergency override
  • Ambulance proximity triggers a priority zone that preempts signals
  • Yield logic handles conflicts (e.g., left turns yielding to oncoming traffic) using distance and time-to-collision calculations
  • Smooth vehicle turns using trigonometry and Bézier-style curves
  • JSON presets define intersection layouts and signal configurations

This allowed us to test and visualize how intersections respond dynamically to emergency vehicles.


Challenges we ran into

  • Designing realistic yield behavior at intersections, especially for left turns
  • Preventing deadlocks when multiple vehicles reacted to an emergency override
  • Visualizing invisible logic like stop lines, safety gaps, and priority zones
  • Making vehicles “aware” of other vehicles and lights efficiently
  • Traffic light reset logic became more complex than expected

Accomplishments that we’re proud of

  • Implemented a working emergency vehicle priority system
  • Modeled realistic intersection conflict rules instead of simple green/red logic
  • Built a visual simulator that clearly demonstrates the impact of our system
  • Turned a complex traffic control problem into an understandable demo

What we learned

  • Traffic systems are inherently state-driven and require careful edge-case handling
  • Small logic flaws can cascade into major system failures

What’s next for AmbuTraffic

  • Support multiple emergency vehicles simultaneously
  • improve so priority before the vehicle leaves radius
  • Expand from single intersections to city-scale routing

Built With

Share this project:

Updates