Skip to content

Measure Heart pulses/BPM And Oxygen saturation SpO² with MAX30102 and Arduino


       Hello, and welcome to this tutorial where I’m testing another module to measure BPM, after the 1$ module test, here we are with another one it’s the MAX30102, I’ll use it to measure my BPM an Pulse oximetry with the help of an Arduino UNO board, and also using an OLED display + Buzzer for a little BPM related project.

      The MAX30102 is an integrated pulse oximetry and heart-rate monitor biosensor module. It includes internal LEDs, photodetectors, optical elements also i²c compatible and with the help of the Sparkfun library it will be easy to measure these parameters, and don’t forget that the module has a built-in temperature sensor and it’s actually very accurate and stable but it’s not meant to measure body temperature.

       You can find it in different shapes but the important is the chip used, (I’m using the black one, WAVGAT):



For this tutorial, I used the module alone with the Arduino to test its functions, and for the project I add an OLED and a buzzer.


This slideshow requires JavaScript.


        The MAX30102 Can use the i²c so wired it with the Arduino board using that interface and as usual A4/A5 with SDA/SCL same with OLED, the first is powered by 5v and the second by 3.3v, the buzzer is also using 5v/GND and it’s I/O wired with D3, if you’re using 2 pins buzzer: GND with GND and (+) (don’t forget a resistor) with D3.

Wiring of MAX30102 + OLED + Buzzer with Arduino UNO



The codes I’ve used are from the library Examples, for the code I’ve made that works with the OLED and Buzzer, it’s a modified version of “HeartRate” code.

Download the code here.


After wiring the components, upload the code.

It asks you to place your finger

Put your finger on the sensor, relax for a while until you hear the buzzer is synchronized with your heart beats, or you see that the heart pictures change following your heart beats.

And the measure should be okay

Making a BPM picture:

Both hearts are BPM pictures and in the code you’ll see them as this format:

BPM pictures stored on the Arduino Flash memory

To make them you can follow Adafruit tutorial or continue here:

First thing to do is to make a 2 colors picture (Black with White background is better) and don’t forget to scale it (my OLED is 128×32 px) some are (128×64) so you should stay at this limits.

Pics hearts
From PNG to Monochrome BMP

For the project I took two different heart pictures, scale them and most important !!

They must be “Monochrome Bitmap” you can save them as this format from you picture editing software or just “MS Paint”

paint pic.png
Pics format

Once you have the picture scaled and in the right format open the LCD Assistant (Download and unzip)

Open the LCD Assistant
Load your picture
Note the Width and Height
Save Output and give it a name and path
Open with notepad
Here you have your picture


And to call it in the code, here’s how in my code

display.drawBitmap(5, 5, logo2_bmp, 24, 21, WHITE);


display.drawBitmap(Starting x pixel, Starting y pixel, pic name, pic width, pic height, color);

And here you go make what you want.

I hope it works for and don’t forget to subscribe to the YouTube channel for more content.

Yassine View All

Automation and Electrical Engineer, Electronics amateur trying to share my little projects.

3 thoughts on “Measure Heart pulses/BPM And Oxygen saturation SpO² with MAX30102 and Arduino Leave a comment

  1. hello, I am recently working with nodemcu and max30102 and I had a problem. red light in max30102 won’t turn on. I’ve checked all the power things and I am sure nothing was wrong. the red light will turn on if I connect ird or rd pin to the ground. and also the program was stuck on initializing. I tried to change to Arduino Uno and it’s all same.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: