Interfacing MAX30100 Pulse Oximeter Sensor with Arduino
In this project we will be Interfacing MAX30100 Pulse Oximeter Sensor with Arduino. The MAX30100 Sensor is capable of measuring Blood Oxygen & Heart Rate. We can use any display like a 16×2 LCD Display to view the value of SpO2 and BPM. The blood Oxygen Concentration termed SpO2 is measured in Percentage and Heart Beat/Pulse Rate is measured in BPM.
The MAX30100 is a Pulse Oximetry and heart rate monitor sensor solution. It combines two LEDs, a photodetector, optimized optics, and low-noise analog signal processing to detect pulse oximetry and heart-rate signals. You can use this sensor with any microcontroller like Arduino, ESP8266, or ESP32 and easily measure the patient’s health parameters. This cheap DIY Pulse Oximeter sensor just cost around 5$ and can be used in multiple applications if you are a beginner or an Electronics enthusiast.
You can go through some of the projects made using this sensor:
1. Blood Oxygen & Heart Rate Measurement on OLED Display
2. IoT Pulse Oximeter using Blynk & ESP8266
3. Measure SpO2 & BPM on Blynk using ESP32
4. MAX30102 & Arduino: Heart Rate + Blood Oxygen Monitoring
5. IoT Based Patient Health Monitoring System
Bill of Materials
Following are the components that you need for Interfacing MAX30100 Pulse Oximeter Sensor with Arduino. You can purchase all the components online from Amazon. The components name as well as purchased link is given below.
| S.N. | Components | Quantity | |
|---|---|---|---|
| 1 | Arduino UNO Board | 1 | Amazon | AliExpress |
| 2 | MAX30100 Pulse Oximeter Sensor | 1 | Amazon | AliExpress |
| 4 | 16x2 LCD Display | 1 | Amazon | AliExpress |
| 5 | Potentiometer 10K | 1 | Amazon | AliExpress |
| 6 | Connecting Wires | 10 | Amazon | AliExpress |
| 7 | Breadboard | 1 | Amazon | AliExpress |
How does Pulse Oximeter Works?
Oxygen enters the lungs and then is passed on into blood. The blood carries oxygen to the various organs in our body. The main way oxygen is carried in our blood is by means of hemoglobin. During a pulse oximetry reading, a small clamp-like device is placed on a finger, earlobe, or toe.
Small beams of light pass through the blood in the finger, measuring the amount of oxygen. It does this by measuring changes in light absorption in oxygenated or deoxygenated blood.
MAX30100 Pulse Oximeter
The sensor is integrated pulse oximetry and heart-rate monitor sensor solution. It combines two LED’s, a photodetector, optimized optics, and low-noise analog signal processing to detect pulse and heart-rate signals. It operates from 1.8V and 3.3V power supplies and can be powered down through software with negligible standby current, permitting the power supply to remain connected at all times.
Features
1. Consumes very low power (operates from 1.8V and 3.3V)
2. Ultra-Low Shutdown Current (0.7µA, typ)
3. Fast Data Output Capability
4. Interface Type: I2C
Working of MAX30100 Pulse Oximeter and Heart-Rate Sensor
The device has two LEDs, one emitting red light, another emitting infrared light. For pulse rate, only infrared light is needed. Both red light and infrared light are used to measure oxygen levels in the blood.
When the heart pumps blood, there is an increase in oxygenated blood as a result of having more blood. As the heart relaxes, the volume of oxygenated blood also decreases. By knowing the time between the increase and decrease of oxygenated blood, the pulse rate is determined.
It turns out, oxygenated blood absorbs more infrared light and passes more red light while deoxygenated blood absorbs red light and passes more infrared light. This is the main function of the MAX30100: it reads the absorption levels for both light sources and stores them in a buffer that can be read via I2C communication protocol.
Interfacing MAX30100 Pulse Oximeter Sensor with Arduino
Now let us interface MAX30100 Pulse Oximeter Sensor with Arduino and display the value in serial monitor.The circuit diagram and connection is very simple. You can follow the same.
Connect the Vin pin of MAX30100 to Arduino 5V or 3.3V pin, GND to GND. Connect the I2C Pin of MAX30100, i.e SCL & SDA to A5 & A4 of Arduino.
Source Code/Program
The source Code/program for interfacing MAX30100 Pulse Oximeter with Arduino is written in C programm for Arduino IDE. This code will display the value in serial monitor. Copy this code and upload it to Arduino Board.
But before that downloaded the MAX30100 Library from here:
Arduino MAX30100 Library
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#include <Wire.h> #include "MAX30100_PulseOximeter.h" #define REPORTING_PERIOD_MS 1000 PulseOximeter pox; uint32_t tsLastReport = 0; void onBeatDetected() { Serial.println("Beat!"); } void setup() { Serial.begin(115200); Serial.print("Initializing pulse oximeter.."); // Initialize the PulseOximeter instance // Failures are generally due to an improper I2C wiring, missing power supply // or wrong target chip if (!pox.begin()) { Serial.println("FAILED"); for(;;); } else { Serial.println("SUCCESS"); } pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA); // Register a callback for the beat detection pox.setOnBeatDetectedCallback(onBeatDetected); } void loop() { // Make sure to call update as fast as possible 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(); } } |
After uploading the code, open the serial monitor to see the values as shown in the image. Initially the the BPM & SpO2 value appears as incorrect value but soon you can observe the correct stable reading.
Displaying MAX30100 SpO2 & BPM Value on LCD Display
Now let us use the 16X2 LCD Display to see the value of BPM & SpO2 instead of Serial Monitor. Assemble the circuit as per the circuit diagram below.
Connect the Vin pin of MAX30100 to Arduino 5V or 3.3V pin, GND to GND. Connect the I2C Pin, SCL & SDA of MAX30100 to A5 & A4 of Arduino. Similarly connect the LCD pin 1, 5, 16 to GND of Arduino and 2, 15 to 5V VCC. Similarly connect LCD pin 4, 6, 11, 12, 13, 14 to Arduino pin 13, 12, 11, 10, 9, 8. Use 10K Potentiometer at pin 3 of LCD to adjust the contrast of LCD.
Source Code/Program
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
#include <LiquidCrystal.h> #include <Wire.h> #include "MAX30100_PulseOximeter.h" LiquidCrystal lcd(13, 12, 11, 10, 9, 8); #define REPORTING_PERIOD_MS 1000 PulseOximeter pox; uint32_t tsLastReport = 0; void onBeatDetected() { Serial.println("Beat!"); } void setup() { Serial.begin(115200); Serial.print("Initializing pulse oximeter.."); lcd.begin(16,2); lcd.print("Initializing..."); delay(3000); lcd.clear(); // Initialize the PulseOximeter instance // Failures are generally due to an improper I2C wiring, missing power supply // or wrong target chip if (!pox.begin()) { Serial.println("FAILED"); for(;;); } else { Serial.println("SUCCESS"); } pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA); // Register a callback for the beat detection pox.setOnBeatDetectedCallback(onBeatDetected); } void loop() { // Make sure to call update as fast as possible 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("%"); lcd.clear(); lcd.setCursor(0,0); lcd.print("BPM : "); lcd.print(pox.getHeartRate()); lcd.setCursor(0,1); lcd.print("SpO2: "); lcd.print(pox.getSpO2()); lcd.print("%"); tsLastReport = millis(); } } |
After uploading the code, you can put the finger on MAX30100 Sensor and LCD will start displaying the Oxygen percentage and BPM Value.
MAX30100 Not Working Troubleshooting
If you purchased the MAX30100 Module shown below, then it might not work as it has a serious design problem. The MAX30100 IC uses 1.8V for VDD and this particular module uses two regulators to achieve this voltage.
Nothing wrong with that. However, if you look closely, the SCL and SDA pins are pulled up via the 4.7k ohm resistors to 1.8V! This means it won’t work well with microcontrollers with higher logic levels.
There are two methods to fix this issue and make MAX30100 WORK.
1st Method
The solution is to remove the resistors from the board (encircled on the image below) and attach external 4.7k ohms resistors to SDA, SCL and INT Pin instead.
After removing all 4.7K Resistors, connect the INT, SDA, SCL pin to the external 4.7K Pull-up resistor.
2nd Method
In case if don’t like the first one, you can use the second method to fix this issue. It is enough to cut the path in the place of the red cross and make a jumper as shown by the yellow line. The jumper does not need an insulated wire. You can take a tinned strand from the stranded wire. The board is covered with a protective mask and there is no short circuit to the copper pour.
Video Demonstration & Explanation
A better upgraded version of MAX30100 is MAX30102 Pulse Oximeter Sensor which has all the design upgradation.



















