Home / Tutorials / Arduino Tutorial / How to Use the MAX30100 as Arduino Heart Rate Sensor

How to Use the MAX30100 as Arduino Heart Rate Sensor

The moment I got my hands on the MAX30100 breakout board, I was ready to create my own Arduino heart rate sensor. But building one wasn’t as easy as I thought.


[the_ad id=”3059″]

Having problems with this sensor module? Consider changing to the MAX30102, as it’s Arduino-ready in both hardware design and software library.

First, let me try to explain how the MAX30100 measures pulse rate. The device has two LEDs, one emitting a red light, another emitting infrared light. For pulse rate, only the infrared light is needed. Both the red light and infrared light is used to measure oxygen levels in the blood. More on that later.

MAX30100 Heart Rate Sensor

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. Ultimately, by knowing the time between the increase and decrease of oxygen-rich blood, the device calculates the pulse rate.

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 stored them in a buffer that can be read via I2C.

But again it’s not as simple as it sounds, there’s a lot of data filtering involved like how this awesome post shows.

The Simple MAX30100 Arduino Module

Now let’s create a heart rate monitor where the values are displayed through the serial port.

There are two widely available MAX30100 breakout boards in the market. If you have the GY-MAX30100 board:

Image result for max30100 purple

Then lucky you! This board is ready for use with an Arduino. Just follow this wiring setup:

Purple MAX30100 Module Arduino UNO/Nano

Just follow this wiring setup and use Raivis Strogonovs MAX30100 library. The library is quite easy to use; here’s an example sketch:

Here the heart pulse rate is displayed through the serial monitor. If you need to include the blood oxygen concentration, you only need to add this line:

The Painful MAX30100 Arduino Module

[the_ad id=”3059″]

Now if you have the RCWL-0530:

MAX30100 Heart Rate Sensor

I’m afraid you have more work to do. This cheaper module has some serious design problems.

You see, this module uses this schematic:

max30100 schematic diagram

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. The Arduino can detect a minimum HIGH voltage of 2 V!

The solution is to remove the resistors from the board (encircled on the image below) and attach external 4.7k ohms resistors instead.

Arduino MAX30100 troubleshoot

Here’s my board with the resistors removed:

MAX30100 with resistors removed

After removing the resistors, you can now connect this module to the Arduino UNO using this wiring diagram:

Arduino MAX30100 wiring diagram

Here, the SCL, SDA and INT pull to 3.3V via the 4.7k ohms resistor. This ensures that the Arduino UNO can detect the HIGH logic level while not oversupplying the MAX30100.

Coding the RCWL-0530 with Arduino

For the sketch, I used this library. The library provides a couple of examples. This is the most basic sketch:

If you followed the wiring diagram and uploaded this sketch to your Arduino, the red LED on the board should light up and you will see this on the serial monitor:

Arduino MAX30100 output

This means the MAX30100 is running. All you need to do is place your finger on top of the IC (the one with the LED) and your pulse rate should be displayed.

[the_ad id=”3059″]

Now if the LED is not turning on, and you are getting the FAILED message on the serial monitor, it might be a power issue. If you look at line 58 of the sketch above:

This sets the current through the LED. This is originally commented so that the LED current is the default 50 mA. Comment this out to make the current through the LED equal to 7.6 mA! This would solve the power issue.

By the way, here are the other possible values you can use on the setIRLedCurrent() function above:

Just remember that the higher the current, the brighter the LED and the deeper it reaches your skin.

Sensor Update Speed

The library I am using is very peculiar when it comes to running this line of code:

This line updates the sensor readings and is placed inside the loop(). The author of the library emphasizes that the time between calling this function should be less than 10 ms. As it turns out, you can adjust the sampling frequency of the MAX30100 but in the library, that frequency is set to 100 Hz. Editing the sampling frequency requires the FIR coefficients of the filter used to process the data from the MAX30100.

In short, you can’t put a delay of more than 10 ms or do anything that takes that time inside loop() using this code.

This is why for the sketch above, we see this:

in reading the sensor values instead of the usual delay() routine. The millis() function continues to run on the background and doesn’t block the code execution.

Using an LCD with MAX30100

Because of the timing issues, a problem arises now when using other devices with the MAX30100.  Make sure that the pox.update() is executed not less than 100 ms.

In my next example project, I use an I2C LCD with the sensor. Here’s the wiring diagram:

arduino max30100 with LCD

Here’s my Arduino Heart Rate Sensor in action:

[the_ad id=”3059″]

Here is the sketch for the setup above:

No delay() is inside loop() and display is only updated every second hence the pox.update() is executed as fast as possible.

Buy a Touchscreen LCD for your DIY Heart Rate Sensor:


Check Also

MAX30102 black board

MAX30102: An Improved Heart Rate Sensor for Arduino

