๐ป E-fiSpectre: Wi-Fi Spectre Analysis Motion Detection ๐ A spooky-smart motion detection system leveraging Wi-Fi CSI (Channel State Information) with seamless Home Assistant integration via ESPHome ๐
Advanced Motion Detection via Wi-Fi Spectral Analysis (CSI)
E-fiSpectre is a non-invasive motion detection system that leverages Channel State Information (CSI) from standard Wi-Fi signals. By analyzing signal fluctuations on the edge, it turns a standard ESP32 microcontroller into a highly sensitive presence sensorโwithout cameras, microphones, or wearables.
- Project Overview
- Key Features
- Mathematical Model
- Hardware Requirements
- System Architecture
- Installation
- Future Scope
- License
- Author
E-fiSpectre solves the privacy and cost issues associated with traditional home security systems. Instead of using video feeds or expensive PIR sensors (which often fail to detect stationary subjects), this system monitors the physical "disturbance" of Wi-Fi waves caused by human movement.
- Privacy First: No cameras or microphones. It only "sees" signal waves.
- Edge Analytics: Data is processed locally on the ESP32 using efficient mathematical algorithms.
- Cost-Effective: Runs on standard hardware (~$10 ESP32-S3/C6).
- Through-Wall Detection: Unlike PIR sensors, Wi-Fi signals can detect motion through obstacles.
- Real-time Detection: Immediate response to movement within the Wi-Fi field.
- Auto-Calibration: Uses the NBVI (Normalized Baseline Variability Index) algorithm to automatically select the best Wi-Fi subcarriers for the specific room environment.
- Home Assistant Native: Seamless integration via ESPHome API.
- Adjustable Sensitivity: User-configurable thresholds to filter out noise vs. actual human motion.
This project moves away from heavy Machine Learning training models, opting instead for a pure signal processing approach for efficiency on low-power devices.
- CSI Data Extraction: Captures the raw Channel State Information from the Wi-Fi packets.
- NBVI Algorithm: Automatically selects the most sensitive subcarriers while ignoring noisy ones.
- MVS (Moving Variance Segmentation): Calculates the variance of the signal amplitude over a sliding window to distinguish between
IDLEstates andMOTIONstates. - Hampel Filter: Removes outliers caused by signal packet loss or sudden RF interference.
To replicate E-fiSpectre, you need:
| Component | Recommendation | Notes |
|---|---|---|
| Microcontroller | ESP32-S3 or ESP32-C6 | S3 is recommended for better AI/DSP instruction sets. |
| Wi-Fi Router | Any 2.4GHz Router | Standard home router works; no special config needed. |
| Power Supply | 5V USB-C | Standard phone charger or power bank. |
| Host System | Raspberry Pi / PC | To run Home Assistant (optional but recommended). |
The data pipeline runs entirely on the "Edge" (the ESP32 device):
graph TD
A[Raw CSI Data] --> B[Gain Lock AGC]
B --> C[Auto-Calibration NBVI]
C --> D[Normalization]
D --> E[Hampel Filter]
E --> F[MVS Algorithm]
F --> G{Motion Detected?}
G -->|Yes| H[Trigger Home Assistant Binary Sensor]
G -->|No| I[Standby]
For best results, place the ESP32 sensor 3 to 8 meters away from the Wi-Fi router, elevated at table height (approx 1-1.5m).
- Clone the Repository:
git clone https://github.com/revanthvijaychandra-creator/E-fiSpectre
- Configure YAML:
Update the
secrets.yamlwith your Wi-Fi credentials and API keys. - Flash the Device: Use ESPHome to compile and upload the firmware to your ESP32.
esphome run espectre.yaml
- Integration: The device will be auto-discovered by Home Assistant. Add it to your dashboard to see real-time motion data.
This project lays the foundation for advanced wireless sensing. Future updates aim to include:
- Gestures Recognition: Detecting hand swipes to control smart devices.
- Fall Detection: Identifying sudden drops in signal patterns for elderly care.
- People Counting: Estimating the number of occupants based on signal density.
- Cloud Analytics: Offloading historical data for long-term pattern analysis.
This project is licensed under the GNU General Public License v3.0 (GPLv3). You are free to use, modify, and distribute this software in compliance with the license.
Vijay Chandra B.Tech Student | IoT & Data Analytics
*Based on the open-source research and concepts of Wi-Fi Sensing.