The DFRobot Gravity: MAX30102 (SKU: SEN0518) is a compact optical heart rate and SpO2 sensor module designed for non-invasive measurement of blood oxygen levels and heart rate. It utilizes photoplethysmography (PPG) technology to detect changes in blood volume and oxygen saturation. The module communicates via the I2C protocol, making it easy to integrate with microcontrollers such as Arduino, Raspberry Pi, and other development platforms.
The following table outlines the key technical details of the DFRobot Gravity: MAX30102 module:
Parameter | Specification |
---|---|
Operating Voltage | 3.3V to 5V |
Communication Interface | I2C |
I2C Address | 0x57 (default) |
Operating Current | 5mA (typical) |
Measurement Parameters | Heart rate, SpO2 (blood oxygen level) |
Sensor Type | Optical (PPG) |
Dimensions | 22mm x 22mm |
Weight | 3g |
The module has a 4-pin interface for easy connection to microcontrollers. The pinout is as follows:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.3V to 5V) |
2 | GND | Ground connection |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
VCC
pin to a 3.3V or 5V power source and the GND
pin to ground.SDA
and SCL
pins to the corresponding I2C pins on your microcontroller. For Arduino UNO, connect:SDA
to A4SCL
to A5SDA
and SCL
lines if not already included in your setup.Below is an example Arduino sketch to read heart rate and SpO2 data from the MAX30102:
#include <Wire.h>
#include "DFRobot_MAX30102.h"
// Create an instance of the MAX30102 sensor
DFRobot_MAX30102 max30102;
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
// Initialize the MAX30102 sensor
if (!max30102.begin()) {
Serial.println("MAX30102 initialization failed!");
while (1); // Halt execution if initialization fails
}
Serial.println("MAX30102 initialized successfully.");
}
void loop() {
// Variables to store heart rate and SpO2 data
uint8_t heartRate;
uint8_t spo2;
// Read data from the sensor
if (max30102.read(&heartRate, &spo2)) {
Serial.print("Heart Rate: ");
Serial.print(heartRate);
Serial.print(" bpm, SpO2: ");
Serial.print(spo2);
Serial.println(" %");
} else {
Serial.println("Failed to read data from MAX30102.");
}
delay(1000); // Wait 1 second before the next reading
}
Sensor Not Detected
Inaccurate Readings
Library Errors During Compilation
No Data Output
Q1: Can the MAX30102 measure SpO2 and heart rate simultaneously?
Yes, the MAX30102 can measure both parameters simultaneously using its dual LED and photodetector system.
Q2: What is the maximum I2C communication speed supported?
The MAX30102 supports I2C communication speeds up to 400kHz.
Q3: Can this module be used with a 3.3V microcontroller?
Yes, the module is compatible with both 3.3V and 5V systems.
Q4: How can I improve measurement accuracy?
Ensure the sensor is in direct contact with the skin, minimize motion, and shield the sensor from ambient light.
This concludes the documentation for the DFRobot Gravity: MAX30102. For further assistance, refer to the official DFRobot documentation or community forums.