Hello guys. Welcome back to Techatronic. This project aims to interface an Arduino board with a pulse oxygen sensor MAX30102 in order to measure heart rate (BPM) and blood oxygen concentration (SP02). The blood oxygen monitoring with Arduino and pulse rate readings will be shown on a 0.96′′ OLED display.
Pulse oximetry and heart-rate monitoring are combined in the MAX30102, a PPG-based biosensor module (PhotoPlethysmoGraphy). The MAX30102 pulse Oximeter Sensor can be integrated with any microcontroller, including Arduino, ESP8266, ESP32, STM32, or Raspberry Pi Pico, via the I2C communication protocol.
An average person at rest typically has a heart rate of 65 to 75 beats per minute, or BPM. Athletes may have BPMs that are lower than this range. A healthy individual has an oxygen saturation level, or SpO2, of greater than 95%.
Table of Contents
Components Required
- Arduino UNO Board
- MAX30102 Pulse Oximeter
- 0.96″ SSD1306 I2C OLED Display
- Push Button Switch
- Jumper Wires
- Breadboard
MAX30102 Pulse Oximeter Sensor
An integrated pulse oximetry and heart-rate monitor module is called the MAX30102.This gadget can measure blood oxygen concentration in addition to heart rate. The manufacturer of this sensor is Analog Devices. The module is offered in a range of board configurations created by distinct producers. Click here.
Internal LEDs, optical components, photodetectors, low-noise electronics, and ambient light rejection are all included. In order to facilitate the design-in process for mobile and wearable devices, the MAX30102 offers a comprehensive system solution.
SpO2 Subsystem
A proprietary discrete time filter, a continuous-time sigma-delta ADC, and an ambient light cancellation (ALC) is available in the SpO2 subsystem of the MAX30102. The ALC cancels ambient light and increases the effective dynamic range with the help of internal Track/Hold circuit. The ALC can cancel up to 200 micro Ampere of ambient current. We can program the ADC output data from 50sps (samples per second) to 3200sps.
Temperature Sensor
A temperature sensor is placed on the MAX30102 to calibrate the temperature dependence of the SpO2 subsystem. The SpO2 algorithm used with MAX30102 output signal compensate for the SpO2 error with changes in ambient temperature.
LED Driver
The LED pulses for SpO2 and HR measurements are modulated by integrated Red and IR LED drivers. With proper supply voltage the LED current can be programmed from 0 to 50mA. Based on use cases, we can optimize the SpO2 and HR accuracy and power consumption by programming the LED pulse width from 69 micro seconds to 411 micro seconds.
Technical Specifications
Maximum Current Consumption | 6mA |
Voltage | 3.3-5V |
Sample Rate | 50Hz – 3200Hz |
I2C Address | 0xAE (Read) & 0xAF (Write) |
Temperature Range | -40°C to +85°C |
Temperature Accuracy | ±1˚C |
ADC Resolution | 18 bits |
IR LED peak wavelength | 880nm |
Red LED peak wavelength | 660nm |
MAX30102 Module Pinouts
Pin | Description |
---|---|
VIN | This sensor is powered on at 3.3-5V. |
SCL | I2C serial clock pin. |
SDA | I2C serial data pin. |
INT | This is the active low interrupt pin. It is pulled HIGH by the onboard resistor but when an interrupt occurs it goes LOW until the interrupt clears. |
IRD | IR LED Cathode and LED Driver Connection Point |
RD | Red LED Cathode and LED Driver Connection Point |
GND | Ground Pin |
Connections of Blood Oxygen Monitoring with Arduino
Lets see the connections of the MAX30102 Module with the Arduino.
Connect Vin and GND pin of the MAX30102 to the 3.3V and GND of the Arduino. Now Connect the SCL & SDA pin of the MAX30102 to the A5 & A4 pin on the Arduino.
Code for Blood Oxygen Monitoring with Arduino
The MAX30102 Sensor has several libraries available for measuring temperature, blood oxygen level, and heart rate. The Sparkfun Electronics library is the most well-liked of all of these libraries.
Enter MAX3010x in the search bar to install the library. Search for the SparkFun MAX3010x Proximity and Pulse Sensor Library. To install the library, click the install button.
Let’s connect an Arduino Nano to an OLED display and a MAX30102 to create a portable pulse oximeter. The oxygen saturation and heart rate in real time will be shown on the OLED.
Source Code-
Let’s examine the portable pulse oximeter’s programming section. The code below uses an Arduino, an OLED display, and a MAX30102 sensor to measure and show blood oxygen saturation (SpO2) and heart rate. It has the ability to dynamically modify the display depending on sensor data, filter signal noise for more accurate readings, and switch to a low-power mode when the sensor is not in use. Additionally, the program allows for user interaction by utilizing an EEPROM to store user preferences and a button to switch between display modes.
Testing the Portable Pulse Oximeter Device
Then display the message, put your finger here.
It will begin measuring the oxygen saturation percentage and pulse rate in BPM as soon as you place your finger on it.
The average pulse and oxygen saturation will be shown on the OLED if you press the push button and place your finger on the MAX30102.
The device enters sleep mode and the OLED turns off in five seconds if there is no pressure applied to the MAX30102 Sensor. The countdown timer will also be shown on the OLED.
After pressing the push button once more, you can activate the OLED again. The gadget will come out of sleep mode as a result. Click here for more projects.