ESPectre is an experimental motion detection system based on Wi-Fi spectrum analysis (CSI — Channel State Information). In simple terms, a small ESP32-S3-based device “listens” to how the Wi-Fi channel changes between the router and the sensor: when someone moves in a room, the radio channel’s parameters change, and the project is able to capture these changes — without cameras, microphones, or wearable sensors. [Project on GitHub]

The core idea of the project is not machine learning, but mathematical signal processing: the project extracts a set of 10 statistical, temporal, and spatial features from CSI data and uses them to determine the presence of motion in real time. This provides two important advantages: the system works “out of the box” without model training, and at the same time these features can serve as a foundation for future ML experiments (people counting, gesture recognition, etc.).

The hardware side is very simple and cheap: you need a 2.4 GHz router and an ESP32-S3 board with external antennas (a kit costs around 300–400 rubles on AliExpress). MQTT (or Home Assistant) is used for integration, and the firmware is built using ESP-IDF.
The project’s README describes quick setup, a calibration guide, and sensor placement tips in detail, so the system works more accurately in a specific room.

Practical Use Cases

  • Home security: get notified in case of unauthorized entry while you’re away.
  • Elderly care: monitor activity to detect falls or prolonged lack of movement.
  • Smart automation: automatically turn on lighting or heating when people’s presence is detected.
  • Energy saving: automatically turn off devices in empty rooms.
  • Child monitoring: get alerted if children leave their room at night.
  • Climate control: maintain a comfortable temperature only in occupied rooms.

Sensor Placement

Distance to RouterSignalMultipathRecommendation
< 2 mToo strongMinimal❌ Too few reflections
3–8 mOptimalGood✅ Best
> 10–15 mWeakVariable❌ Too far

Optimal multipath conditions (3–8 m) provide enough reflections for accurate motion detection.

Placement Recommendations

  • ✅ Place the sensor within the monitored area (it doesn’t need to be in a direct line with the router)
  • ✅ Height: 1–1.5 meters from the floor (desk height)
  • ✅ External antenna: use an IPEX connector to improve reception
  • ❌ Avoid metal obstacles between the router and sensor (refrigerators, metal cabinets)
  • ❌ Avoid corners or enclosed spaces (to reduce channel diversity)

[ESPectre diagram]

Each sensor is placed under a separate topic:

Motion Detection System Based
home/espectre/kitchen
home/espectre/bedroom
home/espectre/living

Home Assistant can perform the following functions:

  • monitor each room individually
  • create sensor groups to cover the entire house
  • implement zone-based automation
  • track movement patterns across rooms

Beginner FAQ

Q: Do I need programming knowledge to use this product?
A: Basic command-line skills are needed to build and flash the firmware using ESP-IDF. It’s recommended to follow the step-by-step guide provided in SETUP.md.

Q: Is this product compatible with my router?
A: Yes, as long as your router supports 2.4 GHz Wi-Fi, which is common on most modern routers.

Q: What are the hardware costs?
A: The total hardware cost is approximately 300–400 rubles for an ESP32-S3 board. The software is free and open source. You’ll also need a device to run an MQTT broker, such as Home Assistant or Mosquitto. This can be a Raspberry Pi costing about 35–50 euros, or any existing PC/NAS you already own, at no extra cost.

Q: Does the router need to be modified?
A: No, the router operates normally. The sensor “listens” to Wi-Fi signals without any modifications.

Q: Can the system distinguish between people and pets?
A: The system uses a two-state detection model: IDLE (inactive) and DETECTED (active). This model can identify general motion but doesn’t distinguish between people, pets, or other moving objects. More accurate classification (distinguishing people from pets, recognizing activity and gestures) would require trained AI or machine learning models (see the “Future Development” section).

