Back to Tutorial

ESP32 with MAX30100 HEART SENSOR

Heart Rate & SpO₂ Sensor (MAX30100/MAX30102)

🔬 Pulse Sensor | SpO₂ Monitor | Wearable Health Tech


The MAX30100/MAX30102 is a digital pulse oximeter and heart-rate sensor developed by Maxim Integrated. It’s commonly used in fitness bandsmedical devices, and IoT-based health monitoring systems. It combines two key measurements in one module: heart rate (BPM) and blood oxygen saturation (SpO₂ %).


🔧 Key Features

FeatureDescription
Heart Rate Range30 to 240 BPM
SpO₂ Range70 to 100%
LED WavelengthsRed (660nm), IR (940nm)
InterfaceI²C
Supply Voltage1.8V to 3.3V (VIN can tolerate 5V in some modules)
Built-in AlgorithmPulse detection, SpO₂ calculation
Low PowerIdeal for wearable and battery-powered devices
Package Size~5.6 x 3.3 x 1.6 mm

🧠 How It Works

1. Heart Rate Measurement

  • The infrared LED emits light into the finger or skin.
  • photodetector measures the reflection, which varies with each heartbeat due to blood flow changes.
  • The waveform is analyzed to detect pulse and compute beats per minute (BPM).

2. SpO₂ Measurement

  • Uses red and infrared light to measure the ratio of oxygenated to deoxygenated hemoglobin.
  • The light absorption difference gives an estimate of oxygen saturation in the blood.

🔌 Connections (I²C Mode)

MAX30100 PinArduino/ESP32 Pin
VIN3.3V (or 5V with onboard regulator)
GNDGND
SDAA4 (Arduino) / GPIO 21 (ESP32)
SCLA5 (Arduino) / GPIO 22 (ESP32)
INT (optional)Not connected or GPIO (for interrupts)

📦 Typical Applications

  • 🧠 Health and fitness trackers
  • 📟 Wearable health monitors
  • 🏥 Remote patient monitoring systems
  • 📱 Mobile health applications
  • 🧪 Biomedical IoT projects
  • 🚨 Emergency health alert systems

📌 Note: Place your finger gently and keep it still for accurate readings.


📌 Notes

  • Avoid bright ambient light or motion for stable readings.
  • Use a rubber band or clip to hold your finger steady.
  • Some modules need a small delay after pox.begin() to stabilize readings.
  • Suitable for wearable applications and long-term monitoring.

HOW TO OPERATE

#include <Wire.h>
#include "MAX30100_PulseOximeter.h"

#define REPORTING_PERIOD_MS 1000

PulseOximeter pox;
uint32_t tsLastReport = 0;

void onBeatDetected() {
Serial.println("❤️ Beat Detected!");
}

void setup() {
Serial.begin(115200);
Serial.println("Initializing MAX30100 sensor...");

if (!pox.begin()) {
Serial.println("MAX30100 not detected. Please check connections.");
while (1);
}

pox.setOnBeatDetectedCallback(onBeatDetected);
}

void loop() {
pox.update();

if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
Serial.print("Heart Rate: ");
Serial.print(pox.getHeartRate());
Serial.print(" BPM | SpO2: ");
Serial.print(pox.getSpO2());
Serial.println(" %");

tsLastReport = millis();
}
}

Share this post

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Tutorial