Edge AI Stress Sense
Voice-triggered, wireless stress measurement on ESP32 and ESP8266

Overview
Say “measure my stress level”. The ESP32 hears the command and tells the ESP8266 over WiFi to start. For 60 seconds both boards stream pulse, skin-conductance and motion data to a laptop, where a classifier trained on the WESAD dataset estimates your stress level. The result is spoken back and shown on a live dashboard.
94.7%stress vs. no stress (LOSO, 15 subjects)
88.3%WESAD paper, wrist sensors
r = 0.91heart rate vs. chest ECG
44HRV, EDA and motion features
How it works
- Trigger: on-device voice activity detection on the ESP32; speech is streamed over WebSocket, transcribed, and matched to commands tolerant of recognition mistakes.
- Coordination: the ESP32 relays START to the ESP8266 over UDP with ACK and retry, with a direct laptop fallback; boards find each other via heartbeats.
- Sensing: PPG and GSR at 64 Hz through a 16-bit ADS1115, motion at 32 Hz, matched to the WESAD wrist device. Every packet is indexed, so loss is measured and interpolated.
- Inference: the same feature module is used in training and live; output is P(stress), a 3-class state and a spoken reply.
Decisions backed by data
- Motion excluded from the deployed model. The accelerometer alone reached 87.5% because WESAD participants moved during the stress task; removing it costs nothing (94.7% vs 94.9%) and removes the shortcut.
- Personal baseline. A 3-minute relaxed calibration raises accuracy from 91.2% to 94.7%.
- Hardware-free testing. A simulator replays real WESAD recordings over the exact firmware protocol; HR through the simulated link at 2% loss matches the direct computation (102.8 vs 102.9 bpm).
Leave-one-subject-out results
| Task | Sensors | This work | WESAD paper |
|---|---|---|---|
| Stress vs. no stress | pulse + skin | 94.7% | 88.3%* |
| Stress vs. no stress | pulse only | 90.2% | 85.8% |
| Stress vs. no stress | skin only | 88.9% | 79.7% |
| Baseline / stress / amusement | pulse + skin | 74.8% | 76.2% |
* the paper's best wrist result also used skin temperature, which this hardware doesn't measure.

