BILAL.ASHRAF
Back to projects

HRV Biofeedback Platform

A stress measurement and guided relaxation platform built end to end across five components. A client books a session, enters the room, and a guided exercise video plays while a wrist-worn sensor tracks their stress level live. I architected and built all of it: the wearable firmware, the stress scoring, the in-room desktop runtime, the mobile app, the admin dashboard and the backend.

C / ESP-IDFESP32-C3DSPElectronReact NativeNext.jsNode.jsExpressRedis
HRV Biofeedback Platform

Key Features

ESP32-C3 wristband firmware driving a MAX30102 optical PPG sensor over I²C

Full signal chain: ambient subtraction, Butterworth band-pass, NLMS adaptive noise cancellation, FFT peak picking, signal-quality indexing and Kalman tracking

Validated against hand-counted ground truth at 89.7 BPM versus a true 90

RMSSD-based heart-rate-variability stress scoring driving real-time biofeedback

Electron kiosk runtime on an in-room mini PC, with Elgato Stream Deck as a physical control surface

React Native app for session booking, history and progress tracking

Next.js admin dashboard with role-based access control and Sentry monitoring

The Challenge

Reflective wrist PPG is a hostile signal. Measured on this band, perfusion ran 0.02–0.25% and the pulse was routinely weaker than the baseline wander it competes with. Every constant in the chain was set from captures on real wrists with the true rate confirmed by hand-counting, rather than from datasheet defaults — and where a value from a paper disagreed with the measurement, the measurement won. The result reads 89.7 BPM against a hand-counted 90 at rest and holds lock through typing. Vigorous motion still defeats it: the pulse genuinely disappears, and closing that gap needs an accelerometer for TROIKA-class cancellation rather than more filtering.