Hi, I'm Kyle.

I build debatably cool things.

Notice

Freelance work closed indefinitely as I prepare for a full-time job search.

Kyle Dudley

Junior EE Student

Texas A&M University

Hi, I'm Kyle.

I build debatably cool things.

Notice

Freelance work closed indefinitely as I prepare for a full-time job search.

Kyle Dudley

Junior EE Student

Texas A&M University

Tinycardia

Tinycardia is a wearable ECG system for continuous atrial fibrillation (AFib) detection. It combines real-time cardiac signal acquisition, embedded machine learning, custom PCB design, and wireless telemetry to detect abnormal rhythms without requiring the user to manually initiate a measurement.

The first prototype proved that AFib classification could run entirely on an STM32 microcontroller using 10-second ECG windows. The current revision expands that prototype into a battery-powered wearable built around the Nordic nRF52840, MAX30003 ECG front end, a custom carrier PCB, BLE connectivity, and phone-facing telemetry.

LINKS

ROLE

Embedded Systems Architect & Firmware Engineer

PROBLEM

Atrial fibrillation can occur intermittently and without obvious symptoms, making short, manually initiated ECG measurements easy to miss. Consumer wearables can detect AFib, but ECG measurements commonly require deliberate user interaction. Clinical ambulatory monitors provide longer-term monitoring, but are designed for prescribed diagnostic use rather than an inexpensive, developer-built wearable platform.

Tinycardia explores a different architecture: continuously acquire ECG data, analyze the signal locally on low-power embedded hardware, and surface cardiac events without requiring the user to initiate each measurement.

RESULTS

93.7% model validation accuracy

10-second ECG analysis windows

On-device STM32 inference + custom nRF52840 wearable PCB/BLE architecture

From ECG signal to wearable hardware

Tinycardia began as a benchtop embedded system built around an STM32F446RE and a MAX30003 single-lead ECG analog front end. The MAX30003 communicates with the microcontroller over SPI and samples ECG data at 256 Hz, balancing waveform fidelity with the memory and processing constraints of an embedded system.

Firmware buffers 2,560 samples at a time, representing a 10-second ECG window, before passing the data into the signal-processing and inference pipeline. The original system also streams ECG samples and classification results over UART to a Python/PyQt application for live waveform visualization and debugging.

I use a Modified Lead II electrode configuration because it provides strong R-wave visibility for rhythm analysis while remaining practical for a wearable prototype.

After proving the signal-acquisition and inference pipeline on the STM32 development board, I began redesigning Tinycardia as a portable system. The second hardware revision uses a Nordic nRF52840-based module alongside the MAX30003 on a custom KiCad carrier PCB, adding battery operation, USB-C access, BLE telemetry, and a physical user interface.

The PCB is intentionally two-layer rather than four-layer because the system’s routing density does not justify the additional fabrication complexity. During the second revision I shortened and separated SPI traces, improved ground-plane continuity, added ground-stitching vias, corrected power distribution, and redesigned component placement around the enclosure and antenna keepout.

The result is a project that has progressed from development-board proof of concept toward an integrated wearable embedded system.

Model design and embedded deployment

AFib is fundamentally a rhythm disorder, so classifying isolated heartbeats is not enough. My initial experiments used beat-level ECG classification, but I moved to 10-second rhythm windows after determining that the model needed temporal information about the spacing between heartbeats.

I trained the system using ECG recordings from the PTB-XL dataset, resampled to match the MAX30003’s 256 Hz acquisition rate.

The model uses two complementary sources of information. A 1D convolutional branch learns morphological features directly from the raw ECG waveform, while a second branch operates on R-to-R interval statistics extracted after QRS detection. Pan-Tompkins QRS detection identifies the R peaks, from which features such as mean RR interval, standard deviation, and variance describe the timing irregularity characteristic of AFib.

Combining waveform morphology with rhythm information produced substantially better performance than the waveform-only model, reaching 93.7% overall validation accuracy and 95.3% AFib recall.

I quantized the trained network and deployed it through STM32 X-CUBE-AI, allowing the entire inference pipeline to execute locally on an ARM Cortex-M microcontroller without cloud processing or an external computer.

AFib precision remains an area for improvement. The current model is deliberately more sensitive to AFib than it is selective, and I use thresholding to reduce false classifications. Improving that tradeoff is one of the continuing ML challenges in the project.

Building beyond the proof of concept

The original STM32 prototype validated the core system end to end: acquiring a real ECG signal through the MAX30003, processing it in firmware, running a quantized neural network locally, and transmitting the resulting waveform and classifications to a live visualization application.

I also tested the prototype using adhesive electrodes on real subjects to verify that the complete acquisition pipeline could produce recognizable ECG waveforms outside of prerecorded datasets. Those tests exposed an important difference between notebook accuracy and real embedded performance: electrode placement, motion, contact quality, signal noise, and classification thresholds all affect the behavior of the deployed system.

Rather than treating the development-board prototype as the finished project, I used those limitations to drive the next revision.

Tinycardia is now being developed around the nRF52840 platform, with BLE communication already established and firmware being structured around ECG acquisition, buffering, telemetry, low-power operation, and eventual phone visualization. The custom PCB and enclosure turn what began as an ML experiment into a broader embedded-systems project spanning biomedical signal acquisition, firmware architecture, TinyML deployment, PCB design, hardware debugging, wireless communication, and product-level integration.