MAX30102 Heart Rate Module Features
MAX30102 sensor is used to detect blood oxygen and heart rate. First, infrared radiation is sent and reflected by hitting the finger, and then the amount of oxygen in the blood is determined by measuring the wave amplitude. Heart rate is also obtained by analyzing the time series response of this radiation.
The MAX30102 is an integrated module compatible with the Arduino and STM32. It integrates a red LED with an infrared LED, a photoelectric detector, an optical device, and a low noise electronic circuit for ambient light suppression. Heart rate and blood oxygen data are also transmitted to the Arduino or other microcontrollers via I2C communication.
You can download the datasheet of this module here.
MAX30102 Heart Rate Module Pinout
This sensor has 8 pins. 4 pins are more useful:
- VCC: Module power supply – 3 to 5 V
- GND: Ground
- SCL: I2C clock bus
- SDA: I2C data bus
You can see pinout of this module in the image below.
Interfacing MAX30102 Sensor with Arduino
Step 1: Circuit
The following circuit shows how you should connect Arduino to MAX30102 module. Connect wires accordingly.
You can use a bread board and pin header to connect module to interface wires, or you can solder pin header to module.
Step 2: Installing Library
Go to Library manager and search Max30, then install SparkFun Max301x.
Step 3: Code for Heart Rate Detection
Upload the following code to your Arduino. This code displays your heart rate graphically in the serial monitor.
/* MAX30102- Heart Rate Pulse Detection-Module
In the first part, you have to add related library to program. Next, in the setup loop, the data transfer rate is 115,200. You should set this number in the Serial plotter as well. Sampling is done at a 400 kHz frequency.
Finally, the results appear in the Serial Plotter as follows. As you can see the heart rate fluctuates:
Step 4: Code for Blood Oxygen detection
Upload the following code to your Arduino. This code displays your blood oxygen in the serial monitor.
/* MAX30102- Blood Oxyge -Module
In this code, adding the library as well as adjusting the speed and data transfer rate is done. Notice that the calculation of blood oxygen begins after pressing a desired button.
The results are as follows. As you can see blood oxygen has measured 96.