How I Turned My Wi-Fi Into a Motion Sensor
- Last Updated: January 26, 2026
Francesco Pace
- Last Updated: January 26, 2026



On September 26, 2025, the IEEE 802.11bf standard was published, enabling Wi-Fi to natively detect motion. But I didn't want to wait.
The first compatible devices will arrive in a few months (maybe), but as a home automation enthusiast, I have a problem with waiting.
So I developed a motion detection system based on Wi-Fi spectrum analysis that:
The project (ESPectre) is open source with over 4000 GitHub stars. Perhaps I wasn't the only impatient one!
My name is Francesco Pace. I have a degree in mathematics and have been working in IT for over 20 years. Home automation is one of my passions, and recently I discovered the world of Wi-Fi sensing.
Although the 802.11bf standard was just released, the underlying technology isn't new. It's called Channel State Information (CSI) and involves processing physical information from the Wi-Fi signal's subcarriers.
The problem? The signal is extremely noisy. Appliances, TVs, cell phones, and people themselves generate continuous interference. For this reason, most existing solutions use Machine Learning techniques to clean the data and recognize specific patterns of human movement.
In a world now dominated by AI and Machine Learning, I wanted to demonstrate that it's possible to achieve excellent results even with inexpensive hardware, using only mathematics and signal processing. No neural networks, no model training, no gigabyte datasets: just mathematical algorithms, digital filters, and classic signal analysis.
Before diving into how it works, let's address the obvious question: why use Wi-Fi when PIR and mmWave sensors are everywhere?
PIR sensors are cheap and simple, but they only work with line of sight and can't detect through walls or stationary objects.
mmWave radar is very accurate and can detect stationary presence, but each sensor covers a limited area (typically one room). The 24GHz signal is heavily attenuated by walls, so you likely need one sensor per room.
Cameras provide rich data and activity recognition, but they're a privacy nightmare and require high processing power.
Wi-Fi sensing has a unique advantage: through-wall detection. A single ESP32 in your living room can detect movement in adjacent rooms. The radio waves pass through walls, furniture, and doors. No sensor placement optimization, no dead zones.
Imagine holding a lit flashlight in a dark room. If you move your hand in front of the light, the shadow changes. If someone walks into the room, the shadows move differently.
Wi-Fi works the same way, but with invisible electromagnetic waves instead of light. When someone moves in a room, they "disturb" the Wi-Fi waves traveling between the router and the sensor. The sensor "listens" to these changes and understands if there is movement.
Technically, what we analyze is called CSI (Channel State Information): information about the state of the radio channel.
In modern Wi-Fi systems (OFDM), the signal is transmitted over dozens of subcarriers, i.e., different frequencies traveling in parallel. For each subcarrier, the receiver calculates:
Each subcarrier is represented as a complex number with two components: I (In-phase) and Q (Quadrature). This I/Q representation captures both amplitude and phase in a single value: $Amplitude = \sqrt{I^2 + Q^2}$.
Why is this important? Because when a person moves, both the amplitude (the signal attenuates or strengthens) and the phase (the signal arrives with a different delay due to reflections) change. These changes are mathematically detectable even through walls, without the need for cameras or microphones.
Here's where it gets interesting. How do you go from radio waves to "someone is home?"
The ESP32 provides 64 subcarriers, but not all are equally useful. Some are noisier, others are more sensitive to movement. The system uses an automatic calibration algorithm that runs at boot time. During a brief 10-second quiet period, it analyzes each subcarrier's signal quality and automatically selects the best ones for your specific environment.
The heart of the system is an algorithm called Moving Variance Segmentation:
Raw CSI data is noisy. The system applies a filter pipeline to clean the signal:
After extensive testing with real-world data (over 500 unit tests, 90% code coverage), the results are promising:
This approach runs on most ESP32 variants. The ESP32-S3 is recommended for the best performance. The ESP32-C6 offers great value with Wi-Fi 6 support. The ESP32-C3 is a budget-friendly option. The original ESP32 works but is less optimized.
For smart home enthusiasts, the system integrates with Home Assistant through ESPHome. A YAML configuration file defines the device settings, and after flashing, the ESP32 appears in Home Assistant as a binary motion sensor.
Tuning a motion sensor is usually boring, so I built a browser-based game where your body is the controller. You play as a "Spectrum Guardian" protecting WiFi frequencies from enemies. The game is actually a calibration tool in disguise; while you play, the system identifies your baseline noise and adjusts the detection threshold automatically.
Although CSI data is technically anonymous, the system can detect the presence of people. Users are responsible for obtaining consent, complying with applicable privacy laws (e.g., GDPR, CCPA), and using the system only in environments they control.
This project demonstrates that it's possible to build advanced sensing systems using inexpensive hardware and classical mathematical approaches. ESPectre is completely open source (GPLv3) and available on GitHub.
The Most Comprehensive IoT Newsletter for Enterprises
Showcasing the highest-quality content, resources, news, and insights from the world of the Internet of Things. Subscribe to remain informed and up-to-date.
New Podcast Episode

Related Articles