54 Comments
i did just like this tutorial and other that removes de resistors (talkingabout the green board) and replace then for 4.7k resistors and in my serial it said that it failed, this means that is broken or burned?
I did just like this tutorial and some others that removes de resistors (talking about the green board) and replace then for 4.7k but in my serial it says that it failed, this means that is broken or burned?
how to get the value of bpm as a whole number?(without decimals)
Use int function in code instead of float.
hi I want to ask if MAX30100 needs to be soldered with the socket? I’ve tried using a socket and MAX30100 wasn’t detected. Or it has to be done with the methods below? Sorry if imy english is bad and tbh i’m a beginner
Try any of the methods mentioned above. For me method 2 worked.
You don’t need any socket, just use a thin wire.
Hi when I combine this code with other sensors code in one program it does not work it does not take values from the figures it give 0 value for Heart rate and SpO2 what is the problem? plz tell me .
I followed the first method where we need to remove three internal resistor and connect it to 3 external ones but it is still showing Initializing Pulse Oximeter ….Failed, what would you suggest?
I haven’t tried the 1st method as 2nd method was more easier to me. In my case 2nd method worked.
can you help me method 2 too seems not working for me this sensor alone stopping me from moving to next phase of my project?
Hi Mokesh, both of these methods works.
I tried method 2nd which worked for me.
same here. this code is not working when i combine with gsm800L. Heart rate and SpO2 values are zero. Please tell me how to solve this problem
Even I tried the same with SIM900 & Thingspeak Server and I got the same result as 0 and 0 Value. So I dropped an idea and used blynk application to get the result. You can check this:
https://how2electronics.com/max30100-pulse-oximeter-with-esp8266/
This might help you.
Where are the source codes for the original project? Please help
Check the link at the beginning of the article or at the bottom of youtube video description.
Sir Bluetooth se bp check Karne ke liye kaon sa application download karen
Hi,
What if i want to make it work with Mega 2560?
Hi. Great demonstration. How are A4 and A5 specified? I would like to use different I/O pins. Thanks
You can’t use different pins. A4 & A5 are I2C pins which are fixed and need to be connected to SDA & SCL Pins of Sensor.
Thank you for the quick and concise answer.
Hi Mr.Alam. Again, thank you for your answer. I have another general question. I’ve looked for a definition of the functions specified in an Arduino library. Where do I find them? Thanks.
Sir i tried the second method but the sensor led is still not glowing and i have not soldered the sensor to the socket so is that the reason? i am afraid that i might have cut deep into the board is the sensor damaged
Hi, there is no need to cut deep. A simple cut is enough to disconnect the track. Also, don’t forget to solder a thin wire as shown in figure.
In 2nd method, can we cut using a paper cutter?
Thank you for this project. It is very concise and complete.
I had purchased the module requiring the one of the two modifications.
First attempted Method 2 (jumper wire), but while attempting to solder the wire to surface mount resistor i inadvertently unsoldered the resistor.
Given my soldering talents i then switched to Method 1 (removing resistors). For me that turned out to be way easier then method 2. And best of all it worked!!
I read in other comments that the author had not tested method 1. It looks like i have now done so by accident and can say that it works very well.
hi, i am working with this board, try modifying using the second method. the problem persists, I still have no communication from i2c.
Measuring with the tester I see that modifying in this way I put 5V.
Do you have any idea if there could be one more problem? I also notice that the led turns on but with little light.
thanks,
greetings from Argentina
Can you show the breadboard diagram
2nd method worked fine! thanks
Yes, I made a cut using paper cutter. And soldered a thin jumper. Working fine.
i made a cut using both paper cutter and geometrical compass which is often found in instrument boxes
Sir can u please give information what exact type of output given max30100 to Arduino and how Arduino process on it and passed to led, plz sir
Sir plz u give me more information what is type of sensor output (type of signal) and how Arduino process it
Bro can u plz send cricuit diagram of ur connection
On [email protected] or [email protected] or [email protected]
Bro can u shere u r circuit diagram connection with max30100 at [email protected] or [email protected]
Please help me
Hi,How to improve the results of MAX30100 because it give result non logical and does’n give a stable result
Please help me
Hi,How to improve the results of MAX30100 because it give result non logical and does’n give a stable result
Please help
Hi, kindly tell me regarding your circuit diagram because after serial monitor I have got this one on the screen ” Initializing pulse oximeter..FAIInitializing pulse oximeter..FAILED “. And the sensor LED is also not blinking.
Hi, I applied both the methods on my circuit but got this on the screen “Initializing pulse oximeter..FAIInitializing pulse oximeter..FAILED”. Kindly someone help me & if possible share your circuit diagram with me. Thanks
first i connect max30100 with arudino.it shows failed.after that i worked with method 2.i get success but output value for heart rate and spo2 is 0.
cant we use level shifters from Arduino to sensors and back to avoid modifying the sensor module
Yes this might work
Nice project.
I want to activate an audio visual alarm or LED when the SpO2 level drops 90%.
Please provide the modified code.
Thanks and best regards,
Hi there,
i did all wiring and coding but lcd is not showing anything only serial monitor showing results. i have used 3 lcd’s but nothing is showing.
Nice and informative tutorials.
Which software was used to design the circuit? Any library for max30100 design?
You can modify the code to achieve that. How exactly do you want to use as alarm?
How can I use this with the max30102 please?
Im using MAX30102 sensor and in source code pulse oximeter.h is showing error plz give solition i also installed and added header file.
can you help me Please, I need the max 30102 sensitive library for a proteus program.
Max30102 I2C has voltage levels at: Lv = 0-0.6 and Hv = 1.4-1.8, according to the data sheet:
https://www.alldatasheet.com/view.jsp?Searchword=Max30102
We just have to put a logical level converter, such as:
https://www.sparkfun.com/products/12009
Between the max30102 SCL and SDA pins (logic level 1.8v) and the arduino (5v) pins.
To get a reference for the logic converter at 1.8v we can use a voltage divider from the arduino Vcc=5v with a 1kohm and 560 ohm resistors.
I tried this with an arduino uno.
Hi Can I use this sensor to detect hemoglobin level
How to interface MAX30100 with 8051?
thank you sir! I have some problem while working with MAX30100 heartbeat and MLX temperature sensor. I am using Arduinonano33 IoT and they work together in the absence of wifinina library. but, since I want to send them to data center through MQTT I Must do it through wifi. now when I include wifinina library, only temperature value will be sent and heart beat read is always 0.00. Please help me sir!
我修改此項目代碼,已成功,影片:
I modified the code of this project and it was successful, the video: