On-device ECG stress detection deployed on a resource-constrained ARM Cortex-M4 microcontroller
Continuous stress monitoring using wearable devices demands lightweight inference architectures that operate within the strict memory and power constraints of embedded microcontrollers. This study investigates on-device binary stress classification (stress vs. non-stress) from single-lead electrocardiogram (ECG) signals using two lightweight deep neural network architectures — an artificial neural network (ANN) and a one-dimensional convolutional neural network (1D-CNN) — deployed on an ARM Cortex-M4 microcontroller (STM32MP157F-DK2) with 128 KB FLASH and 256 KB SRAM. Using the WESAD dataset, ECG signals were down sampled to 500 Hz and segmented into balanced one-second windows. Models were iteratively optimised to satisfy hardware budgets and deployed via STM32Cube X-CUBE-AI with medium compression. The ANN (1500 input features, five hidden layers) achieved 78.74% test accuracy at 6.29 ms inference latency, while the 1D-CNN (500 input features, one convolutional and three fully connected layers) achieved 79.34% at 13.43 ms. End-to-end validation was performed using live ECG data acquired through an AD8232 sensor. Results demonstrate that clinically meaningful stress classification is achievable on resource-constrained platforms without cloud dependency, offering a practical pathway towards privacy-preserving wearable mental health monitoring.
Authors
- Hermawan Nugroho (ORCID: https://orcid.org/0000-0002-8779-3116)
- Koay Xian Cong
Institutions
- University of Nottingham Malaysia Campus (MY)
Publication Details
- Journal
- Discover Electronics
- Published
- 2026-09-10
- DOI
- https://doi.org/10.1007/s44291-026-00279-8
- Primary Topic
- ECG Monitoring and Analysis
- Type
- article
- Field-Weighted Citation Impact
- 0.00