View of Max 30100/30102 Sensor Implementation to Viral Infection Detection Based On Spo2 and Heartbeat Pattern

Download (0)

Full text



Max 30100/30102 Sensor Implementation to Viral Infection Detection Based On Spo2 and Heartbeat Pattern

Dr. B. Annapurna1, AshaPriyadarshini. Manda2, A. Clement Raj3, Dr. R. Indira4, Dr. Srivastava. Pratima Kumari5, Dr. V. Nagalakshmi6

1Associate Professor, Department of Computer Science and Engineering, Aditya College of Engineering, Surampalem, Andhra Pradesh, India

2 HoD of Computer Science Department, JMJ College for Women (A), Tenali, Andhra Pradesh, India

3 Lecturer, Department of Electrical and Computer Engineering, BuleHora University, BuleHora, Ethiopia

4,5Associate Professor, Department of Zoology, Ch.S.D.St.Theresa's College for Women (A), EluruWest Godavari district, Andhra Pradesh, India

6 Associate Professor, Department of Chemistry, Ch.S.D.St.Theresa's College for Women (A), EluruWest Godavari district, Andhra Pradesh, India


Introduction- Oxygen level present in the human body is a measure that shows the amount of Oxygen Saturation (SpO2) present in Red Blood Cells (RBC). It is as essential to check blood oxygen level as checking the body temperature level for wellbeing concerns. Particularly during the current circumstance when the viral infection and its outbreak is way normal. The recent episode of destructive infections like COVID-19, Middle East Respiratory Syndrome (MERS), Ebola, Lassa Fever, Zika Virus, Yellow Fever, and latest Influenza A [H3N2 and H1N2]warns us to stay ready for forthcoming virus attacks.[1] It is apparent from ongoing researches that the immune system of our body is likewise demonstrated by the SpO2 levels. All in all, we can say that the blood oxygen level is the non-intrusive method of recognizing the resistance capacity of an individual against the virus attack [2]. Oxygen level degradation is one of the major lethal explanations behind the passings of deaths in the recent COVID-19 cases. It was taught to ceaselessly screen the blood SpO2 level, as blood oxygen loss is generally not distinguished. Till the patient arrives at the emergency clinic, they normally breakdown due to lack of oxygen and respiration problems. Our paper proposes the Heart Beat and SpO2 sensor [Max 30100/30102] interfacing to check the immunity level of individuals. The framework is associated with an ESP8266 based IoT module to screen the body parameters like SpO2 and Heartbeat, live on the web. It very well may be profoundly valuable for the specialists to screen their patients from various wards of clinics as well as from any edge of the world. In our country, whereas of now, there is a shortage of doctors, this framework can assist with arriving at their patients remotely. This gadget can be a deliverer for individuals to get unaffected from a late flare-up of infections as the majority of individuals even get infected by different patients in hospitals too.


Oxygen Saturation (SpO2), Red Blood Cells (RBC), Middle East Respiratory Syndrome (MERS)


The year 2020 will be known as the COVID pandemic era due to the severity, communicable nature, and deadly impact of COVID-19 over humanity. As of today, the total cases of coronavirus is 108,812,516 of which 2,395,970 deaths and 80,841,562 recoveries are there. Death and recovery mainly depend on 2 parameters. Immunity level of the body [durability of the body against virus] and timely identification of viral infection. Most of the people died in coronavirus cases due to a lack of ventilation system provided to them in China. This numbers to only 20% of people who died of novel coronavirus infections in China got ventilation. 80% of patients who died of COVID-19 could not receive ventilation at the time of need. This is the report of April 2020 when COVID was not spread worldwide. The lack of ventilation support occurred as one of the biggest reasons for COVID-19 deaths worldwide.[3]



In our paper, we deal with the SpO2 sensor which can live track the heartbeat and blood oxygen level. We can broadcast the sensor parameters in a real-time numerical and graphical format to the web servers. Early detection of degrading oxygen level and lower immunity due to lower oxygen level are the two major identification of critical situations in any viral disease pandemic.

After COVID there are many viral diseases in the line to shake humanity like the SFTS virus.

Fig.1: Lack of Ventilators and Coordination: Main reason for Deaths during the COVID era [4]

We can be ready to combat these viruses we the help of technology. Adequate SpO2 level is between 95-100. A healthy person with good immunity always has the optimum SpO2 level [95- 100] but when the value goes below 90 there is an urgent need to provide ventilation. Any further delay can be fatal and causes severe breathlessness which can further result to causes death. In the case of COVID patients it happened the same, till their blood oxygen saturation came below 90 they felt minor breathing difficulty, negligence of which further reached to minimum SpO2 level and ultimately deaths.


[1]. EsratJahan et al. explained in detail the pulse oximeter system. They explained that they have used the heartbeat and blood oxygen saturation as the parameters to analyze the health of a human being. The information about how the heartbeat and blood oxygen percentage is explained as the light absorption rate of the sensor. They provided the different heart rates for several categories and explained that for a healthy person the heartbeat should be in a prescribed range.

