0% found this document useful (0 votes)
5 views

published article

This paper presents an IoT-based ECG monitoring system aimed at detecting heart abnormalities, addressing the critical issue of heart disease, which is a leading cause of death globally. The system utilizes an ESP32 controller and Ubidots for real-time data processing and visualization, enabling timely alerts for abnormal heart conditions. The methodology includes the use of ECG sensors to capture heart signals, which are then analyzed and transmitted for further evaluation.

Uploaded by

RAVISH D K
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

published article

This paper presents an IoT-based ECG monitoring system aimed at detecting heart abnormalities, addressing the critical issue of heart disease, which is a leading cause of death globally. The system utilizes an ESP32 controller and Ubidots for real-time data processing and visualization, enabling timely alerts for abnormal heart conditions. The methodology includes the use of ECG sensors to capture heart signals, which are then analyzed and transmitted for further evaluation.

Uploaded by

RAVISH D K
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

International Journal of Enhanced Research in Science, Technology & Engineering

ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

Recording of ECG for Detection of Heart


Abnormalities Using ESP32 and Ubidots
Dr. D K Ravish1, Dr. Krishna Prasad K2
1
Post- Doctoral Fellow, Department of Computer Science and Engineering, Srinivas University,
Mangalore, Karnataka, India
2
Professor, Department of Computer Science and Engineering, Srinivas Institute of Engineering and Technology,
Mangalore, Karnataka, India

ABSTRACT

Heart Disease is the main cause of Population Death. The World Health Organization survey says that heart
ailment is the common cause of population death in the world. The heart’s main function is to pump blood into
the circulatory system of human beings; if one of its ventricles fails to work, the heart gets attacked, and in due
course, leads to death if not resuscitated on time. Most of the time, a cardiac arrest results in abrupt death before
the patients get any consideration from a medical professional. This paper proposes an Electrocardiogram
(ECG) monitoring system, which detects the heart problem using IoT (Internet of Things) applications. Since the
last few years, heart diseases are seemly a greater issue and countless people lose life because of such health
problems. Hence, heart disease should not be underestimated. By analyzing and continuously recording the ECG
signal at the first stage, heart disease would be prevented.

Keywords: Heart attack, ECG recording, Internet of Things, Ubidots, CVD prevention.

INTRODUCTION

An electrocardiogram (ECG) serves as a straightforward diagnostic tool, examining the rhythm and electrical activity of
the heart. Typically, a cardiologist or any medical practitioner suspecting cardiac issues, including general practitioners,
may request an ECG. This test is commonly employed in addition with other indicative methods to identify and track
various heart conditions. Symptoms indicative of potential heart problems, such as chest pain, palpitations, dizziness, and
shortness of breath, prompt the utilization of an ECG for further investigation.

An electrocardiogram (ECG) is a vital diagnostic tool used to identify various heart conditions. Through the
identification of specific abnormalities in the heart's electrical activity, an ECG can help diagnose a range of conditions
including:

• Arrhythmias: These are deviation in the heart's rhythm, which can manifest as the heart beating too slowly
(bradycardia), too quickly (tachycardia), or irregularly (atrial fibrillation, ventricular fibrillation, etc.).
• Coronary heart disease (CHD): CHD occurs when the blood vessels supplying the heart become narrowed or
blocked due to a buildup of fatty deposits (atherosclerosis). This can lead to chest pain (angina), heart attacks (myocardial
infarction), or other serious complications.
• Heart attacks (Myocardial infarction): A heart attack happens when there is a sudden blockage of blood flow
to a part of the heart muscle, often due to a blood clot in a coronary artery. This can cause permanent damage to the heart
muscle if not treated promptly.
• Cardiomyopathy: This condition involves
• Abnormalities in the structure or function of the heart muscle, leading to thickening (hypertrophic
cardiomyopathy), enlargement (dilated cardiomyopathy), or stiffness (restrictive cardiomyopathy) of the heart walls.
Cardiomyopathy can impair the heart's ability to pump blood effectively, leading to symptoms such as fatigue, shortness
of breath, and swelling in the legs.

