Skip to the content
4 layers37.5 × 29.5 mmHM Collector Rev2, the printed circuit board in 3D

Chest-worn STM32U5 sensor that records ECG and SCG, and computes HRV on-device. Bare metal C.

Size
37.5 × 29.5 mm
Copper layers
4
Thickness
1.6 mm
Parts
91
Nets
88
Pads
312
Tracks, vias
726, 116
Pours
8
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
3 Dec 2025
Updated
28 Oct 2026

Overview

HM Collector Rev2 is an open-source printed circuit board by konstantinosfragkoulis, from the konstantinosfragkoulis/HealthMonitor repository on GitHub, published under the MIT licence. It is a 4-layer board of 37.5 × 29.5 mm with 91 parts on 88 nets, routed with 726 tracks and 116 vias.

It is built around the AD8232ACPZ-R7, W25Q128JVSIQ and TPS7A2033PDBVR-TP, with the SJ2-35813B-SMT-TR among its other parts. Its parts include 35 capacitors, 32 resistors, 7 diodes, 6 ICs and 4 connectors. It belongs with the sensors and measurement boards and the STM32 boards of this library.

Main components

4

README

README.md

HealthMonitor

Chest worn sensor with bare metal C firmware that records electrocardiogram (ECG) and seismocardiogram (SCG), and computes heart rate variability (HRV) on-device.

SCG-derived RMSSD agrees with ECG with a bias of +0.9 ms and 95% limits of [+0.0, +1.8] ms (60 one-minute windows, single subject, at rest).

Health Monitor Rev2 PCB

[!WARNING] Not a medical device. For research and education only. While electrodes are attached, power the device from battery (e.g. an unplugged laptop) or connect through a USB isolator. Never connect to a mains-powered PC without isolation.

Core Stack: STM32U5 (Cortex-M33) | ST1VAFE6AX (6-axis IMU) | AD8232 (ECG AFE)

Architecture & DSP

The IMU's data-ready interrupt triggers DMA transfers for both the IMU (SPI) and the ECG (ADC), so both data streams share the same sampling rate (480 Hz nominal, measured at ~471 Hz). Every sample is timestamped by a timer clocked from the board's crystal. Beat times and all HRV metrics use these timestamps, not the nominal rate. R peaks are refined between samples; AO times are at sample resolution (~2.1 ms). The 1.9% rate error shifts filter corners and window lengths slightly, which does not affect beat detection.

Three independent DSP pipelines run on-device:

  • ECG (Pan-Tompkins++): Bandpass -> derivative -> squaring -> flattop smoothing -> MWI. Uses adaptive thresholds and search-back [1]. Each beat is timed at the R apex on the raw ECG.
  • SCG (Template Matching NCC): Accelerometer Z axis (dorsoventral) filtered at 7-30 Hz. Bootstraps a heartbeat template during the first 10 s via a 4th power envelope and pairwise NCC [2]. Runs a sliding NCC against the template to continuously locate aortic openings (AO). The template is refreshed every 60 s and it's aligned so the AO stays on the same wave. It's replaced if it stops matching beats.
  • Respiratory Rate: Accelerometer Z axis LPF -> decimated 48:1 (to 10 Hz) -> bandpass 0.1-0.6 Hz. Fed into a 30 s autocorrelation window, outputting a new respiratory rate every 5 s. Does not work reliably yet.

HRV metrics (RMSSD, SDNN, pNN50, SD1, SD2) are computed separately for each stream from its own beat intervals, after removing intervals more than 25% from the local median (missed, extra, or premature beats) [3,4]. The ECG defines the reporting windows: contiguous, non-overlapping, at least 60 s long, and bounded by R peaks. Each SCG report covers the same window, using the SCG's own AO-AO intervals between the window's start and end R peaks. The SCG detector itself does not use the ECG.

Data is streamed to a host via a USB Virtual COM Port with CRC-32 integrity.