Q: Does the system require high Wi-Fi bandwidth?
A: No, the system doesn’t require high Wi-Fi bandwidth. MQTT traffic is minimal. If smart publishing is disabled (the default), the system publishes every detection update. If smart publishing is enabled, the system only sends data on significant changes or every 5 seconds as a heartbeat pulse. This results in a data rate of about 0.2–0.5 kbit/s per sensor during idle periods and up to about 1 kbit/s during active movement. The impact on the network is negligible.

Q: Is the system compatible with mesh Wi-Fi networks?
A: Yes, the system works reliably. Just make sure the ESP32 is connected to the 2.4 GHz band.

Q: Is a dedicated server required?
A: No, Home Assistant can run on a Raspberry Pi, a NAS, or in the cloud. Alternatively, an MQTT broker (Mosquitto) can be used on any device.

Q: How accurate is the detection?
A: Detection accuracy depends on the environment and requires proper calibration. Performance is affected by room layout, wall materials, furniture placement, distance from the router (optimal: 3–8 meters), and the level of interference. Under optimal conditions with proper calibration, the system provides reliable motion detection. Use the built-in calibration tools (MQTT commands: analyze, threshold) to tune parameters for your environment.

Q: What’s the power consumption?
A: In normal operating mode, power consumption is approximately 500 mW. The firmware includes power optimization. Battery-powered devices can enter deep sleep mode, but this requires corresponding code modifications.

If you run into any issues, you can open an Issue on GitHub.


Below is a detailed breakdown of how ESPectre works under the hood, based on the project’s documentation. This will help readers better understand exactly what’s happening “under the hood,” and how human motion is captured via the Wi-Fi channel.

1. Capturing Channel State Information (CSI)

The Espressif ESP32-S3-based device uses a native API to capture CSI — i.e., the radio channel parameters between the router and the receiver.

CSI includes more complex data than plain RSSI:

  • the amplitude and phase of each OFDM subcarrier — a typical 2.4 GHz Wi-Fi signal can have up to ~64 subcarriers
  • the channel’s frequency response: how the signal travels through the environment, accounting for reflections, multipath, and changes over time

When a person moves, reflections, signal directions, and multipath trajectories change — which shows up as variations in the CSI signal: for example, phase shifts occur, amplitude changes, and temporal fluctuations increase.

2. Signal Processing and Feature Extraction

After CSI is captured, the data goes through several processing stages before a motion decision is made:

Filtering and preprocessing: removing noise and outliers, smoothing. ESPectre uses the following stages:

  • A Butterworth low-pass filter — removes high-frequency noise (>8 Hz)
  • Wavelet transform (e.g., Daubechies “db4”) — removes stable low-frequency noise
  • A Hampel filter (Median Absolute Deviation) — removes outliers
  • Savitzky-Golay smoothing
  • Adaptive normalization (Welford’s algorithm) with automatic statistics reset, to prevent the signal from “drifting”

Feature extraction: ten key features are computed from the cleaned CSI signal, divided into three groups: statistical, spatial (frequency-domain), and temporal.

Statistical (5 features):

  1. Variance — a measure of signal spread, increases during motion
  2. Skewness (distribution asymmetry) — helps detect “unusual” movements
  3. Kurtosis — the “tailedness” of the distribution, reveals abrupt changes
  4. Entropy — a measure of randomness or disorder in the signal; increases when the environment changes
  5. IQR (interquartile range) — a spread measure robust to outliers

Spatial (3 features):

  1. Spatial Variance — the spread of signals across subcarriers (frequency domain)
  2. Spatial Correlation — correlation between neighboring subcarriers: it drops during motion
  3. Spatial Gradient — the rate of signal change between subcarriers, high during changes

Temporal (2 features):

  1. Temporal Delta Mean — the average absolute change compared to the previous CSI packet
  2. Temporal Delta Variance — the variance of changes between consecutive packets

Scoring and decision-making:

From these 10 features, the system automatically selects the 4–6 most discriminative ones (for the current environment) and computes a weighted motion score based on them. The weighting coefficients are optimized using Fisher’s criterion.