To perform an ECG, small, adhesive sensors called electrodes are placed on the skin of the chest, arms, and legs. These
electrodes detect the electrical signals generated by the heart's activity, which are then recorded by an ECG machine. The
procedure is non-invasive and typically does not require any special preparation, although it may involve removing upper
clothing and possibly shaving or cleaning the chest area to ensure good electrode contact.

Page | 45
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

In summary, an ECG is a valuable tool in diagnosing various heart conditions, including heart rate related problems,
coronary heart disease, myocardial infarcts, and cardiomyopathy, by detecting abnormalities in the heart's electrical
activity.

A. Working of heart
Blood returning from the body enters the right atrium of the heart through the superior and inferior vena cava. It then
passes through the tricuspid valve into the right ventricle. From there, it moves through the pulmonary valve into the
pulmonary artery, which further divides into the right and left pulmonary arteries. The Figure 1.1 shows anatomical
structure of heart. With reference to that, it is depicted arteries carry deoxygenated (blue colour) blood to the lungs for
gas exchange in the pulmonary capillary bed, where oxygen is taken up (red colour) and carbon dioxide is released.

Conversely, the four pulmonary veins, two from each lung, carry oxygenated blood back to the left side of the heart.
Oxygen-rich blood enters the left atrium, passes through the mitral valve, and enters the left ventricle. Upon
contraction, blood is ejected through the aortic valve into the aorta, subsequently circulating throughout the body,
supplying oxygen to tissues and organs.

Fig 1.1 Heart

There exist various methods for conducting an ECG. Typically, the procedure entails affixing multiple small adhesive
sensors, known as electrodes, to the arms, legs, and chest. These electrodes are then linked via wires to an ECG
recording device. No specific preparations are necessary for the test; individuals can eat and drink normally
beforehand. Prior to attaching the electrodes, it is customary to remove upper clothing, and in some cases, the chest
area may require shaving or cleaning.

B.Electrical signals from the heart


The electrical impulse initiates at the sinoatrial node (1) situated in the right atrium and proceeds to stimulate both the
right and left atria, prompting their contraction and facilitating blood transfer into the ventricles. The physiological
function of heart is shown along with electrical signal are shown in Figures 1.2 and 1.3, this electrical activity manifests
as the P wave on an electrocardiogram (ECG). The PR Interval denotes the duration, measured in seconds, between the
onset of the P wave and the onset of the QRS complex.

Subsequently, the electrical impulse traverses from the atria to the ventricles via the atrioventricular (AV) node (2). Its
passage through this node induces a deceleration, permitting the ventricles to adequately fill with blood. This
deceleration is observable as a flat segment on the ECG between the conclusion of the P wave and the commencement
of the Q wave.

The PR segment signifies the electrical conduction across the atria and the temporal delay of the electrical impulse
within the atrioventricular node.

Page | 46
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

Fig 1.2 Electrical signals from heart


Source: electronicsinnovation.com

Once the signal departs from the AV node, it traverses through a route known as the bundle of His (3) and then divides
into the right and left bundle branches (4, 5). This signal propagation stimulates the contraction of the heart's ventricles,
facilitating the pumping of blood to both the lungs and the body. The manifestation of this signal on the ECG is
represented as the QRS waves. Given their rapid occurrence, these waves are typically viewed collectively as the QRS
complex.

Fig 1.3 Electrical signals

LITERATURE SURVEY

In recent years wireless body area network and the Internet of things have strongly emerged in the medical field for the
health care of the patient. It collects the patient’s data regard-ing the heartbeat rate and pulse rate.

Sesha Vidhya et al, proposed the measurement of the human heartbeat and body temperature using Arduino UNO and
sent the information to clients end utilizing microcontroller with sensible cost [1]. Patel et al., presented detection of
Heart attack and heart rate monitoring using IoT. It consists of an android WIFI module, a heartbeat sensor and a pulse
sensor. They have used a set-pointer through the system which helps in determining whether a person is healthy or not,
by checking their heartbeat and comparing it with the set point. If the setpoint is beyond the limit the system will send
an alert message. But there is a chance to display the false result due to varying limits in set-pointer. Gurjar et al.
proposed Heart attack recognition by heartbeat identifying using IoT.

