Blood Oxygen Heart Rate Meter

12,236

190

28

Introduction: Blood Oxygen Heart Rate Meter

About: Make it yourself if you cannot buy one!

This instructables show how to use MAX30102, XIAO and a tiny display to build a blood oxygen and heart rate meter.

Step 1: Sensor & Algorithm

This project use Maxim Integrated MAX30102 Biosensor to detect pulse oximeter and heart rate. However, the official sample is not so accurate, so will use the MolecularD algorithm instead.

Ref.:

https://www.instructables.com/Pulse-Oximeter-With-...

Step 2: Hardware Preparation

MCU

The pulse oximeter calculation algorithm requires some memory. Arduino classic family does not have enough memory for data buffer. And also I want all components can fit in a 400 hole breadboard, so I need a smaller one. I have a Seeeduino XIAO in hand.

Display

Any Arduino_GFX supported display should be ok, I have a 1.14" 135x240 color display in hand.

Sensor

Maxim Integrated MAX30102 Biosensor.

Step 3: Breadboard Connection

Here are connection summary:

XIAO    -> Display  -> MAX30102
VCC     -> VCC, BLK -> VCC
GND     -> GND, CS  -> GND
GPIO  0             -> INT
GPIO  2 -> RST
GPIO  3 -> DC
GPIO  4             -> SDA
GPIO  5             -> SCL
GPIO  8 -> SCL
GPIO 10 -> SDA

Step 4: Program

  1. Follow Seeeduino XIAO software install guide if not yet: https://wiki.seeedstudio.com/Seeeduino-XIAO/#softw...
  2. Download source code: https://github.com/moononournation/BloodOxygenHea...
  3. Open BloodOxygenHeartRateMeter.ino in Arduino IDE
  4. Press upload

Step 5: How to Use?

  1. Plug USB power
  2. Wait "Put on finger" message show
  3. Put your finger on the MAX30102 sensor, "Measuring..." message show
  4. Hold and wait few seconds, blood oxygen and heart rate figures show

Step 6: Cross Check Figures

I have cross check the readings with Apple Watch Series 6, MolecularD algorithm can give very precise figures that comparable with Apple Watch.

Be the First to Share

    Recommendations

    • Fandom Contest

      Fandom Contest
    • Fiber Arts Challenge

      Fiber Arts Challenge
    • Microcontroller Contest

      Microcontroller Contest

    28 Comments

    0
    Eysth
    Eysth

    Question 7 months ago

    Hi, The code is out of date just now I would like to know if you could reply with the new way to get the code to work without error.
    I have got the main library to work but all the files (are they files or are they their own libraries) won’t work.
    The files are all in the correct folder with the library and code.

    I have attached a photo of the error screen for reference.

    Also can you please tell me what exactly the .h files are and what the .cpp file is terminology wise?

    Thank you.

    RenderedImage.jpeg
    0
    qusaihb
    qusaihb

    7 months ago

    would this work if i just used the code with a arduino nano 33 ble, i would have to get the biosensor and LED?

    0
    陳亮
    陳亮

    Reply 7 months ago

    not yet tested, but it should work.

    0
    陳亮
    陳亮

    Reply 10 months ago

    great!

    0
    cowmow
    cowmow

    10 months ago on Introduction

    Subroutine Wire.h is missing from the list of subroutines to be included when I wish to upload and run the sketch, BloodOxygenHeartRateMeter.
    What can I do to solve this problem?

    0
    陳亮
    陳亮

    Reply 10 months ago

    Wire.h should be a built-in library in Arduino IDE platform.

    0
    musicmanager
    musicmanager

    10 months ago

    Hi
    I got the bits together and built this project but I can't get your code to compile; Error message .. refer to lines 120 & 123 .. .. ' macro 'F' passed 2 arguments, but takes just 1 '

    I don't understand, can you help ?

    MM

    0
    陳亮
    陳亮

    Reply 10 months ago

    What dev board in Arduino IDE you selected?

    0
    musicmanager
    musicmanager

    Reply 10 months ago

    Seeeduino Xiao

    I think the line 120 .. gfx->print(F("%d ", n_heartrate);

    should read .. gfx->printf("%d ", n_heartrate);

    and line 123 similarly .. .

    Agreed ?

    MM

    0
    musicmanager
    musicmanager

    Reply 10 months ago

    Ok, well it compiles now;
    However, I don't understand where the macro came from because I only downloaded from the list on the Instructable.

    Thanks for your help

    MM

    0
    nicola7mbre
    nicola7mbre

    Question 11 months ago

    i have this error:

    In function 'void loop()':
    BloodOxygenHeartRateMeter:123:12: error: 'class Arduino_ST7789' has no member named 'printf'; did you mean 'print'?
    gfx->printf("%d ", n_heartrate);
    ^~~~~~
    print
    BloodOxygenHeartRateMeter:126:12: error: 'class Arduino_ST7789' has no member named 'printf'; did you mean 'print'?
    gfx->printf("%.1f", n_spo2);
    ^~~~~~
    print
    exit status 1
    'class Arduino_ST7789' has no member named 'printf'; did you mean 'print'?

    What should I do?

    0
    陳亮
    陳亮

    Answer 10 months ago

    Are you using Arduino AVR family like Arduino Nano?

    0
    nicola7mbre
    nicola7mbre

    Reply 10 months ago

    i used an Arduino Uno Rev3

    0
    陳亮
    陳亮

    Reply 10 months ago

    as mentioned in step 2, Arduino classic family does not have enough memory for data buffer.

    0
    陳亮
    陳亮

    Reply 10 months ago

    as mentioned in step 2, Arduino classic family does not have enough memory for data buffer.

    0
    cowmow
    cowmow

    11 months ago on Introduction

    1. Do you have a pin out pattern and drawing for the 30102 module PCB?
    2. Do you have a Fritzing part number for the 30102 module PCB?