MINI PROJECT
submitted by
POOJA SRI B
(III-ECE-A-73772213168)
SAJITHAA R
(III-ECE-A-73772213182)
For
60 EC 6P2 & Embedded systems Laboratory
2024– 2025 (Even semester)
Department of Electronics and Communication Engineering
K.S. RANGASAMY COLLEGE OF TECHNOLOGY
(Autonomous)
TIRUCHENGODE – 637 215
STM32-BASED MEDICAL PULSE OXIMETER
OBJECTIVE:
The objective of this project is to develop a compact, power-efficient STM32-based system
that collects and processes data from a pulse oximeter sensor like the MAX30100 or
MAX30102. It will extract SpO₂ and pulse rate using suitable algorithms and display the
results on an OLED or LCD screen. The system aims to be suitable for portable or wearable
use, with validated accuracy against standard devices, and may include Bluetooth or Wi-Fi for
remote health monitoring.
AIM:
To design and implement a portable medical pulse oximeter using an STM32 microcontroller for
real-time monitoring of blood oxygen saturation (SpO₂) and heart rate.
SOFTWARE REQUIRED:
STM32CubeIDE
Proteus
COMPONENTS USED:
STM32 microcontroller board (e.g., STM32F103C8T6)
MAX30100 or MAX30102 pulse oximeter sensor module
OLED display (0.96", I2C)
AMS1117 3.3V voltage regulator
Jumper wires
Breadboard or PCB
Power supply (3.7V Li-ion battery or 5V USB)
PROCEDURE:
1. Connect the STM32 microcontroller and prepare it for programming.
2. Attach the MAX30100 or MAX30102 sensor to the STM32 using the appropriate wiring.
3. Connect the OLED display to the STM32 to enable visual output of the readings.
4. Write the program to read data from the sensor and display it on the OLED screen, then
upload the code to the STM32.
5. Power the entire system using a battery or suitable power supply.
6. Place your finger on the sensor and observe the pulse rate and oxygen saturation
displayed on the screen.
7. Compare the displayed results with those from a standard medical pulse oximeter to verify
accuracy, and make adjustments if necessary.
WORKING PRINCIPLE:
The STM32-based medical pulse oximeter works by using the MAX30100 or MAX30102 sensor
to emit red and infrared light through a fingertip and measure the amount of light absorbed by the
blood. The sensor detects changes in light absorption caused by the pulsing arterial blood, and this
data is sent to the STM32 microcontroller. The microcontroller processes the signals using
algorithms to calculate the blood oxygen saturation (SpO₂) and pulse rate. These values are then
displayed in real-time on an OLED or LCD screen, allowing continuous, non-invasive monitoring
of a patient’s vital signs.
PROGRAM:
#include "main.h"
#include "i2c.h"
#include "oled.h"
#include "max30100.h" // MAX30100 sensor driver header
MAX30100_Data sensorData;
int main(void)
{
// HAL initialization
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_I2C1_Init(); // Initialize I2C peripheral
OLED_Init(); // Initialize OLED display
MAX30100_Init(&hi2c1); // Initialize MAX30100 sensor with I2C handle
OLED_Clear();
OLED_ShowString(0, 0, "Pulse Oximeter");
while (1)
{
// Read sensor data
if (MAX30100_Read(&sensorData) == HAL_OK)
{
// Display SpO2 value
OLED_SetCursor(0, 2);
OLED_ShowString(0, 2, "SpO2: ");
OLED_ShowNumber(50, 2, sensorData.SpO2, 3);
// Display Heart Rate value
OLED_SetCursor(0, 4);
OLED_ShowString(0, 4, "HR: ");
OLED_ShowNumber(30, 4, sensorData.HeartRate, 3);
}
else
{
OLED_ShowString(0, 2, "Sensor Error");
}
HAL_Delay(1000); // Wait for 1 second before next reading
}
}
OUTPUT:
RESULT:
The STM32-based medical pulse oximeter successfully measures and displays real-time blood
oxygen saturation (SpO₂) and heart rate using the MAX30100 sensor. The system accurately
processes sensor data and shows the readings on the OLED display, demonstrating reliable
performance suitable for portable health monitoring applications