Wolgas et al. dealt with the comparison of non-invasive heart rate monitoring system using GSM module and RF
module. Internet of things IoT based heart attack and heart rate measurement using Arduino is promising for remote
monitoring of heart rate, yet it does not offer any real-time monitoring system [2].

Isaac et al. presented a heart rate monitoring system using fingertip through Arduino and processing software. This
technology uses Node MCU (Lua based firmware for the ESP8266) and fingertip sensor. It is based on the principle of
Photo Plethysmography (PPG) which is a non-invasive method of measuring the variation in blood volume in tissue
using a light source and detector. The heart rate counting and monitoring are performed by the processing unit. But the
fingerprint sensor does not take into consideration when a person’s finger changes in sizes or form/pattern over time
[3].

Page | 47
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

Rahman et al., portrayed Smartphone-based ischemic heart disease risk prediction using clinical data and data mining
approach. The tools used in this are chi. square, ACS, IHD, Data mining. The main aim [6] of this work is to make a
simple approach to detect the risk of IHD and to avoid sudden death. The main drawback is that there is no alerting
system to alert the patient.

Pawar et al. approached the cyber-physical system for the detection of heart attack using wireless monitoring and
actuation system [7]. This involves a Cyber- Physical System (CPS) which contains a small wearable device to transmit
the ECG signal to the patient’s mobile phone. In case of any emergency or irregularities in the heartbeat, it makes an
alert. But, this model only detects heart failure that occurs due to variation in heart rate as the system is completely
based on the data gathered by ECG signals and neglects the heart failure that is caused due to smoking, obesity, alcohol
intake, physical inactivity etc.

Landaeta, et al. depicted heart attack detection using a smartphone [8]. The technology is used in this paper are data
mining, fuzzy logic. It detects the heart attack by placing the index finger on a mobile camera to determine the peak
value of blood pressure. The main idea of the proposed system is to find out the average distance between adjacent
peaks for heart rate calculation. Issac et al. presented a real-time heart monitoring system using an android application.
The technology used in this paper are CUEDETA (A Real-Time Heart Monitoring System Using Android Smartphone)
and also contains a location tracking ECG sensor. This paper is used to monitor the ECG signals of the patient and to
send alerts to his/her contacts. The alert message has been used to find the exact position of the patient through google
map. But there is a chance to detect false alerts due to arranged mode [9].

Analysis of coronary heart disease and prediction of a heart attack in coal mining regions using a data mining
technique. This paper involves various algorithms for the prediction of a heart attack. The technologies used in this
paper are, Decision Tree, Neural Network, Multilayer Perceptron (MLP), Bayesian model and SVM with an accuracy
of 82.5%, 89.7%, 82% and 82.5% respectively. According to their result, Multilayer Perceptron acquires the highest
accuracy of 89.7% as compared to other algorithms since the syndrome is a collection of symptoms, and it is a concept
which is developed employing mapping symptoms to Traditional Chinese Medicine (TCM) expert’s brain. As the
syndrome is recognized by the human brain, multilayer perceptron is considered a good model [10]. According to their
research, it may implement false alarm rate because of time series modelling and more continuous data should be used
instead of categorical data to study patient’s morbidity condition concerning clinical care.

METHODOLOGY

This presents the design and implementation of a human heartbeat rate monitoring using a heart pulse sensor and IoT-
based technology. This sensor senses the human heartbeat and is recorded. The read data are processed by the ESP32
controller and transmitted to the WiFi module for uploading to the internet server platform (Ubidots) for further analytics
and visualization. When the data was captured the same is processed and stored in real-time with a date and time stamp.
The proposed work consists of the ECG sensor unit, the power supply unit and the user interface unit as the input units.
The WiFi Module unit serves as the output unit. The ESP32 controller unit monitors and controls the signals. The system
is programmed using embedded C programming language.

