Microcontroller Tutorials

Arduino, Raspberry Pi, PIC, Beaglebone Resources

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.


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. 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 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

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:

Image result for rcwl-9183

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 solution is to remove the resistors from the board (encircled on the image below) and attach external 4.7k ohms resistors instead.

Remove these resistors from the MAX30100 module

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

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:

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.

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.

Actual Setup

Here's my setup where I used an I2C LCD to display the beats/minute and SP02 levels. However, a lot of power is required for this setup so I had to use an external power supply:

Here's my Arduino Heart Rate Sensor in action:

Here is the sketch for the setup above:

Buy a Touchscreen LCD for your DIY Heart Rate Sensor:


23 thoughts on “How to Use the MAX30100 as Arduino Heart Rate Sensor

  1. 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.

  2. 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.

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

  3. 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.

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

  5. 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

  6. 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();

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.