Skip to main content
Version: FILS English

Health Monitor

A wearable device that tracks heart rate, blood oxygen saturation, and step count in real-time.

info

Author: PASTOR Mario-Alexandru
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-l00tus

Description

This wearable health monitor continuously measures and displays the user's vital signs in real time. It uses a MAX30102 pulse oximeter sensor to calculate heart rate (BPM) and blood oxygen saturation (SpO₂), alongside an ADXL345 accelerometer to detect and count steps. The collected data is displayed on a compact SSD1306 screen, providing a clear and minimal interface. Additionally, a web application fetches the latest sensor readings from the device, displaying the latest sensor reading and three charts that show the evolution of the measured parameters.

Motivation

I chose this project because I wanted to develop something that integrates both hardware and software in a meaningful way. I was especially motivated by the idea of building something that could have real-life applicability, so I decided to build a wearable health monitor, which felt like a good balance between technical challenge and practical usefulness.

Architecture

Schematic Diagram

architecture-diagram

Components Overview

  • 2x Raspberry Pi Pico 2W:
    • one used as a debugger
    • one used to control the sensors and display
  • ADXL345 Accelerometer: used to measure step count through 3-axis acceleration data
  • MAX30102: used to measure heart rate and blood oxygen level by detecting changes in light absorption from red and IR LEDs using a photoplethysmography sensor
  • SSD1306: used to display real-time sensor data like the heart rate, SpO₂, and step count on an OLED screen

Log

Week 21 - 27 Apr

After my project got approved, I looked for the necessary hardware and software parts. After deciding on the parts, I ordered them.

Week 28 - 4 May

I started to assemble the parts on the breadboards in order to test each component. I managed to read the data on all three axes of the accelerometer, to determine the heart rate and SpO₂ from the pulse oximeter, and to print the informations in the terminal. Additionally, I tested the screen.

testing-components

Week 5 - 11 May

I successfully implemented and tested the algorithm for step count detection using the accelerometer. Additionally, I wrote the code for displaying all the collected data (step count, heart rate, SpO₂) on the screen.

screen-data

Week 12 - 18 May

I consulted with my lab teacher regarding the 3D casing for the sensors, and we concluded that designing a separate case for each sensor would be more efficient. For the pulse oximeter, I used a pre-existing 3D finger clip found online. The next step is to drill holes in the case to allow the wires to pass through properly.

oximeter-finger-clip

Week 19 - 25 May

I managed to drill a hole in the finger clip so that the wires of the sensor can pass through it, and I stuck the accelerometer to the finger clip. For the software part, I implemented a separate task that handles the TCP connection, and I tested sending the latest sensor reading. I started working on the web interface, which will display the data and chose Python with Flask for it.

Week 26 - 30 May

I finished the Python script, which handles fetching the data from the device over TCP, and I worked on the visual appearance of the website. I tested to see if the web interface works while wearing the device (and it does). Additionally, I recorded myself testing the device.

web-interface

Hardware

My project is built around the Raspberry Pi Pico 2W microcontroller, which collects and processes data from two sensors. An ADXL345 accelerometer is used to detect motion and count steps by measuring the changes in acceleration, while the MAX30102 pulse oximeter sensor measures heart rate and blood oxygen levels by detecting changes in light absorption due to blood flow. The SSD1306 OLED display shows in real time the health metrics of the user. This is what the hardware looks like. I 3D printed a finger case for the pulse oximeter, and I used double-sided adhesive tape to stick the accelerometer to the case. I put the breadboard in a box, leaving only the screen on the side of it, and I made a hole for the sensor wires.

hardware

Schematics

kicad-schematic

Bill of Materials

DeviceUsagePrice
2x Raspberry Pi Pico 2WThe microcontroller and the debugger2 x 40 RON
ADXL345Accelerometer for detecting and counting steps13 RON
MAX30102Pulse oximeter and heart rate sensor13 RON
SSD1306OLED screen for displaying data24 RON
3x Breadboards & WiresWiring3 x 5 RON + 8 RON

Software

LibraryDescriptionUsage
embassy-executorAsynchronous task executorUsed for task scheduling
embassy-rpRP2040 HAL for EmbassyAccess to RP2040 peripherals (GPIO, SPI, I2C)
embassy-timeTiming utilitiesUsed for delays
embassy-syncAsync synchronization primitivesUsed for Mutex (both for the screen and for sharing sensor data between tasks)
embassy-netAsync network stack for embedded devicesUsed to handle and run the TCP server
embedded-graphics2D graphics libraryRendering text on the screen
static-cellSafe static memory allocatorUsed to initialize and store static data
cyw43Wi-Fi driverRuns the Wi-Fi stack and sets up the acces point
cyw43-pioCYW43 driver using PioRequired for the Wi-Fi task
display-interface-spiSPI display abstractionFacilitates SPI communication between SSD1306 and device
embassy-embedded-halExtensions for embedded-hal traitsUsed for SPI shared-bus support
embedded-hal-asyncAsync embedded HAL traitsUsed for I2C communication
embedded-io-asyncAsync embedded I/O traitsEnables non-blocking writing on the TCP socket
ssd1306OLED display driverUsed to control the display
defmtLightweight logging crateUsed for logging data
heaplessData structuresUsed for creating strings
libmFloat math functionsUsed for computing math functions
  1. Measure Heart Rate and SpO2 with MAX30102
  2. MAX30102 Finger Clip 3D Model
  3. Testing the device