Show HN: ESPectre – Motion detection based on Wi-Fi spectre analysis (github.com)

215 points by francescopace ↗ HN
Hi everyone, I'm the author of ESPectre.

This is an open-source (GPLv3) project that uses Wi-Fi signal analysis to detect motion using CSI data, and it has already garnered almost 2,000 stars in two weeks.

Key technical details:

- The system does NOT use Machine Learning, it relies purely on Math. — Runs in real-time on a super affordable chip like the ESP32. - It integrates seamlessly with Home Assistant via MQTT.

15 comments

[ 3.2 ms ] story [ 41.0 ms ] thread
Amazing stuff!

Am I right in understanding that only a single ESP32 device is needed (plus a router)?

Been working on this very idea casually for couple years with ESP-IDF and I could never get the statistical signal processing just right (by my definition). Things I've tried: adapting filtering (LMS, Kalman), kernel methods (NEWMA, MMD), detectors (CUSUM, GLR), dimensionality reduction (random projection, online PCA), whitening, etc.

I use a single ESP32 in STA/AP mode which sniffs ACK packets with a specific destination mac, which come from any server on my WiFi network (uses a special sniffing mode IIRC). This way I can receive regular CSI packets originating from a fixed location and doesn't need another device running.

I'll have to look at this code, maybe I just overlooked the obvious or my requirements were too high!

Interesting! Are you familiar with tommysense.com? I think it doing something similar? Did not yet have time to try it.
Would this work with a mesh router?
Fun fact: I’m working on turning ESPectre into a Wi‑Fi Theremin (the musical instrument you play by moving your hands near an antenna).

The idea of “playing” by simply moving around a room sounds a bit ridiculous… but also kind of fun.

The key is the Moving Variance of the spatial turbulence: this value is continuous and stable, making it perfect for mapping directly to pitch/frequency, just like the original Theremin. Other features can be mapped to volume and timbre.

It’s pure signal processing, running entirely on the ESP32. Has anyone here experimented with audio synthesis or sonification using real-time signal processing?

Great project and great idea, thank you for sharing !

I don't know if it's useful but one technique I have used in sonification during the experimentation phase is to skip the real time aspect, capture all the available "channels" and generate all the possible permutations of what is mapped where.

Then you can listen to the outputs, see what sounds good, and then test it in real time to check if the musicality is actually a result of the physical interaction and not an artifact or a product of noise.

> The system does NOT use Machine Learning, it relies purely on Math.

You may be surprised to find out how machine learning works!

my brain expected the part after `-` to be new speculative execution bugs
Using two ESP32-S3 modules you can get ~6000 packets per second with CSI data. I'm using this as a cheap replacement for specialty high-G gyroscope modules, but it could see use for this type of motion detection as well.
The surveillance implications for this technology are fascinating and frightening.
I see you have done a fair amount of work to document calibration for various scenarios. Have you tried to calibrate to ignore cats? Can you prioritize different algorithms to focus on size rather than speed of movement?

Also, I use an ebay purchased ruckus router designed for commercial settings. Will the stronger signal and beam forming from the router provide better or worse performance, or is that mainly down to the esp32?

Currently, ESPectre performs only binary motion detection (IDLE/MOTION) based on simple statistical thresholding.

It cannot ignore cats or prioritize size over speed directly on the device, but ESPectre's architecture is designed to enable this kind of advanced classification externally.

It collects a rich set of pre-processed features (spatial turbulence, entropy, etc.) and transmits them via MQTT.

Any external server (like a Home Assistant add-on or a dedicated Python script) can use these features as the input for a trained ML model to perform classification (e.g., Cat vs. Human vs. Fall detection vs. Gesture detection).

Regardin Ruckus Router / Beamforming: for CSI sensing, stability is generally more important than raw power. I recommend starting by disabling beamforming or reducing the power output if you experience poor motion sensitivity, as the stability of the ESP32 receiver is often the bottleneck.

This jogged some memories! Was working on something that used radio waves to detect objects and humans ~5 years ago, I see that we've come a long way since then.

One of our goals(abandoned) was to also extend to wifi routers, so I am excited to see continued interest in this space!

https://www.sensorsportal.com/HTML/ST_JOURNAL/PDF_Files/P_32...

Thanks for sharing the paper; I'll certainly be taking a look at that research!