MAX30102 Sensor Raspberry Pi

Model Picture

1. Introduction

The MAX30102 is an advanced biomedical sensor capable of measuring heart rate (BPM) and blood oxygen saturation (SpO2). It works using infrared and red LEDs and is widely used in wearable and health monitoring devices with the Raspberry Pi.


2. Components

  • Raspberry Pi 4 Model B
  • MAX30102
  • Jumper wires
  • Breadboard (optional)

3. Circuit and Connections

Circuit Diagram
Circuit Diagram

MAX30102 Pinout Diagram
MAX30102 Pulse Oximeter & Heart Rate Sensor Pinout Diagram

I2C Connection Table

MAX30102 PinRaspberry Pi
VCC3.3V
GNDGND
SDAGPIO2 (Pin 3)
SCLGPIO3 (Pin 5)

👉 Default I2C Address: 0x57


4. Detailed Step By Step Circuit Working

  1. Sensor emits red and IR light into the skin
  2. Blood absorbs light differently based on oxygen level
  3. Reflected light is captured by photodiode
  4. Internal processing calculates pulse and SpO2
  5. Data is sent to Raspberry Pi via I2C

5. Libraries to be Included

sudo apt update
sudo apt install python3-smbus i2c-tools
pip3 install smbus2 max30102

Enable I2C:

sudo raspi-config

→ Interface Options → I2C → Enable


6. Code (Python)

import max30102
import hrcalc
import time

sensor = max30102.MAX30102()

while True:
red, ir = sensor.read_sequential()

hr, hr_valid, spo2, spo2_valid = hrcalc.calc_hr_and_spo2(ir, red)

if hr_valid:
print("Heart Rate:", int(hr), "BPM")

if spo2_valid:
print("SpO2:", int(spo2), "%")

print("----------------------")
time.sleep(1)

7. Detailed Step By Step Code Working

  • Initializes MAX30102 sensor
  • Reads red and IR values
  • Processes data using hrcalc
  • Calculates:
    • Heart Rate (BPM)
    • SpO2 (%)
  • Displays results continuously

8. Tips

  • Place finger gently on sensor
  • Avoid movement for accurate readings
  • Ensure proper contact with skin
  • Use stable power supply
  • Allow few seconds for stable values

9. Uses

  • Pulse oximeters
  • Fitness trackers
  • Health monitoring systems
  • Wearable devices
  • Medical IoT applications

10. Conclusion

The MAX30102 is a powerful sensor for health monitoring. With Raspberry Pi, it enables advanced biomedical and IoT applications.

à´¤ുà´Ÿà´•്à´•à´•്à´•ാർക്à´•ാà´¯ുà´³്à´³ ഇലക്à´Ÿ്à´°ോà´£ിà´•്à´¸് ലളിതമാà´¯ി പഠിà´•്à´•ാം.

Empowering students in Kerala with hands-on technical skills.