Harte rate and spo2 sensor

 

Interfacing MAX30100 Pulse Oximeter Sensor with Arduino

Table of Contents [hide]


Interfacing MAX30100 Pulse Oximeter Sensor with Arduino

In this project we will be Interfacing MAX30100 Pulse Oximeter Sensor with Arduino that can measure Blood Oxygen & Heart Rate and display it on 16x2 LCD Display. The blood Oxygen Concentration termed as SpO2 is measured in Percentage and Heart Beat/Pulse Rate is measured in BPM. The MAX30100 is a Pulse Oximetry and heart rate monitor sensor solution.

You can go through the advanced version of this project:
1.
Blood Oxygen & Heart Rate Monitor with MAX30100 Pulse Oximeter & Arduino
2. MAX30100 Pulse Oximeter with ESP8266 on Blynk IoT App


Bill of Materials

Following are the components required for this project, i.e Interfacing MAX30100 Pulse Oximeter Sensor with Arduino. All the components can be purchased from Amazon. The components name as well as purchased link is given below.

S.N.

Components Name

Description

Quantity

1

Arduino Board

Arduino UNO R3 Development Board

1

2

Pulse Oximeter Sensor

MAX30100 Module

1

4

LCD Display

JHD162A 16X2 LCD Display

1

5

Potentiometer

10K

1

6

Connecting Wires

Jumper Wires

10

7

Breadboard

-

1




How does Pulse Oximeter Works?

Oxygen enters the lungs and then is passed on into blood. The blood carries oxygen to the various organs in our body. The main way oxygen is carried in our blood is by means of hemoglobin. During a pulse oximetry reading, a small clamp-like device is placed on a finger, earlobe, or toe.

 



Small beams of light pass through the blood in the finger, measuring the amount of oxygen. It does this by measuring changes in light absorption in oxygenated or deoxygenated blood.




                                                                                                MAX30100 Pulse Oximeter

The sensor is an integrated pulse oximetry and heart-rate monitor sensor solution. It combines two LED’s, a photo detector, optimized optics, and low-noise analog signal processing to detect pulse and heart-rate signals. It operates from 1.8V and 3.3V power supplies and can be powered down through software with negligible standby current, permitting the power supply to remain connected at all times.

Features

1

2

3

1. Consumes very low power (operates from 1.8V and 3.3V)

2. Ultra-Low Shutdown Current (0.7µA, typ)

3. Fast Data Output Capability




Working of MAX30100 Pulse Oximeter and Heart-Rate Sensor

The device has two LEDs, one emitting red light, another emitting infrared light. For pulse rate, only the infrared light is needed. Both the red light and infrared light is used to measure oxygen levels in the blood.

When the heart pumps blood, there is an increase in oxygenated blood as a result of having more blood. As the heart relaxes, the volume of oxygenated blood also decreases. By knowing the time between the increase and decrease of oxygenated blood, the pulse rate is determined.

It turns out, oxygenated blood absorbs more infrared light and passes more red light while deoxygenated blood absorbs red light and passes more infrared light. This is the main function of the MAX30100: it reads the absorption levels for both light sources and stored them in a buffer that can be read via I2C.


Interfacing MAX30100 Pulse Oximeter Sensor with Arduino

Now let us interface MAX30100 Pulse Oximeter Sensor with Arduino and display the value in serial monitor. So the circuit diagram and connection is given below. You can follow the same.


Connect the Vin pin of MAX30100 to Arduino 5V or 3.3V pin, GND to GND
. Connect the I2C Pin, SCL & SDA of MAX30100 to A5 & A4 of Arduino




Source Code/Program

The source Code/program for interfacing MAX30100 Pulse Oximeter with Arduino is given below. This code will display the value in serial monitor. Copy this code and upload it to Arduino Board.

The library files can be downloaded from here:
Arduino MAX30100 Library

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

#include <Wire.h>

#include "MAX30100_PulseOximeter.h"

#define REPORTING_PERIOD_MS     1000

PulseOximeter pox;

uint32_t tsLastReport = 0;

void onBeatDetected()

{

    Serial.println("Beat!");

}

void setup()

