← Projects

MotionPI

Wearable biosignals · Free-living health data

MotionPI: a privacy-first wearable-sensing platform that captures clean, free-living PPG (for HR/HRV), tri-axial accelerometry, and ENMO for an NIH health study — with real-time on-device MVPA detection, ~7.7M records/day, and zero malformed writes.

Scroll to play
01 · The cohort

Pacific Islanders.

02 · The setup

The lab disappears into daily life.

03 · What it captures

Every data point — across every channel — carries its own timestamp into MongoDB.

04 · The analysis

From MongoDB the signals return — embeddings, activity, and denoising: keep what both wrists share, drop what only one saw.

05 · One heart

Two wrists, one heart — and ENMO activity tracks the beat, validating the PPG (activity and heart rate move together).

Scroll down to read more

MotionPI

MotionPI: a privacy-first wearable-sensing platform that captures clean, free-living PPG (for HR/HRV), tri-axial accelerometry, and ENMO for an NIH health study — with real-time on-device MVPA detection, ~7.7M records/day, and zero malformed writes.

01 · The cohort

100 participants, two wristbands each — PPG, motion, ENMO, GPS and in-the-moment surveys, 7.7M records a day into MongoDB with zero malformed writes.

Paper ENMO visualizer Monitoring tool

Overview

Collecting clean biosignal data outside the lab

Wearable health-sensing models depend on the quality of the physiological data they are trained on, and that data is hardest to keep clean outside the lab. In free-living conditions phones run out of battery, Bluetooth connections drop, networks become unavailable, and the operating system suspends background applications. Each reading lost or corrupted by those failures is missing from the dataset.

MotionPI is designed on the assumption that each of these failures will occur and that no data may be lost when they do. It turns BLE wristbands and a smartphone into a reliable source of free-living physiological data — PPG for heart rate and HRV, tri-axial accelerometry, and wristband-computed ENMO — writing every reading locally, validating it against a schema, and syncing only when it is safe, so a dropped connection costs seconds of buffering rather than hours of sensor data.

I built and deployed it in the Kahlert School of Computing at the University of Utah, advised by Jeff M. Phillips, in close collaboration with the Department of Health & Kinesiology, the Huntsman Cancer Institute, the College of Social & Behavioral Science, and wearable-hardware teams at Ohio State’s College of Engineering.

The study

An NIH-funded field study of physical activity

MotionPI powers an active, multi-million-dollar NIH-funded behavioral study — Using Momentary Measures to Understand Physical Activity Adoption and Maintenance among Pacific Islanders in the United States — led by PI Professor Neng Wan. It uses momentary, in-the-wild measurement to understand how Pacific Islander communities adopt and sustain physical activity over time.

Cohorts
15–20 participants at a time, each observed across three separate one-week intervals
Daily window
8:30 AM – 10:00 PM, every day of an active week
Per participant
A smartphone running MotionPI, plus two BLE wristbands (left and right)
Collection began
May 23, 2025 — the study is ongoing
Privacy
Keyed by pseudonymous participant ID, stored on the University of Utah CHPC. No login information or PHI is collected, and the research team never has direct access to participant identities.

The signal

Free-living ENMO and on-device activity detection

The wristbands compute ENMO (Euclidean Norm Minus One, a gravity-adjusted measure of acceleration magnitude) continuously and stream 15-second averages to the phone. The chart below is sixteen days of that signal from the study: activity concentrates in waking hours and falls to near zero overnight, the free-living structure that health-sensing models are evaluated against.

Sixteen participant-days of free-living ENMO from one consented participant. The chart is live: hover a point for its value, drag across it to zoom into a window, double-click to zoom back out, and click a legend entry to show or hide that layer. De-identified; the full study lives on the University of Utah CHPC. Open full screen ↗ · code

A screen capture of the chart above in use: hovering a point to read its value, dragging across the plot to zoom into a window, zooming back out, and toggling layers from the legend.

That same signal drives the study’s surveys. When 70% of the ENMO values in a 7-minute sliding window exceed 100.6 mg, the period is classified as moderate-to-vigorous physical activity (MVPA), and the wristband sends a trigger bit to the phone, which delivers an Ecological Momentary Assessment (EMA) survey at that moment. Retrospective surveys ask participants to recall how they felt hours after the fact; MotionPI asks during the activity itself, because the wristband detects it as it occurs.

This mechanism lets the study capture the contextual, psychosocial and environmental factors surrounding real physical activity, which retrospective recall cannot recover.

