Hi, in this tutorial we gonna interface MAX30102: pulse oximetry and heart rate monitor module with Arduino UNO board, and then make a project for measuring BPM using this module + OLED display and a Buzzer.
BPM are the "beats per minute" and they are around 65-75 while resting for a normal person, athletics may have lower than that, and the SpO2 is the Oxygen saturation level, and for a normal person it's above 95%.
The MAX30102 can be found in different modules, I have a WAVGAT version, it's not a problem as long as the IC is MAX30102.Components
Here are the things I'm gonna use
The codes I used in the tutorial are pretty clear and they are just examples from the Sparkfun_MAX3010x library.
For the code I made for the OLED and Buzzer, it's a modified version of the "HeartRate" example, it asks you to put your finger on the sensor.
Once you put your finger, remain calm for a while, until you start hearing the Buzzer's "Beeps" synchronized with your heart beats or the OLED animation is synchronized with it, and then you can read a correct BPM.
N.B: In the code I actually print the Average BPM, since it do the average of 4 BPMs it's more accurate just give it some time.
The heart (small) you see is a bitmap picture, and everytime the sensor detects a heart beat we switch to another heart (big) bitmap picture for a while and it gives the impression of a heart beats alongside with a beep from the buzzer.
Here are the two bitmaps in the code that we call later on the code
To make these, Look for a picture (black with white background) for wathever you want to see in the screen just don't forget about the size, the one I'm using is 128x32 px and the pictures are smaller than that (32x32 px) and (24x21 px)
Download LCD Assistant and open it (few steps below)
And here are your "numbers"
And here's how I called it in the code
display.drawBitmap(5, 5, logo2_bmp, 24, 21, WHITE);
display.drawBitmap(Starting x pos, Starting y pos, Bitmap name, Width, Height, Color);
And as you can see in the code one is called when a finger is detected and the other one if a heart beat is detected.
And here you go make what you want.