ESPEctre: Through-Wall Human Presence and Respiration Detection Using ESP32 Wi-Fi CSI

In smart home automation, accurate human presence detection has evolved from passive infrared (PIR) sensors to 24 GHz mmWave micro-radars. While effective, mmWave sensors require dedicated line-of-sight hardware in every single room. What if the ambient Wi-Fi signals already saturating your living space could detect human presence, motion, and even micro-respiration through walls without any auxiliary sensor?

The open-source ESPEctre project makes this a reality by harvesting Wi-Fi Channel State Information (CSI) directly from ordinary $3 Espressif ESP32 microcontrollers. In this technical breakdown, we examine the physics of RF multipath distortion, Doppler phase shifts, and how to deploy sensorless through-wall sensing.

RSSI vs. CSI: Why Traditional Wi-Fi Tracking Fails

Early smart home experiments attempted to track human presence using Received Signal Strength Indicator (RSSI). RSSI is a single, scalar, heavily averaged value representing total signal power. It fluctuates wildly due to multi-path interference, antenna orientation, and environmental noise, making it useless for stationary presence detection.

In contrast, Channel State Information (CSI) reveals the fine-grained physical layer (PHY) channel properties of Orthogonal Frequency Division Multiplexing (OFDM). In an 802.11n Wi-Fi transmission, data is divided across 52 or 64 discrete subcarrier frequencies:

H(f) = |H(f)| × e^(j × ∠H(f))

CSI provides a matrix of amplitude attenuation and phase shift for every individual subcarrier. When a person walks into a room or breathes while sitting on a couch, their physical body alters the constructive and destructive interference patterns across specific subcarriers, creating a distinctive dynamic Doppler signature.

The ESPEctre Algorithm: Normalized Variance and Doppler Extraction

ESPEctre extracts CSI frames from 802.11 ping/beacon packets at up to 100 Hz. The algorithm operates through three mathematical stages:

  • Subcarrier Phase Sanitization: Hardware carrier frequency offsets (CFO) and sampling time offsets (STO) introduce linear phase drift across subcarriers. ESPEctre applies linear transformation to remove phase tilt.
  • Normalized Body Variance Index (NBVI): High-frequency noise is removed with a bandpass filter (0.1 Hz to 5.0 Hz). Moving humans induce variance across multiple subcarriers simultaneously, yielding a clear motion metric.
  • Respiration Doppler Windowing: For stationary presence, the algorithm focuses on the 0.15 Hz to 0.4 Hz band (9 to 24 breaths per minute). Chest expansion shifts subcarrier phase by a few degrees, generating a clean sinusoidal waveform that confirms living human presence even when completely motionless!

Hardware Placement Architecture

For through-wall detection, position the ESP32 transmitter (or your home router) on one side of a drywall or brick partition and the receiving ESP32 node on the opposite side. Because 2.4 GHz RF signals penetrate non-metallic building materials with minimal attenuation, the Fresnel zone between the two antennas monitors the entire enclosed volume.


Sources and References

Scroll to Top