Accéder au contenu principal
Publicités

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):

 

Components:

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.

 

Ce diaporama nécessite JavaScript.

Wiring:

        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.png
Wiring of MAX30102 + OLED + Buzzer with Arduino UNO

Libraries:

Codes:

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.

Test:

After wiring the components, upload the code.

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

Test_2.jpg
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:

ImagesBPM
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)

LCDAssist1
Open the LCD Assistant
LCDAssist2
Load your picture
LCDAssist3
Note the Width and Height
LCDAssist3_1
Save Output and give it a name and path
LCDAssist4
Open with notepad
LCDAssist5
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);

Meaning

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.

Publicités

Yassine Tout afficher

Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.

Répondre

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion /  Changer )

Photo Google

Vous commentez à l'aide de votre compte Google. Déconnexion /  Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion /  Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion /  Changer )

Connexion à %s

%d blogueurs aiment cette page :