A FreeRTOS-powered through-wall life detection radar with real-time vital sign extraction and a tactical LAN dashboard.
- Overview
- Key Applications
- System Architecture
- Hardware Architecture
- FreeRTOS Task Architecture
- Signal Processing Pipeline
- Dynamic Auto-Calibration
- Tactical LAN Dashboard
- Communication Protocol
- Repository Structure
- Getting Started
- Development Tools
- License
Project H.A.W.K. is an RTOS-based embedded system engineered for non-line-of-sight (NLOS) human detection using microwave Doppler radar. The system penetrates solid obstacles — drywall, rubble, wood, and smoke — to detect physiological micro-movements: breathing (0.2–0.6 Hz) and heartbeat (1.0–2.5 Hz).
Built on an ESP32 dual-core processor running FreeRTOS, the architecture guarantees deterministic timing and real-time preemptive multitasking across four concurrent tasks. A 1024-point FFT pipeline with parabolic interpolation provides sub-bin frequency accuracy for vital sign extraction. A 15-second auto-calibration sequence dynamically learns the environmental noise floor on every boot, and all telemetry is streamed over WebSocket to a tactical browser-based dashboard accessible from any device on the local network.
| Domain | Use Case |
|---|---|
| Tactical & Defense | Urban warfare situational awareness — detect human presence behind walls before room entry, hostage rescue, and tactical reconnaissance. |
| Search & Rescue | Locate survivors trapped under earthquake debris or collapsed structures by detecting faint vital signs through rubble. |
| Advanced Security | Covert perimeter monitoring and intrusion detection in zero-visibility environments (smoke, darkness, fog). |
| Medical Monitoring | Non-contact vital sign monitoring in isolation wards or hazardous environments. |
+-----------------------------------------------------------------------------+
| PROJECT H.A.W.K. -- SYSTEM OVERVIEW |
+-----------------------------------------------------------------------------+
| |
| +--------------+ +--------------+ +----------------------------+ |
| | HB100/CDM324 | | Active BPF | | ESP32 (Dual-Core) | |
| | Doppler |--->| 0.1-3.0 Hz |--->| FreeRTOS Kernel | |
| | Radar | IF | Op-Amp | ADC| | |
| | 10.525 GHz | | Circuit | | +------------------------+ | |
| +--------------+ +--------------+ | | T1: Radar Sampling | | |
| | | 250 Hz (P4) | | |
| | +------------------------+ | |
| | | T2: 1024-pt FFT | | |
| +--------------------------------------+| | Pipeline (P3) | | |
| | TACTICAL LAN DASHBOARD || +------------------------+ | |
| | +--------+ +--------+ +------------+ || | T3: Detection & | | |
| | | Vital | | Confid.| | Event | |<-| Calibration (P2) | | |
| | | Charts | | Gauge | | Log | || +------------------------+ | |
| | +--------+ +--------+ +------------+ || | T4: WebSocket & | | |
| | WebSocket on ws://<ESP32_IP>:81 || | Alarms (P1) | | |
| +--------------------------------------+| +------------------------+ | |
| +----------------------------+ |
+-----------------------------------------------------------------------------+
| Component | Specification | Purpose |
|---|---|---|
| Microcontroller | ESP32 DevKit (32-bit, Dual-Core Xtensa LX6, 240 MHz) | FreeRTOS host, ADC sampling, WiFi/WebSocket server |
| Radar Sensor | HB100 (10.525 GHz) / CDM324 (24 GHz) Microwave Doppler | Emits CW microwave; IF output encodes target micro-motion |
| Signal Conditioning | Custom 2-stage Active Bandpass Filter (Op-Amp) | Passband: 0.1–3.0 Hz — isolates human vitals, rejects mechanical noise |
| ADC Interface | ESP32 12-bit SAR ADC (GPIO 34) | 0–4095 counts at 250 Hz deterministic sampling |
| Alert Output | Active Buzzer (GPIO 25) + LED Indicator (GPIO 2) | 1.5-second local hardware alarm on confirmed detection |
| Dashboard | Any browser on the LAN | Real-time tactical display via WebSocket (ws://<IP>:81) |
| Signal | GPIO | Direction |
|---|---|---|
| Radar ADC (Bandpass Filter Output) | 34 |
Input (Analog) |
| Active Buzzer | 25 |
Output (Digital) |
| Status LED | 2 |
Output (Digital) |
The system employs a preemptive priority-based RTOS scheduler with four concurrent tasks communicating through FreeRTOS Queues and Semaphores. The Arduino loop() is immediately deleted to free CPU cycles for the RTOS kernel.
| # | Task | Priority | Stack | Function | IPC Mechanism |
|---|---|---|---|---|---|
| T1 | Radar Acquisition | 4 (Highest) | 2 KB | 250 Hz deterministic ADC sampling via vTaskDelayUntil() |
Produces → rawDataQueue (2048 × uint16_t) |
| T2 | Signal Processing | 3 | 8 KB | 1024-point FFT (DC removal → Hamming window → FFT → Magnitude → Sub-band peak detection) | Consumes rawDataQueue → Produces → processedDataQueue (8 × VitalSignData) |
| T3 | Detection & Calibration | 2 | 4 KB | Auto-calibration (15 s) + confidence ramp-up/decay algorithm | Consumes processedDataQueue → Produces → dashboardQueue + detectionSemaphore |
| T4 | Communications & UI | 1 (Lowest) | 8 KB | WebSocket broadcast at ~20 Hz loop, buzzer/LED alarm with 1.5s auto-reset | Consumes dashboardQueue / detectionSemaphore |
rawDataQueue processedDataQueue dashboardQueue
(2048 slots) (8 slots) (4 slots)
| | |
T1 --->|--> T2 ----------------->|--> T3 ------------------>|--> T4 --> WebSocket
(250 Hz) (1024-pt FFT) (Calibration + (Broadcast +
Confidence) Buzzer/LED)
|
v
detectionSemaphore
(Binary)
Each FFT cycle processes 1024 samples collected over ~4.1 seconds at 250 Hz, yielding a frequency resolution of 0.2441 Hz/bin.
- DC Removal — Strips the ADC bias offset to center the waveform at zero.
- Hamming Windowing — Reduces spectral leakage at bin boundaries.
- 1024-Point FFT — Full complex FFT using
float(notdouble) to leverage the ESP32's hardware single-precision FPU (~30 ms vs ~300 ms on double). - Magnitude Extraction —
complexToMagnitude()converts complex bins to real magnitudes. - Dual Sub-Band Peak Detection — Independent peak search with parabolic interpolation for sub-bin frequency accuracy:
| Vital Sign | Frequency Band | FFT Bin Range | Resolution |
|---|---|---|---|
| Breathing | 0.20 – 0.60 Hz | Bins 1–2 | ±0.12 Hz |
| Heartbeat | 1.00 – 2.50 Hz | Bins 4–10 | ±0.12 Hz |
floatoverdouble: The ESP32's FPU is single-precision only. Usingdoubleforces software emulation at ~10x the compute cost — unacceptable for a real-time system.staticarrays: The 8 KB FFT buffers (vReal[1024],vImag[1024]) are declaredstaticto place them in BSS rather than on the task stack, preventing stack overflow.- DC-safe bin clamping: Bin 0 (DC component) is always excluded from peak search, and parabolic interpolation results are clamped to the safe band range to prevent negative-frequency artifacts.
Instead of a hardcoded noise threshold, the system performs a 15-second environmental calibration on every boot.
BOOT --> STATE_CALIBRATING (15s) --> STATE_ACTIVE
| |
| Track peak FFT magnitude | Use dynamic threshold:
| across both vital bands | activeThreshold =
| (no detection logic runs) | peakNoise x 1.5
| |
| Telemetry still streams | Confidence algorithm
| to dashboard (state flag) | fully operational
| |
v v
Dashboard shows Dashboard shows
amber CALIBRATION full tactical view
overlay with with live charts
progress bar
| Parameter | Value | Purpose |
|---|---|---|
CALIBRATION_DURATION_MS |
15000 ms | Window for noise floor measurement |
SAFETY_MARGIN |
1.5x | Multiplier applied to peak noise magnitude |
FALLBACK_THRESHOLD |
50.0 | Used if calibration sees zero signal (dead ADC) |
REQUIRED_CONFIDENCE |
5 | Consecutive positive readings needed for alert |
The calibration phase uses xTaskGetTickCount() comparisons — no delay() calls — so the Detection Task continues consuming the processedDataQueue and feeding telemetry to the dashboard throughout the entire calibration window.
A military-themed, browser-based monitoring console that connects to the ESP32 via WebSocket on port 81. No server, no cloud — just open index.html from any device on the same LAN.
| Feature | Description |
|---|---|
| Connection Overlay | Full-screen animated radar sweep with live reconnect countdown |
| Calibration Overlay | Amber warning overlay with progress bar and countdown timer during the 15s noise floor analysis |
| Threat Assessment | Real-time status panel — transitions from green MONITORING to red-alert HUMAN DETECTED with flashing vignette |
| Confidence Gauge | 5-bar visual gauge (green to amber to red) with labels: NO SIGNAL, WEAK, TRACKING, ACQUIRING, LOCKED, CONFIRMED |
| Vital Sign Charts | Dual Chart.js line graphs — Breathing (0.2-0.6 Hz, cyan) and Heartbeat (1.0-2.5 Hz, magenta) — scrolling 30-point window |
| System Metrics | Total alerts, current breathing Hz, current heartbeat Hz, last alert timestamp |
| Event Log | Scrolling console with timestamped telemetry, system events, and alerts (max 150 entries) |
| Audio Alert | Web Audio API tactical 3-tone square-wave alarm on human detection |
| Auto-Reconnect | Automatic WebSocket recovery with visual countdown on connection loss |
| Layer | Technology |
|---|---|
| Structure | Semantic HTML5 |
| Styling | Vanilla CSS — glassmorphism, CSS custom properties, CRT scan-line overlay |
| Typography | Orbitron (display) + JetBrains Mono (data) via Google Fonts |
| Charts | Chart.js 4.4.7 (CDN) |
| Data Transport | Native WebSocket API, ws://<ESP32_IP>:81 |
All telemetry is transmitted exclusively over WebSocket (Serial output is disabled in production firmware to eliminate UART jitter in the time-critical 250 Hz sampling loop).
| Message Type | Format | Direction |
|---|---|---|
| Handshake | $HAWK,STATUS,CONNECTED |
ESP32 to Dashboard |
| Telemetry | $HAWK,DATA,<breathFreq>,<heartFreq>,<breathMag>,<heartMag>,<confidence>,<maxConf>,<timestamp>,<state> |
ESP32 to Dashboard |
| Alert | $HAWK,ALERT,HUMAN_DETECTED,TIME:<ms_timestamp> |
ESP32 to Dashboard |
| Field | Type | Description |
|---|---|---|
breathFreq |
float |
Dominant frequency in breathing band (Hz) |
heartFreq |
float |
Dominant frequency in heartbeat band (Hz) |
breathMag |
float |
FFT magnitude of breathing peak (signal strength) |
heartMag |
float |
FFT magnitude of heartbeat peak (signal strength) |
confidence |
int |
Current detection confidence (0 to maxConf) |
maxConf |
int |
Required confidence threshold for alert trigger |
timestamp |
ulong |
ESP32 millis() uptime |
state |
string |
CALIBRATING or ACTIVE |
H.A.W.K/
|
+-- ESP32/ # Embedded firmware (Arduino/FreeRTOS)
| +-- ESP32.ino # Entry point -- Queue/Semaphore creation, WiFi init, task launch
| +-- globals.h # Pin definitions, SystemState enum, VitalSignData struct, RTOS handles
| +-- radar_sensor.cpp / .h # T1: 250 Hz deterministic ADC sampling task
| +-- signal_processing.cpp / .h # T2: 1024-pt FFT pipeline with dual sub-band peak detection
| +-- detection.cpp / .h # T3: Auto-calibration + confidence algorithm + alert logic
| +-- comms_ui.cpp / .h # T4: WiFi/WebSocket server, $HAWK protocol, buzzer/LED alarms
|
+-- Dashboard/ # Browser-based tactical monitoring console
| +-- index.html # Semantic HTML5 structure with all overlay layers
| +-- styles.css # Full design system -- dark theme, glassmorphism, animations
| +-- app.js # WebSocket client, Chart.js graphs, calibration/alert UI logic
|
+-- LTspice/ # Analog circuit simulation files
| +-- HB100-ESP32.asc # LTspice schematic -- active bandpass filter design
| +-- HB100-ESP32.raw / .log # Simulation output data
|
+-- Oscilloscope/ # Hardware debug utility
| +-- Oscilloscope.ino # ESP32 Serial Plotter sketch -- verify ADC signal & DC bias
|
+-- Abstract.txt # Project abstract
+-- LICENSE # MIT License
+-- README.md # This file
Hardware
| Component | Quantity | Notes |
|---|---|---|
| ESP32 Development Board | 1 | Any variant with ADC-capable GPIO 34 |
| HB100 or CDM324 Radar Module | 1 | 10.525 GHz or 24 GHz Doppler |
| Op-Amp (e.g., LM358 / MCP6002) | 1–2 | For active bandpass filter stages |
| Resistors & Capacitors | As per filter design | See LTspice schematic for values |
| Active Buzzer | 1 | 3.3V compatible |
| LED | 1 | With appropriate current-limiting resistor |
Software
| Tool | Version |
|---|---|
| Arduino IDE | 2.x+ (or PlatformIO) |
| ESP32 Board Package | Latest via Board Manager |
arduinoFFT library |
v2.0.0+ by Kosme |
WebSockets library |
By Markus Sattler (Links2004) |
git clone https://github.com/chandansaipavanpadala/H.A.W.K-HumanActivityDetectionThroughWallsUsingMicrowaveKinetics.git
cd H.A.W.K-HumanActivityDetectionThroughWallsUsingMicrowaveKinetics| Signal | Connect To | ESP32 GPIO |
|---|---|---|
| Bandpass Filter Output | RADAR_ADC_PIN |
34 |
| Active Buzzer (+) | BUZZER_PIN |
25 |
| Status LED (Anode) | LED_PIN |
2 |
Tip: Use the
LTspice/HB100-ESP32.ascschematic as a reference for the analog filter circuit design.
Open ESP32/comms_ui.h and update:
#define WIFI_SSID "YourNetworkName"
#define WIFI_PASSWORD "YourPassword"- Open
ESP32/ESP32.inoin Arduino IDE. - Select your ESP32 board model and COM port.
- Install required libraries (
arduinoFFT,WebSockets) via Library Manager. - Compile and upload the firmware.
- After flashing, note the ESP32's IP address from your router's DHCP table.
- Open
Dashboard/app.jsand update the WebSocket URL:const WEBSOCKET_URL = 'ws://<YOUR_ESP32_IP>:81';
- Open
Dashboard/index.htmlin any modern browser on the same LAN.
- On boot, the dashboard will show a cyan radar-sweep loading overlay while connecting.
- Once connected, the amber calibration overlay appears for 15 seconds — stand clear of the sensor.
- After calibration, the full tactical dashboard activates with live charts.
- Introduce a target subject in front of the radar — monitor the confidence gauge ramp from
NO SIGNALtoCONFIRMED. - Upon confirmed detection: RED ALERT flashes, buzzer sounds, and the
$HAWK,ALERTpacket is broadcast.
The Oscilloscope/Oscilloscope.ino sketch streams raw ADC values at 250 Hz to the Arduino Serial Plotter for hardware debugging:
- Verify the 1.65V DC bias from the op-amp circuit
- Confirm the ADC signal is centered and not clipping
- Validate the radar module is producing a clean IF signal
Tools -> Serial Plotter -> 115200 baud
The LTspice/ directory contains the complete active bandpass filter schematic (HB100-ESP32.asc). Use LTspice to simulate and verify the filter response before building the physical circuit.
This project is licensed under the MIT License — see the LICENSE file for details.
Copyright 2026 Chandan Sai Pavan Padala
Built for the Real-Time Operating Systems course — Amrita Vishwa Vidyapeetham
Project H.A.W.K. — Because every second counts when lives are behind walls.