A state machine is then used: IDLE (no motion) and DETECTED (motion detected). There’s debounce protection (e.g., requiring N consecutive triggers) and hysteresis, to prevent state “flickering.”

3. Integration and Data Publishing

After the calculations, the device performs the following actions:

Publishing via MQTT: the device sends a JSON message (with the motion state and supporting attributes) to the MQTT broker. By default, messages are sent every second, but “smart” publishing is also possible: only on change, or with a periodic “heartbeat.”

Home Assistant integration: MQTT topics can be automatically imported into Home Assistant as sensors. From there, you can build automations: turning on lights, sending notifications, analyzing behavior by room, and so on.

Scalable architecture: several ESP32-S3 sensors in different rooms can publish to MQTT, with Home Assistant aggregating them and building scenarios for the whole house.

4. Why This Works (and Where the Limitations Are)

Why it works:

  • A person’s movement changes the geometry of the multipath channel: reflections appear and disappear, the signal travels via different paths, and phase shifts and amplitude changes occur. CSI captures these changes far more precisely than plain RSSI.
  • Wi-Fi signals pass through walls and furniture, so even presence outside the direct line of sight can be detected.

Limitations:

  • Only works on the 2.4 GHz band — a hardware limitation of the ESP32-S3.
  • Sensitivity depends on distance: optimal is about 3–8 meters between the router and sensor. At <2 m the signal is too “rigid,” and at >10–15 m the signal is weak and noise is higher.
  • Metal objects, thick walls, and heavy Wi-Fi congestion degrade performance.
  • Currently the system only provides a binary answer: motion / no motion. Distinguishing between people, animals, and types of activity would require ML models.

The IEEE 802.11bf Wi-Fi Standard

Why a Standard Is Needed

Currently, technologies like ESPectre rely on “hacky” extraction of CSI (Channel State Information) from Wi-Fi chipsets that weren’t originally designed for this. As the project notes, only a limited number of Wi-Fi chipsets support CSI extraction, which restricts hardware choices.

The introduction of the IEEE 802.11bf standard means that CSI extraction and the use of Wi-Fi for “sensing” will become a built-in feature rather than an exception. This opens up a much broader market of devices and simplifies adoption.

What Exactly the Standard Provides

  • Native sensing: support for motion, gesture, and presence recognition, and even vital signs (breathing, heartbeat)
  • Interoperability: different manufacturers will support Wi-Fi Sensing features uniformly — less fragmentation
  • Optimizations: reduced overhead, minimal power consumption — important for IoT and smart homes
  • Privacy by design: built-in privacy protection mechanisms — critically important from a social standpoint
  • Greater precision: improved temporal and spatial resolution — the sensor will become more accurate
  • Existing infrastructure: standard routers and access points can be used — without a radical hardware overhaul

Current State (2025)

The project notes that there are currently no mass-market consumer routers with full 802.11bf support.
On the hardware side, advanced chips, many antennas, Wi-Fi 6/6E/7 support, and possibly additional (AI) computation are required. Expected rollout stages:

  • 2025–26: enterprise and premium smart-home devices
  • 2027–28: flagship consumer devices
  • 2029+: mass adoption

What This Means for Projects Like ESPectre

For now, as an implementation: you have to manually use the hardware, extract CSI, and write firmware and algorithms yourself. Once the standard is adopted:

  • Projects won’t need “special” hardware or a “leaky” way to access CSI — the functionality will be built in.
  • Reliability will be higher: the standard defines how sensor data is extracted and processed, reducing ad-hoc implementations.
  • Power consumption and integration will improve, thanks to optimizations at the specification level.
  • Development will expand beyond just “motion”/”presence” to breathing, gestures, and people counting — thanks to greater precision.

Sources files

🔒

This content is available to logged-in users only.

هذا المحتوى متاح فقط للمستخدمين المسجلين.

Ce contenu est réservé aux membres connectés.

🔑 Login 📝 Register

Log in or create a free account to access downloads and exclusive content.

error: Content is protected !!
Scroll to Top