The ECG sensor will sense the heartbeat. The sensed data from the sensor is transmitted to the analogue to a digital
converter (ADC) for conversion to a digital signal. The obtained digital signal is then transmitted to the ESP32 controller.
The ESP32 controller acts on the signal based on the instructions which are coded in embedded C language. Furthermore,
the data are sent in real-time to the WiFi module and transmitted to the webserver (Ubidots)for further analytics and
visualization. The analyzed data are updated synchronously in real-time to display the status of the human heartbeat rate.
It is also associated with a Buzzer and an LED, which will be active when the heart condition goes abnormal. An SMS
alert will also be sent to the Doctors.

A. Block diagrambreviations and Acronyms


The AD8232 Op-amp consists of nine connection pins and wires. The other connectors include LO+, LO-, OUTPUT,
3.3V, GND are the essential pins used for operating the Opamp with an Arduino. The block diagram of the experimental
setup is shown here in Figure 3.1. Three lead electrodes on this board are provided, RA (Right Arm), LA (Left Arm), and
RL (Right Leg). The electrodes are placed at the particular location of the body to obtain an ECG signal because only at
the particular location, the required frequency of the heart is obtained.

Page | 48
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

Figure 3.1. Blockdiagram

C. Block diagram description


The AD8232 Op-amp consists of nine connection pins and wires. The other connectors include LO+, LO-, OUTPUT,
3.3V, GND are the essential pins used for operating the Opamp with an Arduino. Also, three lead electrodes on this
board are provided, RA (Right Arm), LA (Left Arm), and RL (Right Leg). The electrodes are placed at the particular
location of the body to obtain an ECG signal because only at the particular location, the required frequency of the heart is
obtained.

D. Hardware specifications
• ESP32 Module
• AD8232 sensor
• ECG Electrodes – 3 pieces
• ECG Electrode Connector -3.5 mm
• Connecting wires

E. ESP32 Features
• ESP32 is a series of low-cost, low integrated WiFi and dual mode Bluetooth.
• Processors: CPU: Xtensa dual-core (or single-core) 32-bit microprocessor, Ultra-low power (ULP) co-
processor
• Memory capacity of 320 KiB RAM, 448 KiB ROM
• ESP32 achieves Ultra low power (ULP) co-processor with a fusion of several types of proprietary
software.
• ESP32 is capable of functioning reliably in wearable and portable environments functioning in
temperature ranges from –40°C to +125°C.

F. AD8232 ECG sensor


ECG Sensor is a low-cost board, used to acquire the electrical activity of the heart. The amplifier and associated
hardware are shown in Figure 3.2, 3.3. This electrical activity of the heart is viewed as ECG or Electrocardiogram and
output as an analogue reading. ECG signal what we obtained is noisy, therefore used AD8232 an Op-amp to obtain a
clear signal from the PR, QT and ST intervals easily. The AD8232 acts as signal conditioning for ECG, and it is also
used to amplify other bio-potential measurement signals. It is designed to amplify the bio-potential signal.

The AD8232 serves as an integrated signal conditioning module tailored for ECG and various biopotential measurements
uses. Its purpose is to isolate, enhance, and refine faint biopotential signals amidst noisy environments, including those
induced by movement or distant electrode setups. This engineering enables seamless acquisition of the output signal by
either an ultralow-power analog-to-digital converter (ADC) or an embedded microcontroller.

Fig 3.2 ESP32 module

Page | 49
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

The AD8232 built in having a two-pole high-pass filter for removing motion artifacts and compensate the electrode half-
cell voltage. This filter is integrated with the instrumentation amplifier architecture of the signal acquisition unit to allow
high gain and desired band signal in a single stage.

Fig 3.3 AD8232 ECG sensor

G. Software specifications
An ECG measuring device was designing using a ESP32 module and the coding platform used here is Ubidots. A
program, which will process, analyze and upload the ECG data, is coded using programs.

