Heart Coherence Monitor

Measure heart rate variability and coherence using a piezoelectric film sensor. Real-time HRV analysis with spectral coherence scoring.

Gain1.0x

Discover ESP32-C3 Device

• First-time setup: connect phone/laptop to the ESP32 WiFi (HEART_ORIGIN_SETUP), then open http://192.168.4.1

• After it joins your home WiFi: switch back to your normal WiFi and scan your subnet here (e.g. 192.168.1.x)

• Discovery works by fetching http://<ip>/api/info (HTTP port 80); click a device to set ws://<ip>:8080

No devices found yet

Click Scan Network to search

ESP32-C3 Firmware Setup

Hardware Wiring (GPIO2):

Piezo (+) → 22kΩ → GPIO2 (ADC1_CH2) 4.7MΩ from GPIO2 → GND Piezo (−) → GND

ESP32-C3 Setup Instructions:

  • Install Arduino libraries: WiFi, WebServer, WebSockets (by Markus Sattler), ArduinoJson
  • Create sketch with HTTP server on port 80 serving /api/info endpoint
  • WebSocket server on port 8080 streaming JSON at ~5Hz
  • GPIO2 configured as ADC input (12-bit, 0-3.3V range)
  • Device creates AP HEART_PENDANT_SETUP if no WiFi configured
  • Join that WiFi and open http://192.168.4.1 to set SSID/password
  • Use device discovery to find it on your network
  • JSON format: t, raw, filtered, cardiac, respiratory, bpm, rrInterval, coherence, signalQuality, sdnn, rmssd, pnn50, lfPower, hfPower, coherenceBandPower

Quick Start:

Full Arduino sketch available in project documentation. The ESP32 will broadcast mDNS as heartbeat.local and serve device info at /api/info for discovery. WebSocket streams real-time HeartMath metrics including multi-band filtered signals (cardiac 0.8-3Hz, respiratory 0.15-0.4Hz), HRV analysis (SDNN, RMSSD), and coherence scoring (0.04-0.26Hz band power).

About Heart Coherence

Heart coherence is a state where your heart rhythm becomes highly ordered and stable. This system measures real-time heart rate variability (HRV) from a piezoelectric sensor and computes coherence scores based on spectral analysis.

  • Cardiac Waveform: Real-time piezo signal showing heartbeat pulses
  • R-R Intervals: Beat-to-beat timing variability visualization
  • HRV Metrics: SDNN, RMSSD, pNN50, LF/HF ratio
  • Coherence Score: 0-100% based on spectral power distribution

Sensor Setup: Attach piezoelectric film sensor to chest or wrist. Connect to Arduino/ESP32 running the provided sketch at 115200 baud.