Embedded · Wearable · Edge ML · ELEC 594 Capstone
SALLY
A wearable for passive, at-home monitoring of maternal mental health.
Final graduate showcase poster, November 2026. Click to open full size.
SALLY is a necklace that listens for vocal markers of rising stress during pregnancy and postpartum. Its goal is to give pregnant women a voice state, a distress score, speech transcription and conversation summaries from a wearable. The device only records when someone is talking. All processing happens on a local Raspberry Pi edge server, with no cloud services and no third-party API calls. It is a two-semester Rice University ECE capstone (ELEC 594), supervised by Nakul Garg. SALLY is a research prototype and does not diagnose any condition.
The Problem
Mental health conditions are a leading, preventable cause of pregnancy-related death in the U.S., yet screening is rare. In 2023, only about 13% of Medicaid patients were screened for depression during pregnancy and about 9% after birth. For privately insured patients the figures were about 5% and 4%. In Texas in 2019 and 2020, 65% of deaths from mental health causes happened outside a hospital.
Screening today is episodic: one questionnaire during pregnancy, and one in the 7 to 84 days after birth, with a follow-up in 30 days if positive. Acute stress can spike and resolve in minutes and go entirely unobserved between those checks. Rural mothers, who may live far from a birthing hospital (153 of 254 Texas counties have no designated one), are the motivating case.
SALLY's bet is that continuous, passive, privacy-preserving vocal monitoring can build the longitudinal picture that periodic screening cannot.
Sources: Policy Center for Maternal Mental Health (NCQA, 2023); Texas DSHS and MMMRC Joint Biennial Report 2024; March of Dimes 2026 edition.
My Role
I own the embedded hardware and firmware end to end: enclosure design, firmware architecture, power management, and device reliability. I also built the stress-detection model (Fall 2026), and I am the sole author of the capstone report and presentations.
The project began as a three-person team. Jeeven Balasubramaniam built the original Spring 2026 server-side language pipeline and helped build the mobile app, and he co-presents the Rice360 poster. The mobile app was a joint effort.
System Architecture
Wearable Hardware
Seeed XIAO ESP32-S3 Plus, INMP441 PDM microphone, microSD for local buffering, a WS2812B RGB status LED and push button on a small dedicated PCB, and a 500 mAh LiPo battery.
Firmware
C++ on ESP-IDF v5.5.2 and FreeRTOS. On-device voice activity detection (ESP-SR VADNet) gates the recording pipeline, so the device only records when someone is talking, with no wake word. Recordings are buffered on the SD card and uploaded over Wi-Fi in batches.
Edge Server
Raspberry Pi 5 running a Flask server with PostgreSQL. It transcribes locally with faster-whisper (small), extracts 88 voice parameters with openSMILE, scores the voice state and distress, and summarizes conversations with a local small language model. The audio file is deleted after analysis. Filtering for only the owner's voice is still in development.
Mobile App
Flutter app over Tailscale that shows the results: the voice state and distress trends, conversation transcripts and summaries. Scope is deliberately narrow, with no physiological biomarkers and no caregiver features.
Enclosure and Prototype
Designed in SolidWorks. The first prototype was a cube, which proved too bulky and swung while walking. That failure drove the current design: a flat, edge-free pebble split into a bottom tray that holds all the electronics and touches the chest, and a top lid that is only a cover. It is fastened with M2.5 screws into heat-set brass inserts instead of self-tapping into plastic, and twin molded cord loops keep the pendant from spinning on the lanyard.
Companion app screens (illustrative data).
Engineering Highlights
Each of these was a real failure caught and fixed before it became a silent one.
Silent data loss during uploads
A mutex protecting SD card access was held for the whole HTTP upload, a full network round trip. Any conversation that happened while a file was uploading was silently dropped, with no error anywhere. I restructured the path to read the file into a PSRAM buffer, release the lock, then upload outside it. Confirmed on real hardware.
Server upload stalls of up to a minute
Intermittent stalls of about 57 seconds traced to the Pi's Flask server running single-threaded, with the transcription and LLM pipeline sharing the same Python GIL. Enabling threaded request handling fixed it, verified on hardware.
Upload ordering bug
The on-device file listing returned raw filesystem order, which both uploads and low-storage eviction assumed was chronological. A newer recording could be evicted or uploaded ahead of an older one. Because filenames are fixed-width and zero-padded, one lexicographic sort at the shared choke point made both paths correct.
Upload, not recording, drains the battery
On the original 400 mAh cell, recording alone ran 9.5 hours but recording plus Wi-Fi upload ran only 4.5 hours, missing the 8-hour wear target. Uploading large audio files, not recording, was the dominant drain. That led to local SD buffering with batched uploads and, later, a catch-up path that bundles a backlog into one multipart request with per-file confirmation. With the 500 mAh cell, voice activity detection and an upload every 5 minutes, two real-use tests lasted 10.6 hours (Oct 28) and 12.2 hours (Nov 1), both above the 8-hour goal. The 12.2 hour run handled 387 clips, while recording and uploading continuously lasted 4.45 hours. Both tests were one wearer, always connected to Wi-Fi, so this still needs more days and users. The 9.5 and 4.5 hour figures above are from Semester 1 on the old cell.
Voice State and Distress Model
Every conversation window is described by 88 voice parameters from openSMILE (timbre, formants, loudness, spectral balance, pitch, voice quality and rhythm), each measured relative to that woman's own baseline. A random forest of 300 decision trees votes on one of four voice states: calm (calm or neutral speech), subdued (sad, low energy), excited (happy, surprised) or tense (angry, fearful). Each tree asks simple questions, such as "is the pitch up?" or "is the loudness up?", and the average of all 300 votes is the probability of each state.
The distress score is 100 times the chance that the voice is tense. 0 to 39 is calm, 40 to 69 is elevated and 70 or more is high. For example, a score of 55 means the forest gives about a 55% chance that the voice sounds tense, which lands in the elevated band.
Words add context. A tense voice saying happy words is scored lower and flagged "likely excited", and words never raise a score to high. The state rules are hand-set and still being validated. The model was trained on 43 female voices from CREMA-D (1,811 clips) and tested on 12 unseen actresses from RAVDESS (8 acted emotions).
The voice parameters that matter most are the ones that move when a woman's voice changes from her own calm voice. In the CREMA-D data, loudness, pitch, brightness and vowel opening rose for angry, fearful and happy speech, while voice timbre dropped. That is why the model compares each woman with herself instead of with a population average.
The Honest Result
On the 12 unseen RAVDESS actresses, the model picks the right one of four states 51% of the time (balanced accuracy, where guessing is 25%). Calm is right 94% of the time and tense 66% (20% of tense clips were called calm and 14% excited). Excited is right 39% of the time, and 32% of excited clips were called tense. Subdued is right only 7%.
Against each woman's own baseline, the model ranks tense above calm 96% of the time (AUC 0.96), but it still mixes up tense and excited (AUC 0.71). Both are high energy, so this is the main gap. Most tense clips land in the 40 to 69 band, not 70 or more. These are acted emotions in studio audio, not measured stress, and no mothers have been tested yet.
Status and Next Steps
- ELEC 594 midterm presentation and 3-page IEEE-format report, October 21, 2026
- Rice360 Innovation for Healthcare Access 2026 poster, October 22, 2026
- Rice Research in Action graduate student showcase, November 13, 2026
Still open, and not claimed as done:
- Measure battery over more days and with more users (both tests so far are one wearer on Wi-Fi)
- Test real stress, such as calm talk versus timed mental math, instead of acted emotion
- Finish and validate the owner-voice filter. It is in development, so the device currently records anyone talking nearby
- Validate the hand-set state rules
- Obtain IRB approval and collaborate with hospitals to collect maternal speech data. No clinical partnership exists yet.
SALLY is a research prototype and does not diagnose any condition.
Stack
- C++ · ESP-IDF 5.5.2 · FreeRTOS
- ESP-SR 2.5.1 (VADNet)
- XIAO ESP32-S3 · INMP441 · microSD
- SolidWorks
- Raspberry Pi 5 · Flask · PostgreSQL
- Python · openSMILE · faster-whisper · scikit-learn
- Flutter · Tailscale
- Datasets: CREMA-D, RAVDESS
Credits
- Nakul Garg, project supervisor, Phi Lab, Department of Electrical and Computer Engineering, Rice University
- Jeeven Balasubramaniam, collaborator on the server pipeline and mobile app