System design

Application, wristbands and backend

A Flutter application senses continuously, survives backgrounding, buffers data offline and recovers from interruptions automatically. The wristbands stream IMU and ENMO values along with battery, storage and charging state, and the application maintains the BLE link through reconnection and resubscription logic. Data is written to a Node.js and Express backend, where MongoDB accepts only schema-validated records. This pipeline sustained roughly 7.7 million records per day with no malformed writes.

MotionPI app screenshots

MotionPI app states: connectivity, wristband battery and storage, data-collection indicators, BLE status, and EMA survey interfaces.

The wristbands extend the MotionSense HRV research platform — a full biosignal suite with on-device processing and 30-day onboard storage, streaming summaries and activity triggers to the phone while archiving raw high-rate waveforms locally.

MotionPI wristbands
PPG (cardiac)
Analog Devices MAX86141, green + infrared (OSRAM SFH701) for heart rate and HRV; raw optical waveforms archived on-device, with optical barriers and adaptive illumination for a cleaner signal.
Inertial (IMU)
TDK InvenSense ICM20948 — 9-axis (accel + gyro + mag) at 32 Hz; the source of ENMO and motion context.
On-device compute
ENMO computed on the wristband; a real-time MVPA rule (100.6 mg over 4.9 of every 7 minutes) emits an activity-trigger bit over BLE.
MCU / radio
Nordic nRF5340 BLE SoC — dual-core, low-power, Bluetooth Low Energy to the phone.
Onboard storage
4 GB NAND + 8 MB NOR with a custom Flash Translation Layer separating the file table (NOR) from data (NAND) — wear-free durability and up to 30 days of raw PPG/IMU recording.
Security & backend
AES-256 (CBC) GPS encryption on-device; JWT device-level auth with offline sign-in; Express.js + Podman-managed MongoDB with Mongoose schema validation and retry/backfill.
Location
GPS sampled every five seconds during study periods, encrypted at rest and pseudonymized; only aggregated or de-identified outputs reach authorized researchers.
5-second GPS trajectory accuracy demonstration

Five-second GPS trajectory from a test participant, showing the positional accuracy recoverable after secure decryption. Raw traces stay encrypted, pseudonymized, and unlinked to personal identity.

Validation

Pre-pilot end-to-end testing

Before enrolment began we validated the pipeline end to end. Left- and right-hand wristbands were shaken in separate bags to simulate continuous activity and trigger the seven-minute MVPA rule. The wristbands detected the activity, transmitted the trigger bit over BLE, and the phone delivered the EMA survey, confirming firmware, BLE synchronisation, application logic and sensor integration together. The PPG sensors (green indicator) remained active throughout for HR and HRV measurement.

Shaking both wristbands trips the 7-minute MVPA rule: the trigger bit reaches the phone and the EMA survey appears (32 s).
Both bands paired and collecting: the green PPG illumination is on while the app reports each wristband connected, with its battery and storage.

Monitoring

Participant compliance reporting

Running a multi-week field study requires knowing, day to day, whether each participant's device is collecting data. The MotionPI Active Participants Report is a MongoDB-backed tool that summarises every data stream (location, ENMO, surveys, logs and battery) for a configurable time window and timezone, and reports per-participant disconnects, data-collection toggles, expired surveys and denied PA surveys, so that the study team can intervene while there is still time.

Measured impact on wear adherence

Coordinators use the report to spot wristbands going quiet and follow up the same week. The study team reports typical per-participant wristband records rising from ~400–600 to 700–800, with some participants reaching 1,000 — verified as genuinely more wear time, not a display artifact — recovering signal that would otherwise have been silently missing from the dataset.

For non-technical collaborators the tool ships in three forms: a command-line report, a Flask web application with interactive tables, charts and CSV/PNG export, and a packaged double-click application (PyInstaller, Apple Silicon and Intel) that starts the server and opens a browser without requiring a Python install. An in-app help page and a log-event reference define every metric and give MongoDB query examples. The system follows secure-by-default practices: no secrets in the repository, localhost binding, optional API-key protection and configurable CORS.

Choose a time window and data sources, run the report, and explore per-participant tables and charts with CSV/PNG export.

Publication

Designing a Secure and Resilient Distributed Smartphone Participant Data Collection System

The system design and reliability framework described above, published at EAI SmartSP 2025.

If you are working on wearable biosignals, on-device sensing algorithms, or the data pipelines and signal-quality tooling behind health-sensing models, I would love to talk.