{

    Serial.begin(115200);

    Serial.print("Initializing pulse oximeter..");

    // Initialize the PulseOximeter instance

    // Failures are generally due to an improper I2C wiring, missing power supply

    // or wrong target chip

    if (!pox.begin()) {

        Serial.println("FAILED");

        for(;;);

    } else {

        Serial.println("SUCCESS");

    }

     pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

    // Register a callback for the beat detection

    pox.setOnBeatDetectedCallback(onBeatDetected);

}

void loop()

{

    // Make sure to call update as fast as possible

    pox.update();

    if (millis() - tsLastReport > REPORTING_PERIOD_MS) {

        Serial.print("Heart rate:");

        Serial.print(pox.getHeartRate());

        Serial.print("bpm / SpO2:");

        Serial.print(pox.getSpO2());

        Serial.println("%");

        tsLastReport = millis();

    }

}




      Interfacing MAX30100 Pulse Oximeter Sensor with Arduino & LCD Display

Now let us use the 16X2 LCD Display to see the value of BPM & SpO2 instead of Serial Monitor. Assemble the circuit as shown in the circuit diagram below.


Source Code/Program








#include <LiquidCrystal.h>

#include <Wire.h>

#include "MAX30100_PulseOximeter.h"

 

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

#define REPORTING_PERIOD_MS     1000

PulseOximeter pox;

uint32_t tsLastReport = 0;

void onBeatDetected()

{

    Serial.println("Beat!");

}

void setup()

{

    Serial.begin(115200);

    Serial.print("Initializing pulse oximeter..");

    lcd.begin(16,2);

    lcd.print("Initializing...");

    delay(3000);

    lcd.clear();

    // Initialize the PulseOximeter instance

    // Failures are generally due to an improper I2C wiring, missing power supply

    // or wrong target chip

    if (!pox.begin()) {

        Serial.println("FAILED");

        for(;;);

    } else {

        Serial.println("SUCCESS");

    }

     pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

    // Register a callback for the beat detection

    pox.setOnBeatDetectedCallback(onBeatDetected);

}

void loop()

{

    // Make sure to call update as fast as possible

    pox.update();

    if (millis() - tsLastReport > REPORTING_PERIOD_MS) {

        Serial.print("Heart rate:");

        Serial.print(pox.getHeartRate());

        Serial.print("bpm / SpO2:");

        Serial.print(pox.getSpO2());

        Serial.println("%");

 

        lcd.clear();

        lcd.setCursor(0,0);

        lcd.print("BPM : ");

        lcd.print(pox.getHeartRate());

        

        lcd.setCursor(0,1);

        lcd.print("SpO2: ");

        lcd.print(pox.getSpO2());

        lcd.print("%");

        tsLastReport = millis();

    }



MAX30100 Not Working Troubleshooting

If you purchased the MAX30100 Module shown below, then it might not work as it has a serious design problem. The MAX30100 IC uses 1.8V for VDD and this particular module uses two regulators to achieve this voltage. Nothing wrong with that. However, if you look closely, the SCL and SDA pins are pulled-up via the 4.7k ohm resistors to 1.8V! This means it won’t work well with microcontrollers with higher logic levels.

1st Method

The solution is to remove the resistors from the board (encircled on the image below) and attach external 4.7k ohms resistors to SDA, SCL and INT Pin instead.

After removing all 4.7K Resistor, connect the INT, SDA, SCL pin to the external 4.7K Pull up resistor as shown in the image below.

2nd Method

Similarly you can use the second method to fix this issue if you don’t like the first one. It is enough to cut the path in the place of the red cross and make a jumper as shown by the yellow line. The jumper does not need an insulated wire. You can take a tinned strand from the stranded wire. The board is covered with a protective mask and there is no short circuit to the copper pour.


vidio in the youtube

<a href="https://youtu.be/8SOTsR1k8-g"><img src="https://how2electronics.com/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8SOTsR1k8-g%2F0.jpg" alt="Blood Oxygen &amp;amp; Heart Rate Measurement with MAX30100/02 Pulse Oximeter &amp;amp; Arduino" width="640" height="340" /></a>








تعليقات

المشاركات الشائعة