The effectiveness of the healthy respiratory system is determined by the oxygen percentage present in the red blood cell of the blood. The device developed by EsratJahan et al. is a primary work in the field where the peripheral interface controller (PIC) microcontroller-based system detects the blood oxygen level and heartbeat. They use the transmittance method of body parameter measurement to detect the above-said parameters. It is found from their practical observation that the results obtained are very close to the preset value. The preset value of SpO2 is around 95-100 for the healthy person at the same time it is around 159- more than 100 for different age groups. One thing is observable that the heartbeat decreases with increasing age.

This paper helps us to have different values of heart rate and SpO2 to match with our body parameters. [5]



[2]. Avneendra K. Kanva et al. observed detailed information about SpO2 and heart rate using a smartphone. Their main work involved using a phone camera as the SpO2 detection tool. The variation in the color pattern of the finger placed on the camera lens can also calculate the accurate heartbeat. They also proposed the comparative accuracy test of their proposed phone- based SpO2 and heartbeat detection system with the noninvasive sensors available in the market.

The optical video monitoring and detection of heartbeat and SpO2 are observed minutely. This enables the system to observe accurate and reliable outcomes. At first, they recorded the small video of the finger against a heavy light source from behind to accurately capture the amount of light passing through the finger. In the second step, around 600 frames are extracted from our video recorder for further analysis. In the next step, each image is processed for its red and blue particles of formation. The mean of red and blue color components are calculated and calculated to identify the standard deviation of the same red and blue components. The calculated value of all 600 frames is formed in the form of a graph. The SpO2 level calculated is linked with the heart rate with ± 15 of the ideal heart rate. This system provides another perspective to our study to create a much accurate calculative study over the reduced hardware for body parameter calculations. [6]

[3]. M.T Tamam et al. demonstrated in their paper the noninvasive method of heart rate and oxygen saturation and body temperature detection with the help of sensors. They mentioned that heart disease is the number 1 cause of death all over the world. Their main parameter deals with identifying heartbeat, body temperature, and blood oxygen saturation level. They designed a pulse oximeter of clip type. They calculated the result of body temperature, heartbeat, and SpO2 level on many participants. They used a heart rate sensor, oxygen saturation sensor, and temperature sensor. The Arduino board is used as the logic device in the system. The software system used was MULTISIM and BASCOM simulation software. The calculation error is comprised of SpO2-0.89% BPM-3.095% and temperature-0.78% this shows that the system is highly accurate in comparison to other methods. The real-time matching of body parameters and adding temperature sensors is what gives the almost similar consent but with additional display and IoT broadcast our result. [7]


Fig.2: Operation Diagram



Our Max30100/30102 and IoT system deals with the detection of heartbeat and SpO2 levels. The real-time update is processed on the webserver using the Node MCU microcontroller system. The overall system is designed in the form of a portable device that is powered by a 2700 mAh Lithium Polymer (LiPo) battery. The rechargeable battery is charged and managed by the recharging controller TP4056. The charging controller can be powered by any phone charger or even through USB power from any PC, laptop, or even power banks. The internet connectivity can be provided with a WiFi connection from our internet modems or even by Hotspot of our phones.

3.2 System Flow Diagram

3.3 Microcontroller Program



Yes On the Power Supply

Establish The Wi-Fi and Internet Connection

Internet Connection Establishment

Internet Error

Check finger is available on


Heart Beat – 82 SpO2 - 96 Sensor Data Push over


Sensor Data Display on OLED Display

Heart Beat – 82 SpO2 - 96 No



#include "FS.h"

#include <Wire.h>

#include "MAX30100_PulseOximeter.h"

#include "Adafruit_GFX.h"

#include "OakOLED.h"

#define CAYENNE_PRINT Serial

#include <CayenneMQTTESP8266.h>

#define REPORTING_PERIOD_MS 10000 // set to 10secs. Set as appropriate.


PulseOximeter pox;

float BPM, SpO2;

uint32_ttsLastReport = 0;

String hrData = "";

unsigned long timems =0;

// WiFi network credentials.

charssid[] = "iotdata";

charwifiPassword[] = "12345678";

char username[] = "885805e0xxxx-f259-11e6-8577-0128e408a1ba";

char password[] = "f2400465a9c0c177xxxx28a6b0f5d6bad99594a0ef51";

charclientID[] = "3406xxx9f70-5dd9d-11eb-a2we4-b32ea624e442";

//char username[] = "885805e0-f259-11e6-8577-0128e408a1ba";

//char password[] = "f2400465a9c0c17728a6b0f5d6bad99594a0ef51";

//char clientID[] = "b86f9790-4cfd-11eb-a2e4-b32ea624e442";

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


// Callback (registered below) fired when a pulse is detected voidonBeatDetected()


