Module Specifications:
- Voltage: 3.3V - 5V
- Current: 6mA Max Consumption
- Sampling Rate: 50Hz - 3200Hz
- Resolution: 18-bit ADC
- Communication: I2C
- Arduino Compatible
Parameters:
- LED peak wavelength: 660nm / 880nm
- LED power supply voltage: 3.3~5V
- Detection Signal Type: Optical Reflection Signal (PPG)
- Output Signal Interface: I2C Interface
- Communication Interface Voltage: 1.8 ~ 5V
Interface:
- VIN: Main power input, 1.8V - 2.5V
- 3-bit pad: I2C bus pull-up level; selectable 1.8V or 3.3V based on master pin voltage
- SCL: I2C bus clock
- SDA: I2C bus data
- INT: MAX chip interrupt pin
- RD: MAX30102 chip’s RD LED grounding terminal (usually not connected)
- IRD: MAX30102 chip’s IR LED grounding terminal (usually not connected)
- GND: Ground wire
Read the MAX30102 Datasheet.
The MAX30102 sensor will be introduced and the red and infrared reflection data will be used to calculate parameters such as heart rate and oxygen saturation in the blood.
Arduino Code for MAX30102:
First, download the Sensor Arduino Library and add it to the Arduino IDE.
#include <Wire.h>
#include "MAX30105.h"
MAX30105 particleSensor; // initialize MAX30102 with I2C
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for serial port to open
delay(100);
Serial.println("");
Serial.println("MAX30102");
Serial.println("");
delay(100);
// Initialize sensor
if (particleSensor.begin(Wire, I2C_SPEED_FAST) == false) {
Serial.println("MAX30105 was not found. Please check wiring/power.");
while (1);
}
byte ledBrightness = 70; // Options: 0 = Off to 255 = 50mA
byte sampleAverage = 1; // Options: 1, 2, 4, 8, 16, 32
byte ledMode = 2; // Options: 1 = Red only, 2 = Red + IR, 3 = Red + IR + Green
int sampleRate = 400; // Options: 50, 100, 200, 400, 800, 1000, 1600, 3200
int pulseWidth = 69; // Options: 69, 118, 215, 411
int adcRange = 16384; // Options: 2048, 4096, 8192, 16384
particleSensor.setup(ledBrightness, sampleAverage, ledMode, sampleRate, pulseWidth, adcRange);
}
void loop() {
particleSensor.check(); // Check the sensor
while (particleSensor.available()) {
Serial.print(particleSensor.getFIFOIR()); // Read stored IR value
Serial.print(",");
Serial.println(particleSensor.getFIFORed()); // Read stored Red value
particleSensor.nextSample(); // Read next set of samples
}
}
Open the Serial Plotter in Arduino IDE tools and watch the output.
Module Specifications:
- Voltage: 3.3V - 5V
- Current: 6mA Max Consumption
- Sampling Rate: 50Hz - 3200Hz
- Resolution: 18-bit ADC
- Communication: I2C
- Arduino Compatible
Parameters:
- LED peak wavelength: 660nm / 880nm
- LED power supply voltage: 3.3~5V
- Detection Signal Type: Optical Reflection Signal (PPG)
- Output Signal Interface: I2C Interface
- Communication Interface Voltage: 1.8 ~ 5V
Interface:
- VIN: Main power input, 1.8V - 2.5V
- 3-bit pad: I2C bus pull-up level; selectable 1.8V or 3.3V based on master pin voltage
- SCL: I2C bus clock
- SDA: I2C bus data
- INT: MAX chip interrupt pin
- RD: MAX30102 chip’s RD LED grounding terminal (usually not connected)
- IRD: MAX30102 chip’s IR LED grounding terminal (usually not connected)
- GND: Ground wire
Read the MAX30102 Datasheet.
The MAX30102 sensor will be introduced and the red and infrared reflection data will be used to calculate parameters such as heart rate and oxygen saturation in the blood.
Arduino Code for MAX30102:
First, download the Sensor Arduino Library and add it to the Arduino IDE.
#include <Wire.h>
#include "MAX30105.h"
MAX30105 particleSensor; // initialize MAX30102 with I2C
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for serial port to open
delay(100);
Serial.println("");
Serial.println("MAX30102");
Serial.println("");
delay(100);
// Initialize sensor
if (particleSensor.begin(Wire, I2C_SPEED_FAST) == false) {
Serial.println("MAX30105 was not found. Please check wiring/power.");
while (1);
}
byte ledBrightness = 70; // Options: 0 = Off to 255 = 50mA
byte sampleAverage = 1; // Options: 1, 2, 4, 8, 16, 32
byte ledMode = 2; // Options: 1 = Red only, 2 = Red + IR, 3 = Red + IR + Green
int sampleRate = 400; // Options: 50, 100, 200, 400, 800, 1000, 1600, 3200
int pulseWidth = 69; // Options: 69, 118, 215, 411
int adcRange = 16384; // Options: 2048, 4096, 8192, 16384
particleSensor.setup(ledBrightness, sampleAverage, ledMode, sampleRate, pulseWidth, adcRange);
}
void loop() {
particleSensor.check(); // Check the sensor
while (particleSensor.available()) {
Serial.print(particleSensor.getFIFOIR()); // Read stored IR value
Serial.print(",");
Serial.println(particleSensor.getFIFORed()); // Read stored Red value
particleSensor.nextSample(); // Read next set of samples
}
}
Open the Serial Plotter in Arduino IDE tools and watch the output.