Drone Detection by Acoustic Signatures on ESP32-S3
The ESP32-S3 with the ICS-43434 I2S microphone enables quadcopter detection for just $15. The Goertzel algorithm analyzes characteristic propeller frequencies locally, without cloud services. This solves the latency and external infrastructure dependency issues typical of radars or server-based ML models.
Quadcopters generate predictable noise in narrow frequency bands. The Goertzel filter efficiently extracts these signals from the I2S audio stream, minimizing computations. The ESP32-S3 handles real-time processing thanks to its dual-core processor and DSP instruction support.
How the Goertzel Algorithm Works
The Goertzel algorithm is an optimized DFT for a single frequency. It requires fewer resources than FFT, making it ideal for embedded systems. The recursive filter formula:
$$ Q_k = x(n) + 2 \cos(2\pi k / N) \cdot Q_{k-1} - Q_{k-2} $$
Where $k$ is the target frequency, $N$ is the window size. A signal power peak at $k$ indicates drone presence.
The ESP32 implementation includes audio buffering (16 kHz, 16-bit), applying the filter on a sliding window of 1024–4096 samples. The trigger threshold is adjustable via calibration.
Comparison with Alternatives
- Radars: Cost from $100, high power consumption, require frequency licenses.
- Cloud ML (Azure/AWS): Network dependency, 100–500 ms latency, data privacy risks.
- TensorFlow Lite / ESP32-NN: Require model training, 50–200 KB RAM, harder to debug.
- Goertzel on ATtiny85: Runs on 8-bit MCU with 8 KB flash, but no I2S—needs ADC.
The Goertzel algorithm wins in simplicity: 1–2 KB code, <10% CPU at 240 MHz.
Practical Implementation and Calibration
Schematic: ESP32-S3-WROOM + ICS-43434 (I2S: BCLK=GPIO4, WS=GPIO5, DATA=GPIO6). Power 3.3V, consumption ~100 mA.
Calibration:
- Record baseline ambient noise (city, forest).
- Identify drone frequencies (typically 150–300 Hz for propellers).
- Set threshold: power_k > 10 * baseline.
Protection from interference:
- Foam windscreen on the microphone (reduces wind noise by 20 dB).
- Directional acoustic amplifier (like historical "war trumpets").
- Low-frequency filtering (<100 Hz) to exclude traffic.
Detection range: 50–200 m in quiet environments, depending on drone power and wind.
Prospects for ML Integration
ESP32-S3 supports ESP-DL and TensorFlow Lite Micro. A lightweight CNN (10–50 KB) can classify spectrograms to recognize drone types. However, for mid/senior developers, the basic Goertzel is a great starting point: easy to prototype and scale to multiple frequencies.
Testing: Compare SNR on real recordings (DJI Mavic—peaks at 180/220 Hz).
Key Takeaways
- The Goertzel algorithm enables real-time analysis on ESP32 without the cloud.
- Cost < $15 USD, compatible with ATtiny for ultra-compact solutions.
- Environment-specific calibration is essential to reduce false positives.
- Range 50–200 m, improved with directional amplifiers.
- Future: ESP-NN for drone type classification.
— Editorial Team
No comments yet.