Powered by Blogger.

Search This Blog

من نحن

فنون

Blood Oxygen & Heart Rate Monitor with MAX30100 & Arduino

 Blood Oxygen & Heart Rate Monitor with MAX30100 Pulse Oximeter & Arduino


 

In this project we will make a device that can measure Blood Oxygen & Heart Rate using MAX30100 Pulse Oximeter & Arduino. 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 also use MAX30102 which is an upgraded version of MAX30100.

We will display the SpO2 and BPM value in 0.96″ OLED Display. With each beat, the display value is changed in the OLED screen. By using Bluetooth module HC-05/HC-06 (operating in a slave mode), we can send data to the android app wirelessly and monitor the data on the app as well as keep a track record of the data in text format. In this way, we can send the data read from the device to another device or to the Internet. This wearable device can be used by athletes to monitor their heart rate and blood oxygen levels during a workout.

:You can also go through the basic & advanced version of this project 


Bill of Materials

Following are the components required for this project, i.e Blood Oxygen & Heart Rate Monitor with MAX30100 Pulse Oximeter & Arduino. All the components can be purchased from Amazon. The components name as well as purchased link is given below.



S.N.Components NameDescriptionQuantity
1Arduino BoardArduino Nano1https://amzn.to/2tsBbp1
2Pulse Oximeter SensorMAX30100 Module1https://amzn.to/36Xn3Te
4OLED Display0.96" I2C OLED Display1https://amzn.to/2XaQ5uz
5Bluetooth ModuleHC-05/HC-06 Bluetooth1https://amzn.to/39IWinl
6Connecting WiresJumper Wires10https://amzn.to/2L8Xc1p
7Breadboard-1https://amzn.to/2YM6YyS

?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


So after a week I got the PCB. The PCB quality is good and excellent.




After that you can solder all the necessary components as per circuit diagram and make the final product ready.



The Android App

The Pulse Rate and Blood Oxygen concentration that is displayed on OLED Display can be transferred wirelessly to Android device using Andorid App over a Bluetooth Connection.


This App has been designed using MIT App Inventor. The link for both the files, i.e APK files and .aia files is given below. You can edit modify the Android app on MIT App inventor after importing .aia file. The app can be installed on any Android device and can be connected to HC-05 Bluetooth Module.






Download Android App: Download


Download .aia File: Download

Source Code/Program

The source Code/program for interfacing MAX30100 Pulse Oximter and Heart Rate Sensor with Arduino is given below. Copy this code and upload it to Arduino Board.

The library files can be downloaded from here:


The library files can be downloaded from here:
1. Arduino MAX30100 Library
2. OkaOLED Library
3. Adafruit GFX Library


Copy this code and upload it to Arduino Board:

Coding




#include "Wire.h"
#include "MAX30100_PulseOximeter.h"
#include "Adafruit_GFX.h"
#include "OakOLED.h"
#define Sec 1000
OakOLED oled;

PulseOximeter pox;

uint32_t tsLastReport = 0;

const unsigned char bitmap [] PROGMEM= {
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x18, 0x00, 0x0f, 0xe0, 0x7f, 0x00, 0x3f, 0xf9, 0xff, 0xc0, 0x7f, 0xf9, 0xff, 0xc0, 0x7f, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xf7, 0xff, 0xf0, 0xff, 0xe7, 0xff, 0xf0, 0xff, 0xe7, 0xff, 0xf0, 0x7f, 0xdb, 0xff, 0xe0, 0x7f, 0x9b, 0xff, 0xe0, 0x00, 0x3b, 0xc0, 0x00, 0x3f, 0xf9, 0x9f, 0xc0, 0x3f, 0xfd, 0xbf, 0xc0, 0x1f, 0xfd, 0xbf, 0x80, 0x0f, 0xfd, 0x7f, 0x00, 0x07, 0xfe, 0x7e, 0x00, 0x03, 0xfe, 0xfc, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
void onBeat()
{
Serial.println("Beat!");
oled.drawBitmap( 60, 20, bitmap, 28, 28, 1);
oled.display();
}

void setup()
{
Serial.begin(9600);
oled.begin();
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);

oled.println("Initializing pulse oximeter..");
oled.display();
Serial.print("Initializing pulse oximeter..");

if (!pox.begin()) {
Serial.println("FAILED");
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println("FAILED");
oled.display();
for(;;);
}
else {
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println("SUCCESS");
oled.display();
Serial.println("SUCCESS");
}
pox.setOnBeatDetectedCallback(onBeat);
}

void loop()
{
pox.update();

if (millis() - tsLastReport > Sec) {
Serial.print("Heart BPM:");
Serial.print(pox.getHeartRate());
Serial.print("-----");
Serial.print("Oxygen Percent:");
Serial.print(pox.getSpO2());
Serial.println("\n");
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0,16);
oled.println(pox.getHeartRate());

oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println("Heart BPM");

oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 30);
oled.println("Spo2");

oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0,45);
oled.println(pox.getSpO2());
oled.display();
tsLastReport = millis();
}
}




MAX30100 Arduino Working Project

The project is tested both on the breadboard as well as in PCB Assembled board. Initially, when no finger is placed over MAX30100, the SPO2 & BPM value both are zero. When the finger is placed, the BPM & SPO2 values start appearing. But the value shown is not correct initially, then after a few seconds, the OLED Display starts showing the correct value.

Here is a working demonstration of the device working when assembled on breadboard.


Similarly the same thing is with the PCB portable device it also works super fine and we got the same results.



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.


Video Demonstration & Explanation



border: 1px solid black; background-color: #EEEEFF; width: auto; height: 800px; overflow: auto; padding: 10px;

No comments:

Post a Comment

المقالات الاكثر مشاهدة

جميع الحقوق محفوظة Arduino Project

تصميم : أبوهلال بدر