TECHNICAL BLOG

Deep Dives for Engineers

Detailed technical articles covering the real problems we solve in embedded systems, AI, and robotics engineering.

Biomedical AI: Wearable Health Monitoring with Embedded Devices and Machine Learning
Robotics and AI

Biomedical AI: Wearable Health Monitoring with Embedded Devices and Machine Learning

Worksprout Team Jan 25, 2025 10 min read

How to design embedded wearable systems for continuous health monitoring — signal acquisition, noise filtering, and on-device ML for heart rate, SpO2, and anomaly detection.

The Wearable AI Opportunity

Continuous, passive health monitoring at hospital-grade accuracy was, until recently, possible only in clinical settings with bulky equipment. The convergence of miniaturised sensors (PPG, ECG, IMU, temperature), low-power microcontrollers (ARM Cortex-M series, RISC-V), and efficient on-device ML has changed this. Devices worn on the wrist or patch-mounted on the chest can now monitor heart rate, oxygen saturation, respiratory rate, and early arrhythmia indicators continuously — with processing happening on-device to preserve privacy and battery life.

Sensor Stack

A reference embedded health monitoring platform typically integrates:

  • PPG (Photoplethysmography) — optical sensor measuring blood volume changes for heart rate and SpO2 (MAX30102, MAX86141)
  • Single-lead ECG — electrical cardiac signal for arrhythmia detection (MAX30003, ADS1293)
  • 6-axis IMU — accelerometer + gyroscope for motion artefact removal and activity classification (BMI270, ICM-42688)
  • Skin temperature — contact thermistor or IR temperature sensor for fever detection

Signal Acquisition and Filtering

Raw PPG and ECG signals are contaminated by motion artefacts, powerline interference (50/60 Hz), and baseline wander. Filtering in the embedded domain:

import numpy as np
from scipy import signal

def bandpass_ppg(raw_signal: np.ndarray, fs: float = 100.0) -> np.ndarray:
    '''Bandpass filter for PPG: 0.5-4 Hz (30-240 BPM)'''
    sos = signal.butter(4, [0.5, 4.0], btype="band", fs=fs, output="sos")
    return signal.sosfiltfilt(sos, raw_signal)

def notch_ecg(raw_signal: np.ndarray, fs: float = 250.0) -> np.ndarray:
    '''Notch filter to remove 50 Hz powerline interference'''
    b, a = signal.iirnotch(50.0, 30.0, fs=fs)
    return signal.filtfilt(b, a, raw_signal)

On embedded targets, implement these as fixed-point IIR filters using ARM CMSIS-DSP functions (arm_biquad_cascade_df2T_f32) for efficient execution on Cortex-M4/M7 without floating-point overhead.

Heart Rate and SpO2 Extraction

Heart rate from PPG is derived via peak detection on the filtered AC component. SpO2 is calculated from the ratio of AC/DC amplitudes at red (660 nm) and infrared (940 nm) wavelengths:

def compute_spo2(red_ac, red_dc, ir_ac, ir_dc):
    R = (red_ac / red_dc) / (ir_ac / ir_dc)
    # Empirical calibration curve (from manufacturer datasheet)
    spo2 = -45.060 * R * R + 30.354 * R + 94.845
    return np.clip(spo2, 70, 100)

On-Device Arrhythmia Detection

A 1D convolutional neural network trained on the MIT-BIH Arrhythmia Database can classify ECG beats into Normal, Supraventricular, Ventricular, Fusion, and Unknown categories with >96% accuracy. Quantise to INT8 with TensorFlow Lite for deployment on a Cortex-M33:

import tensorflow as tf

converter = tf.lite.TFLiteConverter.from_saved_model("ecg_classifier")
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.representative_dataset = representative_data_gen
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.int8
converter.inference_output_type = tf.int8

tflite_model = converter.convert()

The resulting model is typically 80-120 KB, fits in Cortex-M33 flash, and runs an inference in under 2 ms.

Privacy and Regulatory Considerations

Health data processed on-device eliminates many privacy concerns — raw biometric signals never leave the device. For products marketed as medical devices, regulatory classification (FDA 510(k) in the US, CE Class IIa in the EU) applies when making clinical claims. Design your system to clearly separate wellness features (no regulatory path) from diagnostic claims (regulated) and document this distinction from the architecture stage.

Conclusion

Wearable health monitoring with on-device ML is now technically feasible on commodity embedded hardware. The combination of miniaturised sensors, efficient signal processing, and quantised neural networks enables clinical-quality metrics at consumer device power budgets. The engineering challenge has shifted from "is it possible?" to "is the signal quality reliable enough and the model calibrated well enough to be trusted?" — which requires careful sensor selection, rigorous validation, and honest performance characterisation.

Share

Worksprout Team

The Worksprout engineering team specialises in embedded Linux, RDK-B broadband platforms, edge AI, and robotics systems. Based in Rajshahi, Bangladesh, we design and deploy production embedded intelligence for clients across South Asia and beyond.

Related Posts

Continue reading — handpicked articles you might enjoy