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.
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.
- SparkFun MAX30102 library: Download here
- Adafruit OLED SSD1306 library: Download here
- Adafruit GFX Library: Download here
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.
After wiring the components, upload the code.
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.
Making a BPM picture:
Both hearts are BPM pictures and in the code you’ll see them as this format:
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.
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”
Once you have the picture scaled and in the right format open the LCD Assistant (Download and unzip)
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.
Automation and Electrical Engineer, Electronics amateur trying to share my little projects.