Content uploaded by Md Abdur Rahman 冉旭格
Author content
All content in this area was uploaded by Md Abdur Rahman 冉旭格 on May 30, 2022
Content may be subject to copyright.
Content uploaded by Md Abdur Rahman 冉旭格
Author content
All content in this area was uploaded by Md Abdur Rahman 冉旭格 on May 19, 2022
Content may be subject to copyright.
Content uploaded by Tanzim Nabeed
Author content
All content in this area was uploaded by Tanzim Nabeed on Jan 11, 2022
Content may be subject to copyright.
Remote monitoring of heart rate and ECG signal
using ESP32
Md Abdur Rahman
College of Computer
Science and Technology,
Donghua University,
Shanghai, China
319034@mail.dhu.edu.cn
Yue Li
College of Computer
Science and Technology,
Donghua University,
Shanghai, China
frankyueli@dhu.edu.cn
Tanzim Nabeed*
School of Science and
Engineering,
AM’s Research
Academy,
Dhaka, Bangladesh
amsresearchacademy@g
mail.com
Md Toufiqur Rahman
College of Computer
Science and Technology,
Donghua University,
Shanghai, China
toufiq_lut@yahoo.com
Abstract— Heart conditions of human body can be detected by
the electrical signal from heart which is called
electrocardiogram (ECG) and heart rate which is the number of
heart beat per minute (BPM). ECG is the result of electric signal
of heart that is caused of the heart to beat. The result is shown
as a wave on a monitor or graph paper. Heart disease has
become a very big issue nowadays. Many people get sick or even
die because of the inability to monitor their heart conditions
properly. This serious issue can be prevented by monitoring the
heart’s condition regularly. It would be great if this monitoring
can be done remotely. In this paper, such a system is proposed
by using AD8232 single lead heart beat sensor to extract the
ECG signal and pulse sensor to get the BPM. The obtained
sensor data are transmitted to the cloud server internet using
ESP32 microcontroller which has Wi-Fi capability for remote
monitoring by a health specialist. Ubidots and Thingspeak
platforms are used as a cloud server. As a result, any health
specialist can check the patient’s heart condition at anytime
from anywhere and can take necessary steps.
Keywords—ECG sensor; Pulse sensor; ESP32; IoT; Cloud
server; Ubidots; Thingspeak.
I. INTRODUCTION
Remote monitoring of heart prefers a portable medical system
by which a patient’s health condition can be checked-up and
the report can be visualized or monitored by a medical
specialist or doctor. The report is transmitted to the medical
specialist by such an electronic device which is internet
enabled. The device can be laptop, mobile phone or smart
watch [1]. While talking about internet, it has become the
most attached thing to the human life nowadays. Remote
monitoring is a blessing of internet of things (IoT). The IoT
is such a phenomenon by which an object is connected to the
internet and the connection is used to control those objects or
to monitor the system remotely. Sensors, Connectivity, Data
processing and User interface are main components of IoT.
Thus, remote monitoring is consisted with all of these
combined components. Remote monitoring of healthcare
system is a new idea which enables doctor or medical
specialist to monitor patient’s health parameters from
anywhere at any time through internet enabled medical
devices. Notification can be sent to the doctor if any abnormal
condition is detected in patient’s body. The detection is done
by using some sensors or devices like pulse sensor,
temperature sensor, blood pressure sensor etc. [2].
Heart acts as a blood pumping machine which is located
under the rib cage between two lungs which is shown in Fig.
1. It is about the size of a clinched fist. Heart is divided into
two sides (left and right) having two chambers in its two
sides. The lower chamber is called ventricles while the upper
one is atrium. Through a one-way valve, blood is flown from
the atrium to the ventricles. Blood is pumped through the
heart by a combined work of atrium and ventricles. Right
ventricles contracts to push the blood to the lungs. Bloods get
oxygenated in the lungs and returns to the left atrium through
four pulmonary veins. Atrium pushes blood to the left
ventricles which pumps back all the blood to the body. The
total cardiac cycle takes about 0.8 seconds and occurs 60-100
times per minute in a normal heart. The heart beats in
rhythmic way which is driven by the electrical impulse for
which the conductive system of heart responsible. The
sinoatrial node or SA node, also known as the natural
pacemaker of the heart, generates electric impulse which
travels through the heart in a defined rhythmic pattern.
Electric impulses pass from the atria to the ventricles through
AV node or atrioventricular node. So, AV node is called the
natural gate keeper of heart through which the electrical
impulses are passed.
Then the electrical impulses are passed to the Purkinje fibers
through the bundle of HIS which makes the ventricles
contract. The heart is a complex organ of a body. The electric
pulses as well as the heart rate is a crucial parameter in the
working of the heart. So, monitoring heart rate is very
important to ensure a healthy life.
Figure 1. Schematic diagram of human’s heart
Modern heart monitoring system refers to a system which
gives the constant monitoring of heart and notifies the doctor
if any abnormal condition is detected [2]. However, IoT
healthcare system has become very popular nowadays having
the feature with real time monitoring system [3]. Heart
disease has become very common in recent days. People can
die instantly having heart failure. So, continuous real time
monitoring is necessary to take instant action. This
monitoring can be done wirelessly, with wired connection or
remotely by a healthcare monitoring system. The example of
remote monitoring system can be given by wrist band having
pulse and ECG sensor in it to detect heart attack and if heart
attack is detected, a system which can provide medical
facility can be notified by pressing a panic button in it. The
device communicates with the system by a Bluetooth device
[4]. Real time monitoring can be a great advantage as doctor
cannot always keep their eye on their patients. So, the data
can be observed by them remotely from anywhere by using
Thingspeak IoT platform [5]. Heart rate monitoring system
with heart rate sensors, Arduino and Wi-Fi module can be a
great option to detect heart rate and with IoT, this system can
notify doctor if heart disease is detected [6-7]. The heart rate
sensor uses the intensity of light to detect heart disease.
Detecting the exact location to find where the patient is
staying by using a GPS module can be also a part of heart rate
monitoring where Bluetooth module is used to make
communication with the system and IR sensor to create PPG
(photoplethysmography) to detect heart rate [8]. ECG data
without ECG sensor or pulse sensor can also be visualized by
computer monitor to detect heart rate by using IR emitter-
detector pair. An IC named 741 op-amp amplifies the output
signal of the sensor [9]. Using mobile phone to send messages
containing data of abnormal heart rate signal is a very big
advantage using GSM Modem. Doctor staying anywhere can
get notified by a simple mobile phone SMS in this system.
The system uses Microcontroller, heart rate sensor and
interface circuit [10].
In this paper, the main component of the system is the
microcontroller which is named ESP32. The microcontroller
collects the sensor data and send them to the cloud server for
remote monitoring. As ESP32 has the Wi-Fi capability thus
it uses the internet connection to send the sensor data. Two
sensors are used in the system. One is AD8232 Single lead
heart rate sensor which has sensor pads. The sensor pads
collect electrical signal of the heart. Another one is pulse
sensor which uses PPG to collect beat per minute (BPM) from
the vein of the finger. The data is showed in a monitor of a
personal computer. The data can also be transmitted to the
IoT platforms named Thingspeak and Ubidots for real time
monitoring as a doctor can observed them from anywhere at
any time. The system architecture of the system is shown in
Fig.2. In general, the main contribution of this paper is given
below:
Figure 2. System Architecture of the proposed system.
1. For real time monitoring of healthcare, a system has to be
proposed which ensures continuous data transmission. In this
paper, an effective system has proposed with latest sensors
which can transmit data for real time monitoring.
2. Statistical analysis of real time data of the patients can save
one from getting into critical condition and in global
pandemic situation.
3. Developing a IoT platform for the healthcare industry with
low-cost, effectivity and reliability.
II. LITERATURE REVIEW
In the recent few years, remote health monitoring system has
become very popular and heart is the main focus of among
them. Thus, several works have been done on remote heart
monitoring system. Various works on modifying the remote
heart monitoring system has been presented and published by
various researchers and authors. Several works have done on
real-time observation of patient’s heart and so on the body.
Before entering this field, numerous papers are followed and
studied and their contribution are given in Table.1. In order
to present the recent progress on remote health monitoring
system, some of the recent works have been provided here.
Among them Global Positioning System (GPS) module,
Bluetooth module, Global System for Mobile communication
(GSM) technology, Wi-Fi module are used for real-time
monitoring for implementing the system and ECG sensor,
Pulse sensor, Temperature sensor, Infrared sensor (IR),
Operational Amplifier(op-amp) are used to take different data
from human body. Using them, different system was
presented in order to satisfy different condition. Therefore,
how the monitoring system will be designed mostly based on
the terms and conditions of the application. Lastly,
considering all the related works delineated in Table.1., a
remote heart monitoring system using pulse sensor and ECG
sensor at the same time to detect heart disease based on ECG
and BPM is designed where real-time monitoring is the most
serious issue.
TABLE 1. Related works on the heart rate monitoring system.
Authors
Contribution
Shikha,
E.Sriranjini [4]
Designed a wrist band using ECG
and Pulse sensor to detect heart
attack where Bluetooth device was
used for communication purpose.
Rajashree, Radha
BK [5]
Implemented a real-time health
monitoring system using Thingspeak
cloud server for mobile application.
Nikunj Patel,
PrinceKumar
Patel [6]
Designed a real-time heart rate
monitoring system using Arduino,
heart rate sensor and Wi-Fi module
for communicating with server.
Neramitr
Chirakanphaisarn,
Thdsanee
Thongkanluang
[7]
Designed and implemented a heart
monitoring system for people aged
20-80 which uses the intensity of the
light to detect heart disease and the
data stored in a SD card for
maintaining patients heart rate
characteristics.
Bandana Mallik,
Ajit Kumar Patro
[8]
Designed a monitoring system with
GPS module to locate the patient’s
location where IR sensor was used to
detect heart diseases and
communication was done by
Bluetooth module.
Ranveer Kumar
Singh [9]
Implemented a heart rate detector by
using IR-emitter detector to detect
heart abnormalities where an op-amp
was used to amplify the heart rate
signal.
Qun Hou [10]
Developed a electro cardio signal
detector which can detect heart signal
by using heart rate sensor and
AT89C52 microcontroller and can
send the data over mobile phone
using GSM technology.
Duaa Elsayed
Idris Babiker [11]
Designed a heart rate monitoring
system using Pulse sensor and
temperature sensor.
Nusrat Jahan
Farin, S.M.A
Sharif, Iftekharul
Mobin [12]
Designed a system with pulse sensor
and Arduino that can collect
physiological data from human body
and show the real-time data which
can be stored also.
Sufiya S Kazi,
Gayatri Bajantri,
Trupti Thite [13]
Developed a system which uses
raspberry pi to publish the sensor
data to a local host network. The
output can be showed by mobile
phone or personal computer.
Zhe Yang, Qihuo
Zhou [14]
Designed a wearable real-time ECG
monitoring device which used a Wi-
Fi module to send data to the cloud
using MQTT and HTTP protocols.
D. L. Larkai, R.
Wu [15]
Developed a system for aged people
using Bluetooth module and electro-
optical sensor which gets data from
fingertip and can contact to the
nearest hospital while needed.
Kanimozhi. G,
Hema Shruthi. G,
Xiao-Zhi [16]
Developed a system with Samsung
Gear S3 smart watch that could count
inter beat intervals and sends that to
the server by the help of JavaScript
that uses Java code.
III. METHODOLOGY
A. ECG Sensor:
ECG waveform: ECG records electrical conduction signals
of the heart as characteristics lines by using external
electrodes. The deflections from baseline on ECG are
described by 5 alphabets (P, Q, R, S, T). Fig.3. shows an ideal
ECG waveform. The atrial depolarization is reflected by the
P wave. Generally, impulse is directly connected to the left
and right atria which arises from the pacemaker cells of the
SA node or sinoatrial node. The ECG waveform of a healthy
person doesn’t show the atrial repolarization on the ECG
graph. The P wave leads the QRS complex. The QRS
complex correlates to the depolarization of the both
ventricles. The outer layer of myocardium is distributed by
the depolarization wave from the inner layer of it. Q wave
denotes negative downward direction as the first time in the
QRS complex. General Q wave reflects depolarization of
ventricular septum.
Then comes R wave which pursues as an upward direction.
The S wave which is after the R wave denotes a downward
deflection. The repolarization of the ventricles is denoted by
the T wave. The distance between the starting of the QRS
complex and the highest peak point of the T wave is called
the absolute refractory period. The rest portion of the T wave
is called relative refractory period. Refractory period is the
interval during which cardiomyocytes don’t responds to
stimuli. During absolute refractory period cardiomyocytes
don’t respond on stimuli at all, but during the relative
refractory period a new action potential may be elicited under
some circumstances.
Figure 3. An ideal ECG waveform
Here, Ad8232 single lead heart rate sensor is used as ECG
sensor to measure the electrical activity of heart for a certain
period of time of the patient. The electrical activity of the
heart can be monitored over a serial monitor or the output can
be sent to cloud server for monitoring. Fig.4. shows the
electrical activity of the heart which is obtained from Arduino
serial monitor.
Figure 4. Electrical activity of the heart obtained from Arduino serial
monitor.
The graph can be transmitted to cloud server for remote
observation. The single lead heart rate sensor has three
electrodes with different colors of cable. These are Red,
Yellow and Green. The electrodes are connected to the sensor
pads. The closeness of the heart and sensor pads are the
confirmation of the better measurement. Table 2. shows the
associate sensor pads colors and their placements to the body.
TABLE 2. Table containing sensor pad colors and their placement.
Sensor Pad Colors
Placement
Red
Right Arm (RA)
Yellow
Left Arm (LA)
Green
Right Leg (RL)
Fig.5. shows how ECG signal is extracted from a patient’s
body. Ad8232 single lead heart rate sensor has 9 connection
pins including 3 electrodes or sensor pads which are
connected to the body. Fig.6. shows the diagram of AD8232
ECG sensor. Rest 5 of 6 pins are connected to the
microcontroller to extract the signal and show them through
the serial monitor or cloud server [17].
Figure 5. Connection of AD8232 with body
Figure 6. Pin diagram of AD8232 Single lead heart rate sensor
B. Pulse Sensor:
Pulse sensor is also known as heart beat sensor having two
sides. Two sides of the pulse sensor are shown in Fig.7. (a).
A LED along with a light sensor is placed in one side and the
other side contains some electronics or circuitry.
(a)
(b)
Figure 7. (a). Pulse Sensor with pin diagram, (b) method of wearing
It has three connection pins [18]. Fig.7. (b). shows how it is
used on the finger. The ideal value of heart rate for a healthy
adult is 60 to 100 beats per minute (bpm). The sensor is used
to measure the heart rate that is bpm as well as to extract the
electrical signal from which heart rate can be measured.
Fig.8. shows the electrical signal of heart from which heart
rate can be measured. It is found from the serial plotter. BPM
can be measured from the graph.
Figure 8. Electrical signal of the heart
Here, 1 second = 2 large square boxes
So, 60 seconds = (2*60) = 120 large square boxes
Now,
Heart Rate =
=
=86 (approx.) [19].
Which is normal bpm for an adult healthy person.
C. ESP32 Development Board:
Esp32 is similar microcontroller with integrated Wi-Fi and
Bluetooth. It is a series of low-power and low-cost system on
a chip-microcontroller. It can be connected to the internet for
the Internet of Things (IoT) using Wi-Fi [20]. The pin
diagram of such microcontroller is shown in Fig.9.
Figure 9. Esp32 Development Board with pin diagram.
D. Implementation:
The picture of the hardware implementation of the proposed
system are shown in Fig.10. and Fig.11. In both case ESP32
is the main component of the system.
Figure 10. Hardware implementation of sensor AD8232 with ESP32 to
extract the ECG data.
Figure 11. Fig.12. Hardware implementation of pulse sensor with ESP32
for getting BPM.
In Fig.10. Ad8232 single lead heart beat sensor with three
sensor pads extract electrical signal of heart. Here, ESP32 is
connected to the laptop or PC for getting its power. Esp32
supplies the needed power to the AD8232 heart beat sensor.
It should highly recommended to cut the power off of the
laptop from the charger while using this sensor to avoid the
extra noise. The three sensor pads collect the electrical signal
of the heart. In Fig.11. pulse sensor is connected to the
ESP32. The LED along with the light sensor of the pulse
sensor collects the heart beat signal from the vein of the finger
and from that signal bpm can be calculated. It also gets power
from ESP32 which is connected to a PC or Laptop. In both
case the sensor data are sent to the IoT cloud server. Here
both Ubidots and Thingspeak applications are used for
receiving the transmitted data of ECG and pulse sensor
respectively. After receiving the data, it can be seen by a
doctor from anywhere. Fig.12. and Fig.13. represents the
block diagram and flow-chart of the following system.
Fig.13. shows the development of the system where, after
started the system it would check whether there is internet
connection or not. If internet connection is presented there
then the received sensor data are transmitted to the cloud
server (i.e. Ubidots and Thingspeak).
Figure 12. Block diagram of the proposed system.
E. Simulation Result:
After implementing the total system and getting proper
internet connection the obtained result can be seen from IoT
cloud server. Ubidots and Thingspeak application are
responsible here to show the obtained result of ECG data and
Pulse sensor data respectively. The developers are offered to
publish the obtained data easily to the internet by both the
applications. These data can be easily visualized by any
Figure 13. Flow-chart of the proposed system.
Figure 14. ECG data shown in the Ubidots cloud server
Figure 15. Pulse sensor data shown in the Thingspeak cloud server
doctor and then he can make necessary steps by observing the
patient’s heart condition. So, here Ubidots and Thingspeak
platforms are used to the Iot cloud from the microcontroller
(i.e. ESP32). Fig.14. represents the ECG data extracted from
the sensor. The graph is shown to the internet from where a
doctor can access it. The graph represents an ECG data of a
patient’s heart. Thus, real time analysis can be possible by
this way. Fig.15. represents the pulse sensor data or BPM
which comes from the finger where pulse sensor was
attached. The figure shows 9 real time values of BPM which
can be seen by a doctor. Thus, the doctor can take necessary
steps if he finds some irregularity here.
IV. CONCLUSION
Health monitoring system becomes an impressive issue in the
modern era of development. The advantage would be one step
ahead if the monitoring can be done remotely from anywhere
of the world. The demand of remote health monitoring system
has risen up for its greater mobility and quicker
responsiveness. Human heart is one of the most sensitive and
serious organs of human body. In this system, various
diseases and conditions of heart can be detected by the sensor
data. The data can be observed from anywhere of the world
by the availability of internet. ECG and the value of BPM are
the most useful and important indicators of heart. These data
can define the normal and abnormal condition of heart. Here,
these data are collected by two different sensors and shared
in the cloud server through an IoT device which can be
monitored by doctors all over the world. Also, the real-time
observation of the data can notify a doctor as soon as any
abnormal condition is detected. Doctors can take necessary
steps instantly if any abnormal condition is detected. The
whole setup is very cheap, effective and time saving at a time.
It can be produced both commercially and non-commercially
at a very low cost and also maximum profit can be earned by
using this phenomenon.
ACKNOWLEDGEMENTS
The authors are thankful to the reviewers and editors for their
instructive comments and corrections that helped us to
improve the manuscript. The first and fourth authors wish to
thank Professor Yue Li, College of Computer Science and
Technology, Donghua University, Shanghai, China for his
intellectual and potential supervision for preparing a world
class research article and manage the found
(12100000425006176T 东华大学) for publication. Also
authors are thankful to Abdulla – Al – Mamun, Founder,
AM’s Research Academy, Bangladesh for his intellectual and
potential support for this research article. Finally, all authors
would like to express the deepest sense of gratitude to the
researchers of supported journal of nonlinear field.
References
[1] Agham, N.D., Thool, V.R., Thool, R.C.: Mobile and web-based
monitoring of patient’s physiological parameters using LABView.
IEEE India Conference (INDICON) (2014).
[2] Abasi Julius1, Zhang Jian-Min2 “IoT Based Patient Health Monitoring
System Using Lab VIEW and Wireless Sensor Network” International
Journal of Science and Research (IJSR), Volume 6 Issue 3, March
2017.
[3] M. Hassanalieragh et al., "Health Monitoring and Management Using
Internet-of-Things (IoT) Sensing with Cloud-Based Processing:
Opportunities and Challenges," 2015 IEEE International Conference
on Services Computing, New York, NY, 2015, pp. 285-292
[4] Shikha, E.Sriranjini, Manju Jose, Dr.Sasi Kala Rani, “ IoT based Heart
Attack detection using the Wristband” International Journal of
Advanced Research, Ideas, and Innovations in Technology, Volume 4,
Issue 2.pp-2026-2031.
[5] Rajashree, Radha BK. “Real-Time Ambulatory Monitoring System”
International Reseach Journal of Engineering and Technology.
Volume: 04 Issue: 05, May -2017, pp 605-611.
[6] Nikunj Patel, PrinceKumar Patel, Nehal Patel “Heart Attack Detection
and Heart Rate Monitoring using IoT” International Journal of
Innovations and Advancements in Computer Science, IJIACS, Volume
7, Issue 4,pp 612-615.
[7] Neramitr Chirakanphaisarn, Thdsanee Thongkanluang, Yuwathida
Chiwpreechar “Heart rate measurement and electrical pulse signal
analysis of subjects span of 20-80 years” Journal of Electrical Systems
and Information Technology 5 (2018) pp-112-120.
[8] Bandana Mallik, Ajit Kumar Patro “Heart Rate Monitoring using
Finger Tip through Arduino and Processing Software” International
Journal of Science, Engineering and Technology Research, Volume 5,
Issue 1, January 2016, pp-84-89.
[9] Ranveer Kumar Singh “IoT based Heart Rate Monitoring System”
International Journal of Innovations and Advancement in Computer
Science, Volume 6, Issue 10, October 2017, pp-453-455.
[10] Qun Hou, "Research and implementation of remote heart rate
monitoring system based on GSM and MCU," The 2nd International
Conference on Information Science and Engineering, Hangzhou, 2010,
pp. 2293-2296.
[11] Duaa Elsayed Idris Babiker. “Arduino Based Heart Rate Monitoring
and Heart Attack Detection System” The University of Khartoum.
Index no.124046. October 2017.
[12] Nusrat Jahan Farin, S.M.A Sharif, Iftekharul Mobin “An Intelligent
sensor based system using Real Time Heart Rate Monitoring (HRM)”
Intelligent Control and Automation, Vol.7, 26 May 2016, pp-55-62.
[13] Sufiya S Kazi, Gayatri Bajantri, Trupti Thite “Remote Heart Rate
Monitoring System using IoT” International Research Journal of
Engineering and Technology. Volume 5, Issue 4. Apr-2018, pp-2956-
2962.
[14] Zhe Yang, Qihuo Zhou, Lei Lei, Kan Zheng, Wei Xiang “An IoT
cloud-based Wearable ECG Monitoring System for Smart Healthcare”
Journal of Medical Systems. Springer. 29 October 2016.pp 1-18.
[15] D. L. Larkai and R. Wu, "Wireless Heart Rate Monitor in Personal
Emergency Response System," 2015 IEEE 18th International
Symposium on Design and Diagnostics of Electronic Circuits &
Systems, Belgrade, 2015, pp. 299-300.
[16] Kanimozhi. G, Hema Shruthi. G and Xiao-Zhi Gao," Mobile Tower
Radiation Impact on Biological Impairment", International Journal of
Civil Engineering and Technology (IJCIET) 9(11), 2018, pp. 443–454.
[17] https://learn.sparkfun.com/tutorials/ad8232-heart-rate-monitor-
hookup-guide/all
[18] https://components101.com/sensors/pulse-sensor
[19] https://emedicine.medscape.com/article/1894014-overview#a5
[20] https://esp32.net/