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 bands, medical 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
| Feature | Description |
|---|---|
| Heart Rate Range | 30 to 240 BPM |
| SpO₂ Range | 70 to 100% |
| LED Wavelengths | Red (660nm), IR (940nm) |
| Interface | I²C |
| Supply Voltage | 1.8V to 3.3V (VIN can tolerate 5V in some modules) |
| Built-in Algorithm | Pulse detection, SpO₂ calculation |
| Low Power | Ideal 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.
- A 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 Pin | Arduino/ESP32 Pin |
|---|---|
| VIN | 3.3V (or 5V with onboard regulator) |
| GND | GND |
| SDA | A4 (Arduino) / GPIO 21 (ESP32) |
| SCL | A5 (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();
}
}
Leave a Reply
You must be logged in to post a comment.