Final year project
Design and Implementation of an Online Smart Traffic Management System
A density-responsive traffic signal controller with emergency vehicle preemption, live cloud telemetry and a remote operations dashboard. The roadside sensing hardware is replaced by a microscopic traffic simulator; every other layer - the control algorithm, the ingest API, the database tier, the operator command channel - is working software.
The problem, stated precisely
Fixed timings
A pre-timed controller holds green for an empty approach while a queue builds on the next one. The cycle repeats identically whether five vehicles are waiting or fifty.
Emergency delays
An ambulance held at a red light loses time that cannot be recovered. A legacy controller has no way to detect one, let alone respond.
Environmental cost
Every second of unnecessary idling burns fuel and emits CO2. The system measures both, so the saving is quantified rather than claimed.
No data
Manual traffic counts are expensive, infrequent and error-prone, which leaves planning decisions resting on guesswork.
How the system works
Three tiers, matching the perception / network / application model in the report. The seam between tier one and tier two is a plain JSON contract, which is exactly why the simulator can stand in for hardware without the rest of the system noticing.
1. Perception layer
Sensing vehicles at the kerb
- Per-lane queue length, occupancy and longest wait
- Stop-bar detection driving gap-out decisions
- Emergency vehicle identification on approach
In this build: A microscopic car-following model produces these readings from true vehicle positions. Swapping in real IR or ultrasonic sensors means replacing one method.
2. Network layer
Moving data and commands
- Batched JSON telemetry uploaded to the cloud API
- Device-key authentication on ingest
- Operator commands polled and acknowledged by the edge
In this build: Fully implemented over HTTPS. The command loop really does round-trip through the database, so the latency on screen is genuine.
3. Application layer
Storage, dashboard, reporting
- MongoDB persistence with an in-memory fallback
- Live operations dashboard and audit trail
- Planning reports with peak-hour analysis
In this build: Production code, deployed on Vercel. Runs with or without a database configured.
What makes the control adaptive
Green time proportional to density
The time needed to discharge a queue of D vehicles is the startup lost time plus D saturation headways. The allocation is that figure, clamped between a pedestrian-clearance minimum and a starvation ceiling.
T = clamp(8s, 2.0s + D x 2.0s, 45s)
Gap-out
Once the minimum green has been served and no vehicle has crossed the stop-bar detector for the gap threshold, the queue has discharged and the green ends early. Every second recovered this way is logged.
terminate when headway > 3.0s and elapsed >= minGreen
Phase skipping
A phase with no demand is not served at all. This is the single largest source of the improvement over fixed timing, and it is what drives idle green time towards zero.
Emergency preemption
When an emergency vehicle is detected on approach, the running green is truncated, the intersection is cleared through yellow and all-red, and the corridor is held green until the vehicle passes.
Starvation guard
A movement ignored for longer than two maximum-green periods is promoted regardless of queue length, so a light approach can never be starved indefinitely by a heavy one.
score = queue + 0.12 x maxWait + 0.06 x timeSinceServed
Measured, not asserted
A second controller running fixed timings is stepped in lockstep on an identical seeded arrival stream. The difference between the two is the benefit of adaptive control, measured under controlled conditions.
What is simulated, and what is not
Stated plainly, because a reviewer will ask.
Real, working software
- The adaptive control algorithm, including gap-out, phase skipping, starvation protection and preemption
- The microscopic traffic model: Poisson arrivals, car-following dynamics, saturation-flow discharge
- REST API with request validation, device-key auth and batch telemetry ingest
- MongoDB schemas, indexes and the full data-access layer
- Operator command queue with cloud-to-edge delivery and acknowledgement
- Live dashboard, audit trail and planning reports
- Deployment configuration for Vercel
Simulated, pending hardware
- IR / ultrasonic sensor hardware and its GPIO wiring
- Physical LED signal heads and their relay drivers
- The Raspberry Pi runtime (the browser plays this role in demo mode)
- Camera-based vehicle classification, which the roadmap covers as a future upgrade
- Weather effects on sensor reliability, noted as a limitation in the report
The hardware integration path is documented in full - wiring, GPIO pin map, the exact interface a Raspberry Pi must implement, and the provisioning steps - in the hardware roadmap.