Back to Advanced Projects

❤️ Pulse Oximeter

Measure human vitals using a MAX30102 sensor and an OLED display.

📋 Overview

The MAX30102 uses red and infrared LEDs combined with a photodetector to measure the absorbance of pulsing blood. This technique is called photoplethysmography (PPG).

What you'll learn: Complex I2C sensor libraries, digital signal processing (DSP) for pulse detection, and driving I2C OLED displays.

Estimated time: 2-3 hours. Difficulty: ⭐⭐⭐ Intermediate.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Nano5V1
MAX30102 SensorI2C1Pulse Oximetry
0.96" OLED DisplayI2C (SSD1306)1
Jumper Wires1

📖 Step-by-Step Tutorial

1

I2C Bus Wiring

Connect both the OLED and MAX30102 to the I2C bus (SDA to A4, SCL to A5 on Arduino Nano). Give them VCC and GND.
2

Install Libraries

Install SparkFun MAX3010x library and Adafruit SSD1306 library.
3

Finger Placement

Place your finger lightly over the sensor. Too much pressure squeezes blood out; too little won't read.
4

Readings

The code calculates Beats Per Minute (BPM) by analyzing peaks in the infrared absorption data.
💡
I2C modules can share the exact same SDA and SCL wires as long as they have different I2C addresses (OLED is usually 0x3C, MAX is 0x57).

💻 Code / Configuration

heart_rate.ino
INO
// Pulse Oximeter (Conceptual snippet)
#include <Wire.h>
#include "MAX30105.h"
#include "heartRate.h"
#include <Adafruit_SSD1306.h>

MAX30105 particleSensor;
Adafruit_SSD1306 display(128, 64, &Wire, -1);

long lastBeat = 0;
float beatsPerMinute;

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  particleSensor.begin(Wire, I2C_SPEED_FAST);
  particleSensor.setup(); 
}

void loop() {
  long irValue = particleSensor.getIR();
  
  if (checkForBeat(irValue) == true) {
    long delta = millis() - lastBeat;
    lastBeat = millis();
    beatsPerMinute = 60 / (delta / 1000.0);

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0
...

Loading reviews...