Project Structure

  • /hardware/HM-Rev1: First spin. See ERRATA.md (known routing/schematic flaw with the AD8232).
  • /hardware/HM-Rev2: Fixed AD8232 layout, added USB-C, placed components on the bottom layer.
  • /fw: STM32CubeIDE project, bare-metal C source, DSP logic, and TinyUSB stack.
  • /software: Python telemetry parser and plotter.

Roadmap

  • Hardware validation.
  • Synchronized IMU + ECG DMA capture.
  • ECG R-peak detection (Pan-Tompkins++).
  • SCG heartbeat detection (Template Matching NCC).
  • On-device HRV metrics calculation.
  • USB CDC telemetry via TinyUSB.
  • SCG vs ECG HRV validation.
  • Improve SCG RMSSD agreement.
  • 5 minute SDNN and pNN50 on device.
  • Reliable respiratory rate calculation.
  • Multi-axis respiratory fusion (PCA + gyro).

SCG vs ECG HRV Validation

To validate the SCG pipeline, both streams are recorded simultaneously and the HRV metrics of each window are compared using Bland-Altman analysis [5] and ICC(2,1).

All table values come from the firmware's own HRV outputs. analyze.py reads them from hrv.csv and computes only the agreement statistics.

Results from a ~1 hour session lying down (single subject, n=60 paired 60 s windows):

MetricECG (mean ± SD)Bias (SCG - ECG)95% LOAICC(2,1)
RMSSD32.7 ± 7.8 ms+0.9 ms[+0.0, +1.8]0.991
SDNN39.4 ± 12.1 ms+0.4 ms[+0.1, +0.8]0.999
SD123.1 ± 5.5 ms+0.6 ms[+0.0, +1.3]0.991
SD250.5 ± 16.9 ms+0.4 ms[+0.0, +0.7]>0.999
pNN5012.2 ± 9.2 %+1.5 %[-3.1, +6.1]0.959

The first 40 s (electrode settling) are not analyzed.

The R-to-AO delay (63.4 ± 1.9 ms) is longer after longer R-R intervals (r = 0.46). This stretches AO-AO intervals slightly and accounts for about 90% of the RMSSD bias. Random beat-to-beat timing jitter (≈1 ms) would add only ~0.1 ms to RMSSD. The delay is a proxy for the pre-ejection period (PEP). PEP likely drives this coupling, but this recording cannot confirm it, nor can it accurately measure it. pNN50 is coarse over 60 s (one interval is ~1.5 percentage points).

Over 3954 heartbeats, the ECG detected every beat (reviewed manually) and the SCG missed 3, with no false detections in either. Missed beats are removed by the interval check before HRV is computed, and their windows are kept in the table.

Beat-to-beat, AO-AO intervals agree with their R-R intervals with a bias of 0.0 ms and 95% limits of agreement of [-2.8, +2.8] ms (3947 intervals). The bias is near zero by construction, because over any stretch the two interval series differ only by the change in R-to-AO delay. For context, [2] reports [-5.0, +5.4] ms across 49 healthy subjects. A single-subject recording is not directly comparable.

Limitations: one subject, one session, at rest. SCG HRV is currently only reported while the ECG is producing windows, so the SCG pipeline has not been evaluated standalone. SDNN over 60 s is lower than the 5-minute SDNN that published norms use, so it should not be compared with them [3].

Bland-Altman: SCG vs ECG HRV and beat to beat intervals

Run python software/analyze.py <session_dir> to compute the metrics and plots for a session saved by the software/monitor.py script.

Build Instructions

Compiled with STM32CubeIDE.

  1. git clone https://github.com/konstantinosfragkoulis/HealthMonitor.git
  2. Open STM32CubeIDE > File > STM32 Project Create/Import > Import STM32 Project > STM32CubeMX/STM32CubeIDE Project.
  3. Point to the /fw directory.
  4. Build (Release/Debug) and flash via ST-Link.

