The Heart-Throbs ❤️

UPenn ESE 350 Final Project

About

This is a wireless finger clip that is able to take in a patient's heart rate, pulse oximetry, and blood pressure using an IR LED, a Red LED, a phototransistor, and some signal processing and ML. BPM and pulse oxygenation can be directly found using the graph of the phototransistor's ADC values over time, and blood pressure can be found by comparing this spectrum against spectrums with known blood pressures in a medical database using a simple machine learning algorithm. We then plan to push this data to an LCD screen using an ESP32, and push it to a cloud dashboard for continual storage of medical data for future reference.

Instructions

Just run make. (This should install dependencies as well).

Notable features:

  • Bare-metal register-level C on the ESP32 with a manual build script & flashing routine
    • It's difficult to articulate how much of a pain this was to get to work the feather working
    • E.g., some essential registers (like SENS_SAR_SLAVE_ADDR1—I dare you to look it up) are just entirely absent from the manual
    • Yet at the same time the official library (ESP-IDF) is undocumented and, in the name of safety, ~20x slower than this repo (no shade tho!)
  • Scrolling display with interpolated lines, adjusted in real time to a moving average and running peak, all fast enough to display in real time
  • Fixed-point division, aligned with real-world seconds (by some crazy unit math), without overflow on the full range of possible human heart rates
  • Custom font by hand! Writes sideways as well!
  • Displaying integers uses an array of function pointers, choosing an integer in O(1)
  • Automatically write VSCode JSON when compiling for mouse-over config info (see esp32/Makefile)

Libraries

None so far.

Disclaimer: as noted above, the ESP32 manual is literally incomplete, and so if a module was not working after multiple hours of following the instructions and exhausting reasonable what-ifs, I would comb through an ESP-IDF implementation to see which registers were missing. None of their code survives in any form, and I thoroughly documented my code (unlike ESP-IDF!) to demonstrate understanding and help my future self out.

Demonstration

Here is the current state of the project: https://youtube.com/shorts/ZsG0fzAm2Nc We have gotten the heart beat monitor to work properly with a feather in baremetal on the LCD, and are currently working on adding a pulse oximeter as the next feature!

Inspiration

We want to solve the problem of vital monitoring equipment being bulky, encumbering, and expensive, if available at all. First responders are often forced to measure heart rate by hand and triage with pen and paper; these wearables would be a drop-in replacement to receive a continuous stream of vital data. Furthermore, existing medical-grade heart rate and blood pressure monitors can cost thousands of dollars and can’t safely aggregate data; we believe that an SSL-encrypted cloud platform using anonymized patient data to train better and better models could be invaluable for medicine. We also want to offer cheaper sensors for people to use rather than a fitbit or Apple Watch, especially for people at high risk. Our bracelet will be running ML to be able to monitor blood pressure. We can also keep a history of the data, and be able to stream it to the cloud. This is a wellness first project. We will be focused on making it easier and cheap for people to monitor their vitals, while also offering some more vitals over smart watches. There are many use cases for this in events of mass casualties, where there isn’t enough equipment or EMS for the amount of people needing it, or in situations such as emergency room waiting rooms, where it requires having staff and rooms available to hook up people to a tower of sensors..

What it does

Our project is an affordable bracelet that uses an array of sensors and edge machine learning to provide continuous blood pressure, blood oxygen, and heart rate monitoring for patients. The bracelet will push data to the cloud and store the history of patients’ data for healthcare providers to look at, and it will also provide a way to monitor patients in emergency situations when there isn’t enough equipment to go around.

Built With

Share this project:

Updates