Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

This project uses an Arduino UNO board connected to the MAX30102 module (pulse oximeter and heart rate monitoring module), along with an OLED display and a buzzer for BPM measurement.

BPM stands for “beats per minute”, which is about 65-75 for a normal person at rest, and may drop below this during sports activities. SpO2 indicates the oxygen saturation level, which is generally above 95% for a normal person.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Equipment Required:

  • Arduino UNO

  • MAX30102

  • 128×32 OLED display (optional)

  • Buzzer (optional)

Performance Testing

The code used in this tutorial is quite simple, mostly examples from the Sparkfun_MAX3010x library. The code for the OLED and Buzzer is a modified version of the “HeartRate” example.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

The image shows the condition of not detecting a finger.

Extend your finger, and hold it still for a moment until you hear the buzzer’s “Beeps” sync with your heartbeat or the OLED animation syncs with it, then you can read the BPM. Note that in the code, the actual display shows the average BPM, which is calculated by averaging 4 BPM readings, thus increasing the measurement time but providing more accurate data.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Creating the Bitmap for OLED

The display shows a small heart bitmap image, and whenever the sensor detects a heartbeat, it switches to another larger heart bitmap image for a while, giving the impression of a heartbeat, accompanied by the buzzing sound from the buzzer.

Below are two bitmaps that we will call in the code later:

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

The bitmap filenames are logo2_bmp and logo3_bmp.

To create these, view the corresponding images on the screen (with black and white backgrounds), and don’t forget the dimensions. The tutorial uses 128×32 pixels, with images smaller than (32×32) px and (24×21) px.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Make sure the small images are in monochrome bitmap format, download LCD Assistant and open it (follow the steps below):

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Open the assistant and try these operations vertically and horizontally until it is correct.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Find the bitmap file.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Note the width and height of the image, specify a name and path for the file, and then save it. Open the file with Notepad or a similar application.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Below are the bitmap values.

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Below is how to call it in the code: display.drawBitmap(5,5,logo2_bmp,24,21,WHITE);

display.drawBitmap(start x pos, start y pos, bitmap name, width, height, color); As seen in the code, one is called when a finger is detected, and another when a heartbeat is detected.

This concludes the main content of the project. For code, schematics, and other materials, please contact the customer service of Chip Board Workshop.

– Recommended Boards –

1.Qingke New IoT Embedded Wireless Wi-Fi Module

2.Privilege Classmate Altera Cyclone Development Board

3.Rock960 Six-core 64-bit “Server Level” Development Board

4.Allwinner H6 Quad-core 1.8GHZ Orange Pi 3

5.Intel Neural Compute Stick, Compact Size Low Power

Measuring Heart Rate and Blood Oxygen Saturation with Arduino UNO: High Accuracy!

Leave a Comment

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