Affordable Real-Time Heart Rate, ECG & SpO2 Monitoring System Using Internet of Things (IoT)
Affordable Real-Time Heart Rate, ECG & SpO2 Monitoring System Using Internet of Things (IoT)
https://doi.org/10.22214/ijraset.2022.47731
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
Abstract: The healthcare industry now has an incomparable platform thanks to the Internet of Things technology, making it
possible to quickly and effectively deal with challenges concerning healthcare. There has been a steady rise in the number of
deaths due to sudden cardiac arrest (SCA) cases in developing countries and a lack of widespread use of an AED in these
countries. The purpose of this study is to create an affordable Automated External Defibrillator (AED) that can be connected to
IoT and can overcome certain drawbacks of the current AEDs. In the first phase of implementation, we attempt to create a Heart
Monitoring System that can read Beats Per Minute (BPM), Electrocardiogram (ECG), and Saturation of Peripheral Oxygen
(SpO2) using off-the-shelf sensors and display the data on a smartphone app. These sensors are connected to a Raspberry Pi
3b+, a single-board computer (SBC), which controls the entire system. The implementation of the system is successful,
transmitting heart vitals to a smartphone app in real time. Further, the limitations of the system and future improvements are
also discussed. The study builds a Heart Monitoring System under $67 with a few drawbacks. Further studies with better
equipment are required to make the system accessible and less error-prone.
Keywords: Sudden Cardiac Arrest, Heart Monitoring System, Automated External Defibrillator, Heart Rate, Beats Per Minute
(BPM), Electrocardiogram (ECG), Saturation of Peripheral Oxygen (SpO2), Raspberry Pi 3b+, MAX30100 Pulse Oximeter,
AD8232 ECG Sensor.
I. INTRODUCTION
Around 7 lakh individuals lose their life to Sudden Cardiac Arrest in India annually. If a cardiac arrest occurs, prompt treatment
with a medical device known as an Automated External Defibrillator (AED) can save a person's life. An AED is a portable device
that checks the heart rhythm and can deliver an electric shock to the heart to try to restore a normal rhythm. AEDs are used to treat
sudden cardiac arrest (SCA). Sudden cardiac arrest happens when the heart abruptly and unexpectedly stops beating. When this
happens, the blood supply to the brain and other essential organs stops. Sudden cardiac arrest can be fatal if not treated promptly.
However, if it is treated within a few minutes, there is a significant chance of survival. AEDs are designed for use by laypeople with
no medical training and can be found in a variety of public places, such as airports, shopping malls, and office buildings. Sudden
cardiac arrest (SCA) is a medical emergency that needs to be treated right away. The lack of awareness in identifying the symptoms
of SCA can lead to delays in seeking medical help, which can be fatal. Cardiopulmonary Resuscitation (CPR) is a life-saving
technique that everyone should be aware of. It is a simple and easy-to-learn process that can mean the difference between life and
death in an emergency like SCA. There are many reasons why people refrain from purchasing an AED, despite knowing that it
could save a life. The high cost of an AED is often a deterrent, as is the lack of education on how to use the device. In addition,
many people are simply unaware of the potential benefits of an AED and how it could potentially save a life.
In the US, sudden cardiac arrest is one of the leading causes of mortality. According to the American Heart Association, SCA kills
more than 350,000 Americans every year. The majority of SCA victims have no prior symptoms and die within minutes. SCA is so
abrupt and unexpected that bystanders are generally the only ones who can assist. CPR (cardiopulmonary resuscitation) is a life-
saving technique that can be used on victims of SCA. However, CPR is only effective if it is performed immediately after the victim
collapses. The use of an AED can also be lifesaving in SCA cases. An AED is a portable device that delivers an electric shock to the
heart, which can stop an irregular heartbeat and restore normal heart rhythm. However, AEDs are often not used in SCA cases
because they are expensive and many people do not know how to use them. As per the market research conducted by us, we have
concluded that the market price of a good AED sums up to around ₹70,000 - ₹1,00,000. But this is not the only cost you need to
incur to buy an AED. There are other costs too, which we will discuss in this post. Many costs need to be considered while buying
an AED, apart from the market price of the AED itself: the cost of batteries, the cost of carrying a case, the cost of electrodes, and
the cost of maintenance.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1852
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
Your AED doesn’t work without batteries. The batteries of an AED can last for 1 – 2 years, depending on the number of times the
AED is used. Hence, it is important to consider the cost of batteries while deciding the overall cost of buying an AED. So, the
project aims to develop a low-cost AED. Our project is an affordable version of an AED which is made at a fraction of the current
cost.
The project is based on a microprocessor (SBC) – Raspberry Pi. It is interfaced with the sensors. The sensors are used to detect the
heart rate. If the heart rate is abnormal, then Raspberry Pi sends a signal to the defibrillator. The defibrillator will then give a shock
to the patient.
The project consists of two main parts: the hardware and the software. The hardware part consists of the circuitry and the sensors.
The software part consists of the firmware which is programmed into the microprocessor. An affordable AED system can be a
valuable tool in developing countries where access to emergency medical care may be limited. AEDs can be used to provide prompt
treatment for sudden cardiac arrest, which is a life-threatening condition. By providing access to an affordable AED system, more
people in developing countries can be trained in how to use these devices and be prepared to respond in an emergency.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1853
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
4) “Real-Time System Prediction for Heart Rate Using Deep Learning and Stream Processing Platforms” – The heart is an
essential organ that circulates blood throughout the body. It is important to monitor the heart rate because an irregular heartbeat
can be a sign of health problems. Rapid technological advancement has allowed healthcare sectors to consolidate and analyze
massive health-based data to discover risks by making more accurate predictions. The proposed system consists of two phases:
an offline phase, during which a model is developed using different forecasting techniques to find the lowest root mean square
error; and an online phase. The Medical Information Mart for Intensive Care (MIMIC-II) was used to obtain the heart rate time-
series dataset. Heart rate time series are subjected to the application of recurrent neural network (RNN), long short-term
memory (LSTM), gated recurrent units (GRU), and bidirectional long short-term memory (BI-LSTM). The best-built model has
been utilized to estimate the heart rate in advance for the online phase using Apache Kafka and Apache Spark. The GRU with
three layers had the highest performance, according to the experimental findings. Consequently, heart rate has been predicted
five minutes in advance using GRU with three layers. [4]
5) “IoT-based System for Heart Rate Monitoring” – The Heart Rate Monitoring system was created with the use of IoT
technology with the aim of sensing the patient's heartbeat in order to track both the regular check-ups and the risk of a heart
attack. To ensure that our health is in top shape, body health monitoring is crucial to us. The heart rate is an essential metric for
the equipment under consideration (HR). The project outlines the development of a portable, low-cost heart rate monitoring
device based on Bluetooth technology. The Bluetooth module, Android application, and Heart Rate module are only a few of
the components that make up the overall system. The Heart Rate (HR) module collects heart rate data from the subject
(patients) using a non-invasive method called Photoplethysmography and transmits it wirelessly to a computer or an Android
application using a Bluetooth module. This system can be used in conjunction with other telemedicine components. The heart
rate module's data can be stored and accessed for future medical applications. The results from the prototype of this device can
be applied to a variety of clinical studies because the Bluetooth signal can be transmitted up to 20 meters. [5]
6) “Advanced System for Heart Rate Monitoring Based on Internet of Things (IoT)” – Monitoring heart rate is crucial for keeping
the heart healthy. Age-specific heart rate thresholds, optimal, and minimum values are present in humans, and the heart rate
control system is sufficiently compatible to address this issue. The article discusses a hardware system with a pulse sensor and
an Internet of Things-based device that can track the heartbeat using sensor output data. Additionally, a warning system is
integrated to send alerts when the pulse crosses a predetermined threshold or level. A programmed cell phone delivers the
warning message to the doctor. This tool system will enable doctors to remotely monitor the patient's pulse data. Medical
workers working at the hospital, such as nurses or doctors, will keep a close eye on the patient's heart rate. The database stores
the patient's pulse and other private information that can be utilized to further monitor the patient's health. [6]
7) “A Study on Heart Rate Monitoring Systems Using IoT” – The sound of a person's heartbeat is made when the heart's valves
contract or explain as they force blood to different parts of the body. Your heart performs a vital job in your cardiovascular
system. A Heart Rate Monitor (HRM) should be a serious consideration if you want to maintain a better check on your general
fitness. From wrist wearables to chest straps and more, we have included the top HRM. The article gives a thorough overview
of the numerous heartbeat sensors and newly developed Internet of Things sensor devices (IoT). [7]
8) “LDIAED: A lightweight deep learning algorithm implementable on automated external defibrillators” – Automated External
Defibrillator (AED) ability to distinguish between shockable and non-shockable Electrocardiogram (ECG) signals would
enhance the effectiveness of resuscitation (AED). This study uses a Deep Neural Network (DNN) method to quickly classify
shockable signals from non-shockable signals in 1.4-second segments. The suggested method has a 99.1% accuracy rate and is
frequency-independent. It is trained using signals from a variety of patients taken from the MIT-BIH Malignant Ventricular
Ectopy Database (VFDB), the Creighton University Ventricular Tachyarrhythmia Signals Database (CUDB), and MIT-BIH.
The model's optimized version is then loaded onto the Raspberry Pi minicomputer. The implemented model was evaluated
using unseen ECG signals, and the results showed that it met the IEC 60601-2-4 criteria with an average latency of 0.845
seconds. [8]
9) “Realtime Heart Attack Detection System with AED Device Alert System” – Health-related concerns and issues are of
paramount importance to man in terms of existence and influence. Different systems that can collect and keep track of changes
in health factors have been developed. This paper research describes real-time remote monitoring of heart rate. The heart rate
can be monitored through this system's alert and LCD display. This study describes the implementation of a wireless module-
based heart rate detection and alert system that is affordable, effective, and flexible. The heart rate is sensed and measured by
the sensors, and the signals that are picked up are transferred to the control unit for further processing. The controller shows the
heart rate on the LCD, followed by the alert system. [9]
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1854
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
III. METHODOLOGY
A. Objective
Covid-19 has had a profound impact on the world, causing widespread panic and upheaval. One of the most visible effects of the
pandemic has been the sudden increase in the price of pulse oximeters. Pulse oximeters are small devices that measure the oxygen
level in your blood. They are commonly used by doctors and nurses to check the health of their patients and are essential for people
with heart problems. During the Covid-19 pandemic, the price of pulse oximeters skyrocketed, leaving many people with heart
problems stranded without access to this vital piece of equipment, while people with heart ailments were left stranded in long
queues for an ECG test. Our system seeks to address this problem by making single-lead ECG testing available to the masses. Our
system is simple to use and affordable and can be used by people without any special training. By making ECG testing more
accessible, we can help to reduce unnecessary crowding at hospitals and allow more people to test themselves at home. This will
help to relieve the pressure on the healthcare system and ensure that people with heart problems get the treatment they need.
B. Implementation
The proposed system relies on the use of two sensors to measure various physiological parameters of the patient. The first sensor is
the MAX30100, which is used to measure the blood oxygen level and pulse rate of the patient. The second sensor is the AD8232,
which is used to measure the electrocardiogram (ECG) of the patient. The data from these sensors is processed by the Raspberry Pi
3b+ and is then relayed to the Blynk IoT app. The Blynk app is used to visualize the data and to make decisions about the treatment
of the patient.
The MAX30100 is a sensor that is used to measure the blood oxygen level and pulse rate of the patient. The sensor works by shining
a light on the finger of the patient and then measuring the amount of light that is absorbed. The amount of light that is absorbed is
then used to calculate the blood oxygen level and pulse rate of the patient. The MAX30100 sensor uses the I2C protocol to start the
sensor and transfer data to the Raspberry Pi. (Refer to Fig. 1 and Fig. 2)
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1855
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
The AD8232 is a sensor that is used to measure the ECG of the patient. The sensor works by measuring the electrical activity of the
heart. The data from the sensor is then used to calculate the heart rate of the patient. As the AD8232 outputs only the analog data it
was not compatible with the Raspberry Pi 3b+. This required a new module, MCP3008, an analog-to-digital converter to convert the
analog data and transfer it to the Raspberry Pi using the SPI interface.
The data from the sensors is processed by the Raspberry Pi 3b+. The Data coming from the ECG machine is first validated by the
pins LO- and LO+ for correction of erroneous data while the implementation of the MAX30100 sensor uses an average of values
and max to handle outliers in the data and filter them out.
One of the challenges faced using the AD8232 sensor is to keep the Raspberry Pi reading the signal when the ECG pulse is detected
by the sensor and related to the SBC. The AD8232 sensor is an analog sensor with no buffer to store data. This was problematic
during the first implementation of the system when the inputs from the sensors would be taken and uploaded to the cloud in a cyclic
order one at a time. This led to a loss of data from both sensors. This problem is overcome using multithreading on the Raspberry Pi.
Three threads are created, the first one for reading the AD8232 sensor, the second for reading the MAX30100 sensor, and the third
thread for managing all other tasks and uploading all the data. The data from the sensors is then stored inside a global array which is
accessible to all the threads.
The data is then pushed to the Blynk Cloud via the API provided. This data is visualized on devices with the Blynk app or the Blynk
web dashboard. Using a multithreaded system greatly increases the system throughput as the AD8232 and MAX30100 sensors
transferred data at higher speeds while the speed for uploading the data is comparatively slow in nature. Rewriting the code and
using multithreading helps with getting more consistent results from the system. (Refer to Fig. 3)
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1856
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
B. The following software and firmware are required for implementing the system –
1) Raspberry Pi OS
2) Blynk IoT App
3) Python 3.7
V. RESULT
As seen in Fig. 5, the readings during the first implementation were underwhelming and not fit to be used to infer any medical
conditions. The erroneous data due to the cyclic read method of sensor data was clearly the problem plaguing the system.
Overcoming these issues, the second implementation reads data without any major problems. This implementation does a better job
of getting and presenting the data. The SpO2 data coming from the MAX30100 sensor has most of the errors in the data filtered out.
This leads to a very accurate SpO2 reading when compared to a medical-grade oximeter. However, the same cannot be said about
the ECG data. Even after filtering the data from the AD8232 sensor, the readings are sometimes inaccurate. The sensor is
susceptible to errors due to talking or the movements of the test subject and loose contact among the wires and cables used in the
system. Yet these ECG readings are more consistent and reliable as compared to the readings of the first implementation. (Refer to
Fig. 6)
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1857
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
As these sensors are non-destructive testing in nature, they are highly susceptible to errors due to external factors. In the case of the
MAX30100 sensor, the excess ambient light causes the sensor to provide faulty readings, and nail paint and dirty hands also cause
errors. Excessive sweating, involuntary movements or even talking causes errors in ECG data. It was a major challenge to create a
system immune to these errors. The current system, based on the readings, accounts for these errors and filters them to a certain
extent.
VI. LIMITATIONS
While working on the system we identified the following limitations of our current implementation –
1) The MAX30100 sensor is susceptible to external factors such as sunlight or ambient light. It also requires that the patient
doesn’t apply any nail paint on their nails for accurate readings.
2) The AD8232 sensor has 3 electrodes and can theoretically form 6 leads by changing the polarity of the electrodes. However, the
sensor performs only a single lead.
3) The ECG reading from the sensor is inaccurate and a better filter is required to solve this issue.
4) External factors such as body hair and sweat also add errors in the ECG data.
5) The system is also affected by internet connectivity and upload speeds.
6) As the speed of data being read and the data being uploaded and displayed is not the same there can be instances where the
reading displayed might be a previous reading and be confused with the current reading.
7) The system aims to also implement an SCA detector using the ECG values and a pulse mechanism but the ECG readings were
not reliable enough to implement such a system.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1858
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue XI Nov 2022- Available at www.ijraset.com
VIII. CONCLUSION
Correct detection of ECG is important in the first place, which allows medical experts and emergency services to respond quickly to
save patients’ lives. In this project, we attempt to create a better version of the existing AED in the current market.
Covid19 had a profound impact on the prices of healthcare equipment prices. In the first phase, we created a heart monitoring
system that successfully sent BPM, SpO2, and ECG data to the smartphone via a cloud platform. This system is an attempt to bring
critical medical equipment to households at an affordable rate, thereby reducing crowding at hospitals. The entire system was made
for under 5000 INR (67 USD. Oct 2021).
The drawbacks of the system can be overcome with better sensors and filtering techniques. Studies in the future and improved
sensors will be able to rectify these problems.
IX. ACKNOWLEDGEMENT
We would like to convey our heartfelt appreciation to our principal Dr. Srija Unnikrishnan, Fr. Conceicao Rodrigues College of
Engineering, Mumbai, affiliated with the University of Mumbai, our department head Dr. Brijmohan Daga and our mentor Asst.
Prof. Kalpana Deorukhkar for giving us this wonderful opportunity. We gained a lot of knowledge from the project's study, and it
also provided us with first-hand experience using these sensors. We are very appreciative of them.
REFERENCES
[1] Zipes, D.P., Wellens, H.J.J. (2000), Sudden cardiac death, In: Smeets, J.L.R.M., Doevendans, P.A., Josephson, M.E., Kirchhof, C., Vos, M.A. (eds) Professor
Hein J.J. Wellens. Springer, Dordrecht. doi: 10.1007/978-94-011-4110-9_60
[2] Ferretti, J., Di Pietro, L., & De Maria, C. (2017), Open-source automated external defibrillator, HardwareX, 2, 61–70. doi:10.1016/j.ohx.2017.09.001
[3] Loganathan, L Murukesan & Htut, Ye & M, Murugappan. (2014), Machine Learning Approach for Sudden Cardiac Arrest (SCA) Prediction Based on
Optimal Heart Rate Variability (HRV) Features, Journal of Medical Imaging and Health (0.642).
[4] Alharbi, A., Alosaimi, W., Sahal, R., & Saleh, H. (2021), Real-Time System Prediction for Heart Rate Using Deep Learning and Stream Processing Platforms,
Complexity, 2021, 5535734. doi:10.1155/2021/5535734
[5] Khamitkar, Sahana. (2020), IoT based System for Heart Rate Monitoring, International Journal of Engineering Research and. V9.
10.17577/IJERTV9IS070673.
[6] Arpita Suri (2021), Advance System for Heart Rate Monitoring Based on Internet of Things (IoT), Biosc.Biotech.Res.Comm. Special Issue Vol 14 No 07.
http://dx.doi.org/10.21786/bbrc/14.7.84
[7] R.Devi, S.Geetha Gowri, Dr.K.Sethuraman (2018), A Study on Heart Rate Monitoring Systems Using IoT, IJIRSET Volume 7, Special Issue 8.
[8] Nasimi F, Yazdchi M (2022), LDIAED: A lightweight deep learning algorithm implementable on automated external defibrillators. PLOS ONE 17(2):
e0264405. https://doi.org/10.1371/journal.pone.0264405
[9] Prof.Muhammadu Sathik Raja, Dhanish.P, Dhayananthan.S, Girimurugan.K, Manimaran.S (2020), Realtime Heart Attack Detection System with AED Device
Alert System, IJIRAE/RS/Vol.07/Issue03/Special Issue/01.MRAESCE10096.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1859