H. Ubidots
Ubidots is an IoT Platform empowering innovators and industries to prototype schema representedand in Figure 3.4,
scale IoT projects to production. Utilize the Ubidots platform to transmit data to the cloud from any web-connected
device. Following this, customize actions and notifications according to your live data, and leverage visual tools to
harness the full potential of your data.

I. Installation of ubidots
• Arduino IDE application.
• Library management.
• Board and platform management.
• Verify, upload and debug the code.

Fig 3.4 Ubidots functioning

J. Circuit connections
The AD8232 Op-amp consists of nine connection pins and wires. The other connectors include LO+, LO-, OUTPUT,
3.3V, GND are the essential pins used for operating the Opamp with an Arduino shown in Figure 3.5.

Page | 50
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

Fig 3.5 Interfacing AD8232 ECG Sensor with ESP32

Also, three lead electrodes on this unit are provided, RA (Right Arm), LA (Left Arm), and RL (Right Leg). The
electrodes are placed at the particular location of the body to obtain an ECG signal because only at the particular location,
the required signal frequency of the heart is obtained.

K. Connections setup
From the Figures 3.6 and 3.7, we can see connection setup and there are two types of ECG sensor placement on the body.
We can follow any method for the output. Second method is most preferable for the ECG sensor placement on the female
body. Here, in our project we are following the first method of placement for the output.

Fig 3.6 Connection setup

Fig 3.7 ECG sensor placement on the body


Source: electronicsinnovation.com
L Device setup
• Arduino IDE application. Connections are made as per the circuit design and are connected as shown
in the Fig 3.6.
• The program code is booted to the ESP32 module using the data cable and the boot button.
• The chest electrodes or the limb electrodes can be connected as per the convenience.
• Then the ECG will be recorded using the AD8232 sensor and will be stored in the Ubidots cloud.

Page | 51
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

• Using the Ubidots credentials one can download the application and see the ECG from anywhere
around the world.

RESULT ANALYSIS

The application then receives and interprets signal from the sensor and displays it on the screen as a plot. It involves the
implementation of an IoT based ECG measurement with AD8232 ECG Sensor and ESP32 developing kit using an online
IoT platform called Ubidots. The ECG sensor AD8232 has been interfaced with ESP32 as shown in Figure 4.1, and then
it generates an ECG signal by connecting ECG electrode in the chest of the patient. The ECG signal from a patient heart
has been viewed continuously by the Doctor using their smart phone. Using parameters of Ubidots, the ECG graph will
be sent to cloud. Hence, the heart ailment cannot be taken mildly. By analyzing and continuously monitoring the ECG
signal at the initial stage, heart disease would be prevented.

Fig 4.1 Light glowing when power supply is given

M. Android application
The application then receives and interprets ECG data acquired from the sensor and displays it on the screen as a plot. It
involves the usage of an IoT based ECG recording with AD8232 ECG Sensor and ESP32 developing kit using an online
IoT platform called Ubidots. The ECG sensor AD8232 has been interfaced with ESP32, then it generates an ECG signal
by connecting ECG electrode in the chest of the patient. The ECG signal from a patient heart has been viewed
continuously by the Doctor using their smart phone. This helps in viewing nature of the sample’s data during the time of
experiment, this dashboard output is as obtained shown in Figures 4.2(a) and (b). Using parameters of Ubidots, the ECG
graph will be sent to cloud. Hence, the heart abnormality cannot be taken lightly. By analyzing and continuously
monitoring the ECG signal at the initial stage, heart ailment would be prevented.

Fig 4.2 (a) Output from mobile phones


Page | 52
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

Fig 4.2 (b) Output from Ubidots platforms

CONCLUSION