Host Telemetry

The STM32 streams binary packets over USB CDC. Use the included Python script to plot sensor data in real time.

bash
cd software
pip install pyserial numpy matplotlib # You might want to use a virtual environment for this

# Auto detect port
python monitor.py

# Manually select port
python monitor.py COM3         # Windows
python monitor.py /dev/ttyACM0 # Linux

Acknowledgements

  • USB stack powered by the open source TinyUSB library (MIT License).

References

[1] M. N. Imtiaz and N. Khan, "Pan-Tompkins++: A Robust Approach to Detect R-peaks in ECG Signals," in Proc. IEEE Int. Conf. Bioinformatics and Biomedicine (BIBM), 2022, doi: 10.1109/BIBM55620.2022.9995552. [Online]. Available: https://arxiv.org/abs/2211.03171

[2] S. Parlato, J. Centracchio, D. Esposito, P. Bifulco, and E. Andreozzi, "Fully automated template matching method for ECG-free heartbeat detection in cardiomechanical signals of healthy and pathological subjects," Physical and Engineering Sciences in Medicine, vol. 48, pp. 649-664, 2025, doi: 10.1007/s13246-025-01531-3.

[3] Task Force of the European Society of Cardiology and the North American Society of Pacing and Electrophysiology, "Heart rate variability: standards of measurement, physiological interpretation and clinical use," Circulation, vol. 93, pp. 1043-1065, 1996.

[4] F. Shaffer and J. P. Ginsberg, "An Overview of Heart Rate Variability Metrics and Norms," Frontiers in Public Health, vol. 5, Art. no. 258, 2017.

[5] J. M. Bland and D. G. Altman, "Statistical methods for assessing agreement between two methods of clinical measurement," The Lancet, vol. 327, no. 8476, pp. 307-310, 1986.

Parts

91
QtyValueFootprintReferences
14100nCapacitor_SMD:C_0603_1608MetricC1, C4, C5, C6, C8, C12, C15, C22, C23, C29, C30, C31, C32, C33
61uCapacitor_SMD:C_0603_1608MetricC2, C3, C13, C14, C20, C21
633Resistor_SMD:R_0603_1608MetricR16, R17, R18, R23, R24, R25
510MResistor_SMD:R_0603_1608MetricR3, R4, R5, R9, R10
51MResistor_SMD:R_0603_1608MetricR11, R12, R15, R20, R21
51kResistor_SMD:R_0603_1608MetricR28, R29, R30, R31, R32
5LEDLED_SMD:LED_0603_1608MetricD3, D4, D5, D6, D7
410kResistor_SMD:R_0603_1608MetricR1, R2, R19, R22
410uCapacitor_SMD:C_0805_2012MetricC7, C9, C34, C35
4MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2, H3, H4
212pCapacitor_SMD:C_0402_1005MetricC16, C17
2180kResistor_SMD:R_0603_1608MetricR6, R7
218pCapacitor_SMD:C_0402_1005MetricC18, C19
22.2uCapacitor_SMD:C_0603_1608MetricC10, C11
24.7uCapacitor_SMD:C_0805_2012MetricC24, C28
25.1kResistor_SMD:R_0603_1608MetricR26, R27
2DDiode_SMD:D_SOD-123D1, D2
2TPS7A2033PDBVRTPS7A2028PDBVR:SOT95P280X145-5NIC1, IC2
1100kResistor_SMD:R_0603_1608MetricR13
11nCapacitor_SMD:C_0603_1608MetricC25
12.2uInductor_SMD:L_1008_2520MetricL1
12.7nCapacitor_SMD:C_0603_1608MetricC27
1332kResistor_SMD:R_0603_1608MetricR14
1360kResistor_SMD:R_0603_1608MetricR8
16.8nCapacitor_SMD:C_0402_1005MetricC26
1AD8232ACPZ-R7AD8232ACPZ-R7:QFN50P400X400X80-21N-DIC3
1Conn_01x02_PinConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ4
1Conn_01x05_PinConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_HorizontalJ1
1CrystalCrystal:Crystal_SMD_3215-2Pin_3.2x1.5mmY2
1Crystal_GND24Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1SJ2-35813B-SMT-TRSJ2-35813B-SMT-TR:SJ235813BSMTTRJ2
1ST1VAFE6AXTRST1VAFE6AXTR:LGA-14L_STMU2
1STM32U595RJTxQPackage_QFP:LQFP-64_10x10mm_P0.5mmU1
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ3
1W25Q128JVSPackage_SO:SOIC-8_5.3x5.3mm_P1.27mmU3