Have you read the MAX30100 tutorial and are still having trouble making that chip work? …


  1. hey, I’m following your instruction, but my max30100 my sensor doesn’t work… can you help me?

  2. Hey, We followed your Instructions and set up the ckt and code but the IRD and RED doesn’t glows , what to do?

  3. can i change the analog pin setup for SCL & SDA pin from MAX30100 SENSOR MODULE?

  4. Hi ,
    The display time of my data is quite slow for a few minutes to get results . I don’t know reason why ? . Can you help me ? ,pls . Thank you.

  5. Thank You so much, your team drive the future.

  6. I did the program in serial monitor its running well.
    I want to know the model no of the 0x27 lcd module so that i can bye it and write the programme in the lcd display.

  7. I was able to modify the breakout board without removing the 4k7 resisters. I did this by breaking the copper track to the 4k7 resisters from the 65K5 and then soldering a link wire to the Vin https://drive.google.com/file/d/12tPpwvfE68EkkASAOVA_JuhV3W7JAx4_/view?usp=sharing
    This allowed me to find I2C using I2C scanner and it now operates using either 5v or 3.3v

  8. I used the other way to modify this module. I did not remove resistors, but broke through the connection from U3 output to R1,R2,R3 and
    connected this line to U2 pin 1 (i.e. to U3 input) and now this module working correctly.

    • How did You do for broke the connection from U3… please ?, the module is so tiny for doing this . Thank you.

  9. Hello, thank you for your tutorial. Everything worked for me except the last part of wiring LCD with MAX30100.
    May I know how much power is connected to the LCD? And hopefully you can share the wiring of the LCD – Arduino.
    I am using Arduino UNO. Power supply connected to laptop.
    My connections are as below:

    Vin > 5V
    GND > GND
    SCL > A5
    SDA > A4

    MAX30100 (RCWL-0530)
    Vin > 3.3V
    GND > GND
    SCL > SCL (4.7 kOhm parallel pullup)
    SDA > SDA (4.7 kOhm parallel pullup)

    For the basic MAX30100 sketch, the sensor is able to detect and display values.
    However for the MAX30100 and LCD sketch, the LCD displays 0 for sensor values. I tried loading it to print sensor values on serial monitor, but there was no beat detected and sensor values keep updating as 0.

    Seems like the MAX30100 could not pick up any values while the LCD and MAX30100 sketch is loaded into the Arduino board.

    I really need help on this. Sincerely hoping for your reply. Thank you.

  10. Do you happen to know why i am getting following error?
    exit status 1
    could not convert ‘sensor.MAX30100::begin()’ from ‘void’ to ‘bool’

  11. Hello
    I want to integrate MAX30100 sensor with DS18B20 sensor

    but When I execute it, The DS18B20 sensor works well, but The value of MAX30100 sensor is continuously “0” (both Heart rate and SPO2). and MAX30100 gets hot..
    If you can could you help me?
    I really need your help
    thank you

  12. Please is there any way I can get the proteus library files for MAX30100?
    Please send me, I want it for may thesis…ylw12jnbr@gmail.com

  13. Great help to start with the max30100.
    I found my way to watch with Serial.print + LCD.
    Modify the main loop:

    void loop()
    if (millis() – tsLastReport > REPORTING_PERIOD_MS) {
    float hr = pox.getHeartRate();
    float spo2 = pox.getSpO2();
    lcd.print(“HR: “);
    lcd.print(” bpm”);
    lcd.print(“SpO2: “);
    Serial.print(“Heart rate:”);
    Serial.print(“bpm / SpO2:”);
    tsLastReport = millis();

  14. can i run it on 9600 baud rate?

  15. can use this code in arduino mega?

  16. Hey It is working. I removed the smd resistors and placed external 4.7k ohm resistor and it worked.If it works red led will start glowing constantly in the max30100 sensor.

  17. Hi! I followed all the steps, however when it displays on the LCD, and I put my finger on the sensor, nothing changes.

    Do you think my MAX30100 is defective, there is something wrong with the wirings or did I forget something in the codes?

  18. Thanks a lot for this post! Especially with the RCWL sensor. Kudos for the great job.

  19. Hello thanks for making this post. I try it wit GY-MAX30100 but my code didn’t work. The error say that ‘pulseoxymeter_t was not declared in this scope’. How could I repair it? I just copy your code. Thank you.

  20. we have removed the 3 inbuilt resistors from the max30100 sensor still in the code it is showing-“Ínitializing pulse oximeter..Failed”. what would you suggest?

  21. NIce dude !! You help me,, Thx !
    But, i wanna know, how this MAX30100 (greenboard) read its ADC Value ?
    I just want to implemented for detecting glucose of blood, any ideas dude ?

  22. Thanks for your post! My green board and I2C LCD work well!

  23. ¿This code run to MAX30102?

  24. Hello, i have two problems with the code, the first ist “‘Wire’ was not declared in this scop”
    After inclued the wire.h arduino show me “‘pulseoxymeter_t’ was not declared in this scope”

  25. Hi,How to improve the results of MAX30100 because it give result non logical and does’n give a stable result
    Please help

Leave a Reply

Your email address will not be published.