A proposal has been put forth for an IoT-driven heartbeat monitoring system utilizing the AD8232 ECG Sensor and
ESP32 development kit. Over the past decades, the prevalence of heart diseases has escalated, resulting in numerous
fatalities. Consequently, the gravity of heart diseases cannot be understated. Early detection and continuous monitoring
of ECG signals hold the potential to prevent the onset of heart disease. The acquired ECG signal is thoroughly
examined and evaluated. IoT-enabled computational frameworks for heart monitoring serve as pivotal tools in early
diagnosis, prognosis, and management of cardiac ailments.This experimental endeavor to carry on intensive and
thorough research for data, information and investigate into the implementation of an IoT-connected, low-power
wireless sensor interface for prolonged monitoring of cardiac parameters. Consistent utilization of such a device proves
highly beneficial in the early detection of heart diseases, thus mitigating severe damage and reducing mortality rates
associated with cardiovascular ailments. Much like this intuitive ECG monitoring system, further health monitoring
systems encompassing parameters like temperature, blood pressure, diabetes, etc., can be developed leveraging IoT
technology, significantly contributing to the mitigation of prevalent health issues.

ACKNOWLEDGMENT

The authors are grateful to Dr. Ambedkar Institute of Technology, Bengaluru, Karnataka 560056 and Srinivas
University, Mangalore, Karnataka.

REFERENCES

[1] Sesha Vidhya Sudharsanam, Shanthi K G, Manikandan Arunachalam, Senthil Kumar K, “Detection of heart
problem using IoT,” International Journal of Current Research and Review(IJCRR), vol. 13, no. 8, pp. 156–161,
May. 2021, doi: 10.31782/IJCRR.2021.13909.
[2] G. Wolgast, C. Ehrenborg, A. Israelsson, J. Helander, E. Johansson and H. Manefjord, "Wireless Body Area
Network for Heart Attack Detection [Education Corner]," in IEEE Antennas and Propagation Magazine, vol. 58,
no. 5, pp. 84-92, Oct. 2016, doi: 10.1109/MAP.2016.2594004.
[3] Isaac R, Ajaynath MS, “A Real-Time Heart Monitoring System Using Android Smartphone,” IEEE India
Conference 2012.
[4] Gurjar AA, Sarnaik NA. “Heart Attack Detection By Heartbeat Sensing using Internet of Things,” Int Res J Engi
Technol., vol. 5, no.3, pp. 3332–3335, Mar. 2018.
[5] Ajitha U, Aswathi PA, Sasidaran A, Muhammed VA, Anand V,Arvind A, “IOT Based Heart Attack Detection
and Alert System,” Int J Engi Manag Res, vol. 7, no. 2, pp.285–288, Oct. 2017.
[6] A. R. Barai, M. R. Rahman and A. K. Sarkar, "Comparison of Noninvasive Heart Rate Monitoring System using
GSM Module and RF Module," 2017 2nd International Conference on Electrical & Electronic Engineering
(ICEEE), Rajshahi, Bangladesh, 2017, pp. 1-4, doi: 10.1109/CEEE.2017.8412905.
[7] P. A. Pawar, "Heart rate monitoring system using IR base sensor & Arduino Uno," 2014 Conference on IT in
Business, Industry and Government (CSIBIG), Indore, India, 2014, pp. 1-3, doi: 10.1109/CSIBIG.2014.7057005.

Page | 53
International Journal of Enhanced Research in Science, Technology & Engineering
ISSN: 2319-7463, Vol. 13 Issue 5, May-2024, Impact Factor: 8.375

[8] Gonzalez-Landaeta R, Casas O, Pallàs-Areny R. Heart rate detection from plantar bioimpedance measurements.
IEEE Trans Biomed Eng. 2008 Mar;55(3):1163-7. doi: 10.1109/TBME.2007.906516. PMID: 18334409.
[9] Mehmet Taştan, “IoT Based Wearable Smart Health Monitoring System,” Celal Bayar University Journal of
Science, Aug. 2011, pp. 343–350, doi: 0.18466/cbayarfbe.451076.
[10] Celal Bayar et al., “Monitoring System,” Uni J Sci 2018. [Online]. Available:
https://electronicsinnovation.comwith-esp32-and-
ubidots-platform.

Page | 54

You might also like