More from konstantinosfragkoulis/HealthMonitor

1
  • 4 layers44 × 27.2 mmHM Rev1, the printed circuit board in 3D

    HM Rev1

    konstantinosfragkoulis/HealthMonitor

    Chest-worn STM32U5 sensor that records ECG and SCG, and computes HRV on-device. Bare metal C.

    84 parts1MIT

Similar boards

  • 4 layers100 × 100 mmICEDevBoard, the printed circuit board in 3D

    ICEDevBoard

    ddraig68k/ICE40DevBoard

    Lattice ICE40HX8K Development board

    237 parts
  • 2 layers220 × 50 mmNeuroVox v2.0, the printed circuit board in 3D

    NeuroVox v2.0

    Swapnil007-Curious/NeuroVox-v2.0

    NeuroVox v2.0 is a conformal 220×50mm forearm wearable PCB. Powered by an ESP32-S3, it captures high-res 4-channel EMG via AD8232, INA333, and ADS1299 ICs using leadless, integrated dry Ag/AgCl edge electrodes.

    94 parts3
  • 2 layers17.5 × 24.7 mmMy template, the printed circuit board in 3D

    My template

    nwasr/Stamp-Board-of-AD8232

    Compact AD8232 stamp board designed in KiCad v9 with schematic, PCB layout, Gerbers, BOM, and 3D view.

    23 parts2MIT
  • 2 layers26 × 40 mmNervous ECG, the printed circuit board in 3D

    Nervous ECG

    sensors-inl/Nervous-ECG

    ECAD design files, firmware source code and standalone application for the ECG sensor of the Nervous project.

    65 parts2MIT
  • 2 layers27.9 × 37.6 mmMy template, the printed circuit board in 3D

    My template

    nwasr/SparkFun-AD8232-Replica

    KiCad v9 PCB design replicating the SparkFun AD8232 ECG module

    36 parts1MIT
  • 2 layers70 × 57 mmTest PCB, the printed circuit board in 3D

    Test PCB

    abbyfinka/FYP-Knitted-EMG

    This repository contains the software and hardware design files developed for my Final Year Project at Imperial College London

    56 parts
  • 4 layers99.5 × 56.5 mmEKG licenta, the printed circuit board in 3D

    EKG licenta

    AlexMirt2/EKG-signal-acquisition-and-processing-system

    The diploma project focuses on designing and implementing an ECG signal acquisition and processing system. It includes smart devices capable of transmitting data to the cloud.

    107 parts

Questions

How big is the HM Collector Rev2 PCB?

It measures 37.5 × 29.5 mm and has 4 copper layers, 1.6 mm thick.

What parts does the HM Collector Rev2 use?

91 parts, built around the AD8232ACPZ-R7, W25Q128JVSIQ, TPS7A2033PDBVR-TP and SJ2-35813B-SMT-TR. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the HM Collector Rev2 KiCad files?

From the konstantinosfragkoulis/HealthMonitor repository on GitHub, at the commit this page was made from: the board is hardware/HM-Rev2/HM-Collector-Rev2.kicad_pcb and its schematic hardware/HM-Rev1/HM-Rev1.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the HM Collector Rev2 design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).