The problem
Emergency vehicles lose critical minutes waiting at red lights, and real-world preemption systems (the kind that hold green lights for ambulances) cost far more than a student lab can justify and demand certified hardware. This project distills the core idea into a bench-top demonstrator: an ESP32 board, an electret microphone module, and a model traffic light showing how acoustic siren recognition can preempt a signal cycle. The hard engineering problem is not lighting LEDs — it is recognizing a siren reliably. Ambulance sirens alternate between two tones (typically around 650 Hz and 950 Hz, a design reference used here), and the firmware looks for exactly that alternation in the FFT spectrum rather than reacting to loudness, which is what separates it from a toy that flips on every car horn. The override logic also matters: a real preemption must hold green long enough for the vehicle to clear the intersection and then release control safely with an amber transition and a hold-off timer after the siren fades.
Electret microphone module with onboard amplifier that captures street-level audio.
Follow the working sequence
How it works
- The electret microphone module captures ambient sound; the ESP32's ADC samples it at approximately 8 kHz (a design target, 1024 samples per window).
- Each window is passed through a 1024-point FFT on the ESP32, giving roughly 7.8 Hz frequency resolution — enough to separate the two siren tone bands.
- The firmware measures energy in each tone band and checks whether the dominant tone alternates between them at the expected siren rate (each tone held approximately 0.4–0.8 s, a design value).
- The alternation must persist across a configurable number of consecutive windows (design default 4) before detection is confirmed, rejecting single-tone horns and broadband noise.
- On confirmation, the preemption state machine takes over the model intersection: cross lane to red, emergency lane through amber to green.
- The state machine holds the preemption until the siren has been absent for the full hold-off time (design default 10 s), then releases control and resumes the normal cycle.
- Every detection, release and timeout is logged over serial, so the demonstration shows exactly what the algorithm heard and decided.
Tech stack:
- ESP32-WROOM-32 development board
- Arduino IDE (ESP32 core)
- arduinoFFT library
- Electret microphone module with onboard amplifier (e.g. MAX4466-based)
- Model traffic light (3-LED, logic-level drive)
- Breadboard, jumper wires, 5 V USB supply
- Phone-played siren test audio (for calibration)
| Parameter | Value |
|---|---|
| Controller | ESP32-WROOM-32 (240 MHz dual-core, 3.3 V logic) |
| Audio sensor | Electret microphone module with adjustable onboard amplifier |
| Sampling rate | Approximately 8 kHz (design target) |
| FFT window | 1024 samples, design value (approximately 7.8 Hz bin resolution) |
| Siren tone bands | Design reference 650 Hz / 950 Hz alternating two-tone |
| Tone dwell time | Approximately 0.4–0.8 s per tone (design value) |
| Detection confirmation | Approximately 4 consecutive alternating windows (design default, configurable) |
| Preemption action | Green for emergency lane, red for cross lane on model intersection |
| Hold-off timer | Approximately 10 s after siren fades (design default, configurable) |
| Power supply | 5 V USB (approximately 500 mA expected draw, all-logic design) |
Project features
- [Two-tone siren recognition] The ESP32 samples microphone audio at approximately 8 kHz and runs a 1024-point FFT on-device, watching for energy that alternates between the two siren tone bands (design reference 650 Hz / 950 Hz) across a rolling detection window.
- [Signal preemption override] On confirmed siren detection, the firmware suspends the normal cycle, forces green for the emergency lane and red for the cross lane, then returns control through an amber transition.
- [Hold-off timer] A configurable hold-off (default design value 10 seconds) keeps the preemption active after the siren fades, so a momentarily quiet stretch of road noise does not release the green early.
- [Loudness-independent detection] The decision uses the alternating-tone pattern, not raw volume, so traffic noise and distance do not gate detection — only the siren signature does.
- [Tuneable detection thresholds] Siren tone frequencies, alternation timing, confirmation count and hold-off time are constants in the firmware, documented for viva discussion and adjustable during the buyer's own calibration.
- [Serial status log] Detection events, dominant tone, and preemption state changes print over USB serial for debugging and demonstration.
- [Model intersection controller] The ESP32 also drives the model intersection's normal red-amber-green cycle (all-LED, no mains wiring), which the preemption logic can interrupt and restore.
- [Calibration procedure] A step-by-step procedure to verify tone bands against a phone-played siren recording, set the confirmation count, and test false-trigger resistance with horn and music clips.
What is included
- Working prototype: ESP32 board, electret microphone module, model traffic light, wired on breadboard
- Complete firmware source code with commented detection and preemption state machine
- Circuit and wiring documentation with connection tables
- Component list with exact part descriptions
- Calibration procedure document (tone verification, threshold tuning, false-trigger testing)
- Project report PDF (background, siren acoustics, FFT design, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (FFT, sampling, siren patterns, preemption logic, limitations)
Limitations & prerequisites
- The override acts on a MODEL intersection only. It never connects to, and must never be used on, real municipal traffic signals — any roadside use would need municipal approval, certified hardware and fail-safe design far beyond a student prototype.
- False triggers are a real risk: loud horns, music with strong tonal content, and some alarm sounds can momentarily resemble a siren; the confirmation count trades detection speed against false-alarm resistance.
- Detection is range-limited: a siren several blocks away may fall below usable microphone levels, and heavy rain or wind noise degrades recognition — expected, and measurable during the buyer's calibration.
- The siren tone bands are design references, not measurements: actual ambulance sirens vary by model and region, so the buyer must tune the firmware constants against real siren audio during calibration.
- FFT resolution depends on the window and sample rate; short siren bursts can be missed between windows, so detection has an inherent latency of roughly one window length plus the confirmation count.
- The electret module has no directional discrimination — it hears sound from all directions, so it cannot tell which lane the ambulance is approaching from; the emergency lane is assigned, not detected.
Frequently Asked Questions
How does it tell a siren apart from a car horn?
A horn is a steady single tone; an ambulance siren alternates between two tones. The firmware runs an FFT on the microphone audio and looks for energy switching between the two siren tone bands across consecutive windows, so loudness alone never triggers preemption — only the alternating pattern does.
Can it change a real traffic signal?
No — and it must not be attempted. This project drives a tabletop model intersection with LEDs. Real traffic signals are mains-powered, municipally controlled and safety-critical; connecting unapproved hardware to them is dangerous and unlawful. The prototype demonstrates the recognition and control logic that real preemption systems use.
Which controller is used?
An ESP32-WROOM-32 development board, programmed with the Arduino IDE using the arduinoFFT library. It samples the microphone through its own ADC, so no external audio processor is needed.
What power supply is needed?
A standard 5 V USB adapter or laptop USB port — the whole build is low-voltage logic, approximately 500 mA expected, with no mains wiring anywhere.
What are the main limitations?
False triggers from horns or tonal music, limited detection range outdoors, tone bands that must be tuned to local sirens, and no directional hearing — the microphone cannot tell which lane the ambulance approaches on. Each is covered in the report with the honest workaround.
Is this project suitable for a final-year project?
Yes — for Electronics and Telecommunication programs. It demonstrates digital signal processing (sampling, FFT, spectral analysis), embedded C firmware, sensor interfacing, and traffic control logic, with measurable parameters to discuss in the viva.
Components & software requirements
- ESP32-WROOM-32 development board
- Arduino IDE (ESP32 core)
- arduinoFFT library
- Electret microphone module with onboard amplifier (e.g. MAX4466-based)
- Model traffic light (3-LED, logic-level drive)
- Breadboard, jumper wires, 5 V USB supply
- Phone-played siren test audio (for calibration)
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.