Serial.println("Beat Detected!");

oled.drawBitmap( 60, 20, bitmap, 28, 28, 1);



void setup() {








oled.setCursor(0, 0);

oled.println("PLEASE WAIT!!!!!!!!!");


pinMode(2, OUTPUT);

Cayenne.begin(username, password, clientID, ssid, wifiPassword);

Serial.print("Initializing Pulse Oximeter..");

pinMode(16, OUTPUT);

if (!pox.begin()) {

Serial.println("CONNECTION FAILED");




oled.setCursor(0, 0);

oled.println("CONNECTION FAILED ");



} else {




oled.setCursor(0, 0);

oled.println(" Heart beat and SpO2 monitoring");


Serial.println("WAITING FOR INPUT");

digitalWrite(2, HIGH); //Turn off in-built LED }




Serial.println("An Error has occurred while mounting SPIFFS");


} }

void loop() {


BPM = pox.getHeartRate();

SpO2 = pox.getSpO2();

if (BPM < 40 || SpO2 == 0)

{ // Neglects low readings and starts loop again.

Serial.println(F("No Finger on Sensor!!!!!"));



if (millis() - tsLastReport> REPORTING_PERIOD_MS)




digitalWrite(2, LOW); // Turn ON LED everytime reading is saved // Cayenne.loop();

Serial.print("Heart rate: ");


timems = millis();

hrData = String(timems) + String(",") + String(BPM) + String(",") + String(SpO2);

//convert variable from integer to string Serial.print(" bpm , SpO2:");


Serial.println(" %");

File file ="/HR_test.txt", "a");

Cayenne.virtualWrite(0, BPM, "counter","p" );

Cayenne.virtualWrite(1, SpO2, "O2", "p") oled.clearDisplay();







oled.setCursor(0, 0);

oled.println("Heart BPM");



oled.setCursor(0, 30);




oled.setCursor(0, 0);

oled.println(" HB+SPO2");



oled.setCursor(0, 11);

oled.println(" DETECTION");



oled.setCursor(0, 21);

oled.println(" UNIT");






if(!file) {

Serial.println("Failed to open file for writing");





file.println (hrData);


digitalWrite(2, HIGH);

tsLastReport = millis();

} }


Fig.3: Working Module

Fig.4: Online Output Fig.5: Offline Output V. DISCUSSION AND CONCLUSION

Thus we developed a system of Live heartbeat and SpO2 tracking which is crucial for the current situation as well as for the future. Already in the market SpO2 and Heart Beat detection systems are available but they have limited features and their accuracy is mainly not tested. Our developed product is highly accurate and it has the additional feature of IoT connectivity which



provides it worldwide coverage of the data transmission. The system is possible to implement in realtime and it can easily solve the problems like scarcity of doctors, the sudden need for ventilators, the worry of elder people living alone with health concerns, updates about patients getting treated, etc. We hope the positive implementation of technology will bring change for the health sector and enable us to fight against the forthcoming viral diseases.


[1] Disease outbreaks by year. World Health Organisation,, 2021.

[2] US National Library of Medicine. Pulse-oximetry accurately predicts lung pathology and the immune response during influenza infection. National Institutes of Health, June 2009.

[3] The Economic Times. Many who died of COVID-19 may have had delayed ventilator support: Study,April 2020.

[4] The Times of India. Covid-19 hospitals struggling to make effective use of ventilators in Andhra Pradesh September 9, 2020.

[5] EsratJahan et al. An overview on heart rate monitoring and pulse oximeter system, International Journal of Latest Research in Science and Technology ISSN (Online): 2278- 5299,Volume 3, Issue 5: Page No 148-152. September-October 2014.

[6] Avneendra K Kanva et al. Determination of SpO2 and Heart-rate using Smart-phone Camera, 2014 international Conference on Control, Instrumentation, Energy &


[7] M T Tamam et al. Design a system of measurement of heart rate, oxygen saturation in blood and body temperature with non-invasive method, IOP Conference Series: Materials Science and Engineering, 2018.

[8] I. D. Soubache et al. Diabetic Foot Ulcer Treatment Device Using Peltier and Embedded Electronics, Journal of Physics: Conference Series, 2020 J. Phys.: Conf. Ser. 1712 012041.

[9] Ms. Sarah EzhilKelna Edwin. Galvanic Skin Response And Heart Beat Sensor Coordination To Track The Health Parameter, International Journal of Grid and Distributed Computing, Vol. 13, No. 2, (2020), pp. 2557-2562.

[10] Saravanan J., Raj A.C., Singh R.K., Taye A. (2019) An Efficient Security Implementation with Power Cane for Visually Challenged. In: Mekuria F., Nigussie E., Tegegne T. (eds) Information and Communication Technology for Development for Africa. ICT4DA 2019.

Communications in Computer and Information Science, vol 1026. Springer, Cham.




Related subjects :