Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views7 pages

Ojs Admin,+393

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

Ojs Admin,+393

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

University of Thi_Qar Journal for Engineering Sciences ISSN :2664- 5572 ( online)

http://www.doi.org/10.31663/tqujes.11.2.393(2021) ISSN:2664-5564 (print)


Vol 11.2( April 2021) Available at http://jeng.utq.edu.iq
utjeng@ utq.edu.iq
Remote ECG signal monitoring and classification based on Arduino with
AD8232 sensor
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2)
Thi-Qar University, Iraq.(1)
Al-Nahrain University, Iraq.(2)

Email: [email protected]

Abstract

Real time monitoring with IOT is developed in the industry of health care , this can enable the doctors and specialist to
diagnosis the patient status in quick, smart and efficient methods. Although, there is a lot of research and studies are
designed methods for observing the ECG signal remotely, there are no proposed methods for classifying these signals
with monitoring, and therefore , to design complete health care system, classification techniques should be used to
classify the extracted signal. In this paper , We have proposed ECG monitoring and classification system. The proposed
system is extracted ECG signal based on AD8232 sensor with the ardunino nodeMcu, analog to digital converter and its
communication is used to convert the signal to more precision , then the extracted signal is transmitted to cloud to be
used at anywhere by using cloud, the signal is pre-processed to remove the noise and QRS complex is detected to
determine the other characteristics of the signal such as heart rate, also to determine one cycle of ECG signal, later the
signal is classified by using proposed convolution neural network model to detect the signal status. The extracted ECG
signal is transmitted in real time to cloud (Ubidots cloud is used) through ESP8266 over to the cloud using WiFi based on
MQTT publishing method. The experimental results are performed on different signals and the different stage of de-
noising and QRS detection are applied and different pooling layers are used in the proposed CNN model. The results
show that the proposed classification model is achieved accuracy (94.94%) with ( 94.56%), (94.56% ) and ( 5.06) for
sensitivity, specificity and error rate (ERR) respectively.

Keywords: IOT, ECG, CNN, and Cloud.

1. Introduction the waveform of these part especially QRS complex,


which is detected by shorten, widening or lengthening
Internet of things (IOT) is principle of being able to QRS complex.[1,2,3,4]
manage, analysis and control specific object at anywhere
by using internet, different devices of network are
connected by means of different physical media, which is
accomplished by sensors, that receives the signal from real
averment in the world, then this data is transmitted by
utilizing the internet to specific cloud to be used by
specialist for monitoring, controlling and make decisions
based on different algorithms and methods.

IOT can be used widely in medical application. For


older people, who are suffered from cardio disease , real Figure (1) ECG waveform.
time monitoring can provide the doctor with very
important information about heart activity, the most In this paper , We have proposed ECG monitoring
significant means of heart activity status is and classification system, at first, ECG signal is extracted
electrocardiogram (ECG)signal, The typical ECG signal is based on AD8232 with the arduino , then de-noising
shown in figure (1), it is constructed from P-wave, which processing is used to remove the noise from the signal
represents the upper champers activity of the heart, QRS based on enhancement . Latter , QRS complex detection is
represents the most important champers of the signal and it used to detect peak of the signal, finally CNN model is
is used for analysis the status of the heart, also it is used designed to be used for ECG classification. The sensed
to determine the other characteristics of the signal, the data will be transmitted to Web server , from this web
other part is T wave , which is show the activity of lower server, anyone can monitor status of patient at anywhere
champers, So any problem in the heart can be reflected on of the world, later data are downloaded to be used as input

95
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2) Remote ECG signal monitoring and classification based
on Arduino with AD8232 sensor

to classification system. We are used Nodemcu esp8266 Arduino , then de-noising processing is used to remove the
microcontroller, which is used MQTT connection in noise from the signal based on enhancement . Latter, QRS
Webserver(Ubidots cloud), then the data is transmitted complex detection is used to detect peak of the signal
according to the programmed Wi-Fi and specified finally CNN model is designed to be used for ECG
allocated IP address [5,6]. classification.

2. Literature Survey 3. Proposed System Methodology


In the literature review, there are different study and The proposed system is shown in figure (2), it is
research are proposed using different methods to constructed from four main parts, the first part is signal
implement the ideas of ECG signal monitoring , some of extraction, which is performed by AD8232 sensor ,it is
which are depend on raspberry pi and the other are used used to collect the ECG signal from human body and send
arduino for extracting the ECG signal from human body it by ardunio (NodeMcu8266) .The second part, which
then sending it to the specified cloud, or to use it directly represents signal enhancement and de-noising is used to
by sending it to central computer. enhance the signal from the noise ,while the third part
represents the QRS complex detection, that can be used to
Warish D. P. are used Raspberry Pi 3 with ECG determine some characteristics of the signal such as heart
sensor , temperature sensor to monitor state of patients in rate (HR) , while the last stage of the system is
real time manner . This method is used by specialist to classification of the signal, which is performed by anew
detect health problem, also they are used Deep Neural CNN model, which is designed based different pooling
Networks (DNN) to analysis and process the collected layers using wavelet transform , Gaussian based wavelet
information of patient [7] . Jasti Sowmya S. et al. proposed transform pooling layers and half Gaussian pooling
monitoring the patient continuously based on using methods [13-15 ] are used in CNN classification network,
sensors such as of temperature sensor , pulse rate and in addition to Max. pooling and average pooling methods
ECG sensor . The sensors are read data in real time , and [16,17].
according to the this values of sensor , the system will
alert patient and patient’s relative by SMS to the android
mobile if up normal value is sensed otherwise the reading
is repeated [8]. Surekha. N. et. al. are proposed health
monitor system by using different sensors such as , blood
pressure sensor , temperature sensor, ECG signal , then
the data are collected and monitored using
microcontroller device, according to the proposed system
anyone anywhere in world can monitor status of
patient’s health based on connection to internet [9] .
Rohit Kumar D. et. al are used different sensors for
sensing real time patient status based on ECG sensors,
blood pressure sensor, etc. . The proposed method includes
processing of data , which is used to send extracted data to
specified staff by using Internet of things (IOT) [10] . K.
Seena Naik et al. are introduced a new monitoring
method by using different sensors such as ECG sensor
and heartbeat sensor, which are connected with Raspberry
Pi microcontroller , the sensors are gathered data in real
time and used 3G to display collected data on LCD
devices and also it is displayed on doctor’s device [11].
Ayaskanta M. et al. are proposed smart health monitoring
system, which is implemented based on AD8232 heart
sensor to monitor heart rate by send the sensed data is
transmitted in stream of data to cloud by using wireless
module , then this data t will be displayed on web server
[12].

Although, there is a lot of research and studies has


designed methods for observing the ECG signal remotely,
there are no proposed methods for classifying these signals
with monitoring, and therefore , to design complete health
care system, classification techniques should be used
classify the extracted signal, in this paper. We have
proposed ECG monitoring and classification system, at
first, ECG signal is extracted based on AD8232 with the Figure (2) proposed ECG classification system.

96
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2) Remote ECG signal monitoring and classification based
on Arduino with AD8232 sensor

device and arduino. [11] , its clock is generated by


arduino, the rate of transmitted data of this ADC/
3.1. ECG Signal Extraction ADS1115 is from rates up to 860 samples per second. This
A remote monitoring and controlling of healthcare rate for samples are decides based on sampling rate ,which
system by means of using sensors devices can be is software programmed by choosing sampling duration.
implemented in a global network by using arduino with This device is single supply operated and the range of
sensors and other interfaces devices . The sensor devices voltage between 2.0 to 5.5V. The supply of arduino is
collect , gathers and share the required information with 3.3V, hence it can be used to power the ADS1115 ADC
each other to be used for analysis , monitor and control which is also used for AD8232, also it is work specified
data with high accuracy. The proposed system is from –40°C to 125C. Figure (4) shows the detail
constructed from the following components. description of ADS1115 ADC.

i. ECG sensor (AD8232)

This device is integrated signal conditioning for ECG


and other bio-potential applications of measurement. It is
used to extract bio-potential signals in the presence of
noisy conditions which can be amplified and filtered to
reduce some noise such as those created by electrode
placement or motion. This design can allow for an power
analog-to-digital converter (ADC) or an embedded
microcontroller to extract output signal easily. The
AD8232 is used a two pole high pass filter to eliminate -A-. -B-
the noise that is produced from motion artifacts. This filter Figure (4) ADS1115 ADC, A-integrated circuit. B- block diagram of pin.
can be coupled with architecture of instrumentation of
amplifier to achieve high gain with high pass in a single
stage. AD8232 have a fast restore function that can reduce iii. Arduino ESP8266
duration of long settling tails of high pass filters. After an
signal change that rails the amplifier (such as a leads off The Arduino ESP8266 is an open-source
condition), AD8232 adjusts to a higher filter cutoff microcontroller that can be used in different application
automatically. This advantage can recover AD8232 .This board is equipped with digital and analog
quickly, and take valid measurements soon after input/output (I/O) pins , that can be interfaced with
connecting electrodes to the subject. Performance for the various other boards (shields) or circuits. The
A grade models is Rated temperature range from zero °C programming is performed based on Arduino IDE
to 70°C and working with temperature range from - software. The most important advantage of this
40°C to 85°C, the description of this device is shown in microcontroller is that it have the WiFi and Bluetooth ,
figure (3) [18-20]. which can be used in most application of IOT, the diagram
of this microcontroller is shown in figure (5).

-A- -B-
Figure (3) AD8232 ECG sensor device. A- components . B-pin diagram .

ii. Analog to Digital conversion ADC (ADS1115)

The ADS1115 device is 4-channel 16-bit with low


cost analog to digital converter. It can be used to take four
channel input and converts them to 16 bit digital value.
The serial peripheral interface (SPI) is used as bus to Figure (5) pin diagram of ardunio nodemcu.
perform synchronous serial communication between this
97
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2) Remote ECG signal monitoring and classification based
on Arduino with AD8232 sensor

3.2. ECG signal De-noising

Because that ECG signal contains different types of


noises such electrode motion (EM) , baseline wander
(BW), and muscle artifact (MA). Baseline is low
frequency can be arises from breathing, skeletal muscle
activity generate muscle artifact, while the change in the
electrode skin impedance will cause electrode motion
noise [21]. Unfortunately, these noise can reduce the
accuracy of diagnosis, so the raw signal should be de-
noised to reduce the effect of the noise, which can be
satisfied by using wavelet transform and applying
threshold as shown in figure (6), where the wavelet
transform is applied to isolate the frequency band, then
high frequency components of the signal is applied to
threshold to reduce the noise which is contended as high
frequency [22].

Figure (8) proposed 1-D CNN model

Figure (6) ECG de-noising system.


4. Experimental Results and Discussion
3.3. QRS complex Detection The system is implemented and the hardware
component of the work is programmed by using
QRS complex part of the ECG signal represents most arduino IDE, while the pre-processing and
important characteristics of ECG signal, which is used to classification software are performed by using mat lab
diagnosis problem of the heart, so it is necessary to detect 2020a with Cori 7,2.4GH CPU. The proposed
this peak to detect these features. In this paper, We are classification model is trained and tested using MIT-
used the detected QRS to determine one cycle from the BIH ECG dataset [23,24]and the result are displayed
ECG signal to be used as input to classification stage . The .The ECG sensor is extracted the real signal from the
original signal is applied to DWT, then approximation body as shown in figure (9), which shows the real
coefficients of the transform will be used to determine the plotted signal in arduino IDE terminal , then the signal
basic features to detect peak of the signal as shown in is published to the cloud (Ubidots cloud) as shown in
figure (7) [4]. figure (10), which represents screen shoot to procedure
of transmitting the data to the cloud, then the data will
be available on the server website and anyone can log
in and obtain the required information.

Figure (7) ECG de-noising system.

3.4. ECG Classification

We have design a new one dimension CNN model


(1-D CNN) which is constructed from different layers as Figure (9) extracted signal using AD8232 sensor.
shown in figure (8). The input is csv data ECG signal , this
input is passed through sequential layers of convolution,
rectified linear unit layer (ReLu), pooling, add, fully and
dense layers with the sequence that is shown in figure(8),
which describes the details of the proposed model.
Different pooling layers are used in the proposed model,
these layers are used to extract the best features of the
convolution output through the convolution neural
network , these layers can overcome the disadvantages of
the standard pooling method (Max. pooling and average
pooling method).

98
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2) Remote ECG signal monitoring and classification based
on Arduino with AD8232 sensor

Figure (10) screen shoot for real time publishing of ECG data to
Ubidots cloud.

The result of de-noising and QRS complex detection


for the extracted signal1 are shown in figure (11),which
shows the de-noising stage to reduce the noise , also QRS
complex is detected , it is clear the difference between the
raw the signal, which have redundant in high frequency
due to movement of electrode of the sensor, also the ECG
cycle can be determine as shown in figure (12), then the
waveform of one cycle for ECG is determined depending
on HR based on QRS detection as shown in figure (11).
The result for signal 2 is shown in figure (13) and figure
(14) respectively.

Figure(13) extracted signal , de-noised signal and QRS complex


detection. For signal 2

Figure(14) One Cycle ECG signal for extracted signal 2.

The raw ECG signal should be processed to be suitable


input to the classifier, these steps are shown in figure (15) .
Figure (16) shows the original raw signal, that is extracted
using proposed ECG extraction model . The original signal
is fragmented into isolated cycles as shown in figure (17)
Figure(11) Extracted signal , de-noised signal and QRS complex
detection for signal 1. to be classified later by the CNN model. The
fragmentation is performed based on determining the QRS
peak with respect to the number of sample for each cycle
to isolate each cycle from the other .As shown in these
figure , the sampling rate is less than 184 sample ( the
sample rate of the classification model for one ECG cycle
), this signal should be up sampled to be input to the
classification model. The resolution (up sampling) is
shown in figure (18), this up sampling is accomplished by
using averaging method to increase the sampling of the
signal. Pre-processing is the final stage of preparation of
Figure(12) One Cycle ECG signal for extracted signal 1. the signal to be input to the classifier. As we mention
previously , the sampling rate should be 184 sample , so
the signal should have this number of sample, also the
signal should be normalized , because the signal is
measured in µv, so it must be converted to mv, all this
preprocessing is shown in figure (19).

99
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2) Remote ECG signal monitoring and classification based
on Arduino with AD8232 sensor

In the proposed classification CNN model, We are


used different pooling layer to extract the features of
convolution layers in the proposed CNN model and the
Raw ECG signal
results in terms of accuracy are described in Table (1),
which shows that HGT method is achieved best result
(94.94%) verses (93.97%) for GWT pooling methods
Signal Fragmentation [13,14] , (94.58) for (wt+ max )method, while the other
performance metrics are shown in Table (2).The best
results are satisfied with ( HGT)method [24], also it is
Up sampling achieved( 94.56%), (94.56% ) and (5.06) for sensitivity
specificity and error rate (ERR) respectively.
Table (1) Results of classification stage for different pooling layers.
Pre-processing
Method Max Average Wt+max Wt+average GWT HGT
Figure (15) ECG cycle extraction steps. [Ref. 16] [Ref. 17]
Accuracy 93.27 94.01 94.58 94.38 93.97 94.94
(%)

Table (2) Performance measures for classification stage for


Wt+ma
Method Wt+average GWT HGT
x
Accuracy (%) 93.27 94.27 93.97 94.94
Sensitivity(SN%) 93.23 94.21 94.21 94.56
False positive Rate
6.67 5.73 5.79 4.44
FPR(%)
Specificity (%) 94.24 94.56 94.56 94.56
ERR(%) 6.63 5.63 6.03 5.06
Figure (16) original signal . different pooling layers

5. Conclusions
Internet of thing can be used in medical field to
monitor, control and classify the status of patient remotely,
so different research and methodology are developed to
introduced a new application in health area. In this paper,
We have proposed anew ECG monitoring , controlling and
classification system based on deep learning convolution
Figure (17) fragment of original signal . neural network (CNN), because ECG signal is very
significant measure to diagnosis the problem of human
heart, which can be used to diagnosis the cardio disease .
The proposed ECG signal is extracted the ECG signal
based on AD8232 sensor with ADS1115 analog to digital
converter, which is connected to arduino NodMcu , and
its communication and implementation are programmed
by using arduino IDE terminal ,because the extracted
signal have some types of noise, de-noising and
enhancement algorithms are applied to improve the quality
of the signal based on wavelet transform with adaptive
Figure (18) fragment after resolution (up sampling) . threshold. Then QRS complex detection is performed to
determine one cycle of ECG to be used as input to
classification stage , then classification is performed by
using the proposed CNN model, which is used convolution
layer with different pooling layer to extract the features of
the convolution . The extracted ECG signal is transmitted
in real time to cloud ( We have used Ubidots cloud)
through ESP8266 over to the cloud using WiFi based on
MQTT publishing method. The experimental results are
performed on different signals and the different stage of
de-noising and QRS detection are applied with good
Figure (19) Normalized signal .
results and different pooling layers are used in the
100
Aqeel M.Hamad alhussainy(1), Ammar D. Jasim (2) Remote ECG signal monitoring and classification based
on Arduino with AD8232 sensor

proposed CNN model. The results show that best results 13. Aqeel M. Hamad alhussainy, Ammar D. Jasim , “A novel pooling
for classification is satisfied with HGT pooling method , layer based on gaussian function with wavelet transform “,Vol. 20,
which is achieved accuracy (94.94%) verses (93.97%) for No. 3, pp. 1289~1298, 2020.
GWT method, also it is achieved ( 94.56%), (94.56% ) and
14. Aqeel M. Hamad Alhussainy and Ammar D. Jasim,”A New
( 5.06) for sensitivity specificity and error rate (ERR) Pooling Layer based on Wavelet Transform for Convolutional
respectively. Neural Network” , Jour of Adv Research in Dynamical & Control
Systems, Vol. 12, No. 4, 2020.
References
15. Aqeel M. Hamad Alhussainy, Ammar D. Jasim, “Half Gaussian-
1. Mrs.G.Mohana Prabha, Autamatic,” health monitoring system based wavelet transform for pooling layer for convolution neural
using Raspberry PI”, international journal of pure and applied network”,Vol.19, No.1,2020.
mathematics , Vol. 118, No. 8, 2018. .

2. Gauravi. A. Yadav and Shailaja.S., “Rasberry Pi based ECG data 16. F. Saeedan, et al., "Detail-preserving pooling in deep networks,"
acquisition system “,international journal of advance research in 2018 IEEE/CVF Conference on Computer Vision and Pattern
engineering and technology.vol.6,No. 4, 2017. Recognition, Salt Lake City, UT, pp. 9108-9116, 2018.

3. J.Gao ,D.Teng and E.Ertin, “ECG feature detection using randomly 17. C.-Y. Lee, P. W. Gallagher, and Z. Tu., "Generalizing pooling
compressed samples for stableHRV analysis over low rate links”, functions in convolutional neural networks: Mixed, gated, and
13th international conference on wearable and implantable body tree," In AISTATS, vol. 51, pp. 464-472, 2016.
sensor network, pp.165:170,2016.

4. Aqeel M. H. Alhussainy, “QRS complex detection and R–R 18. Valliappan CA, Advait Balaji, Sai Ruthvik Thandayam, Piyush
interval computation based on discrete wavelet transform”, Dhingra, and Veeky Baths, “A Portable Real Time ECG Device for
international journal on smart sensing and intelligent systems , Vol. Arrhythmia Detection Using Raspberry Pi “,Conference: Wireless
13, No,1, (2020) Mobile Communication and Healthcare,Volume:2016 ,Milan, Italy,
pp 177-184,2016
5. Rashima M. and Dipla B, “Identification of heart beat abnormality
using heart rate and power spectral analysis of ECG”, international 19. Shamika Jog , Prajakta Ghodake , Darshana Jagta pand
conference on soft computing techniques and implementations, Deepgandha Shete,” Patient Health Monitoring and Controlling
pp.131:135,2015. System using Internet of Things “, international journal of advanced
research in computer and communication engineering , Vol. 6,
6. Shamika Jog , Prajakta Ghodake , Darshana Jagta pand No.5, May 2017 .
Deepgandha Shete,” Patient Health Monitoring and Controlling 20. Deiaa Eida, Amr Y., and Ali E., “ECG signal transmissions
System using Internet of Things “, international journal of advanced performance over wearable wireless sensor networks “,
research in computer and communication engineering , Vol. 6, International Conference on Communication, Management and
No.5, May 2017 . Information Technology (ICCMIT 2015) Procedia Computer
Science 65 ( 2015 ) 412 – 421.
7. Warish D. , Chirag P.and Carlos V., “ IoMT based Efficient Vital 21. Mohammed almoahamdy and Bryan riley,”Performance study of
Signs Monitoring System for Elderly Healthcare Using Neural different denoising methods foe ECG signals”,procedia computer
Network”, International Journal of Research , Vol.7, No.1, 2019. science 37,Elsevier,325-332,2014.
https://doi.org/10.1016/j.procs.2014.08.048.
8. Jasti Sowmya Sree, Mohammed Ali Hussain , ” An efficient body
Line health monitoring system with alerts triggered through 22. Aqeel M.Hamad alhussainy and Ammar D. Jasim, “ECG signal de-
predictive data analytics”, International journal of innovative noising based on deep learning auto encoder and discrete wavelet
technology and exploring engineering , Vol.8 , No.6, 2019. transform”, International Journal of Engineering & Technology,
Vol.9 , No.(2) ,pp :415-423, ,2020.
9. Surekha N., Yamuna N. , Akhil K. and Naveen K. ,” Patiant
monitoring system using IOT “,International Journal of Innovative
Research in Advanced Engineering, Vol. 5, No.5, 2018. 23. George B. et al, " The Impact of the MIT-BIH Arrhythmia
Database", IEEE engineering in medicine and bilology, ,2001.
10. Rohit Kumar et.al , ” Patient’s Health Monitoring System using
Internet of Things (Iot) “, international journal of engineering 24. Goldberger, A., et al. "PhysioBank, PhysioToolkit, and PhysioNet:
trends and technology , Vol.59 , No.3 2018. Components of a new research resource for complex physiologic
signals. Circulation [Online]. Vol.101 , No.23, pp. e215–e220."
11. K. Seena Naik and E. Sudarshan,” smart health care monitoring ,2000.
system using raspberry pi on IOT platform, journal of engineering
and applied sciences, Vol. 14, No. 4, 2019

12. Ayaskanta Mishra and Biswarup chakaboraty,” AD8232 based


smart health care system using internet of things (IOT),
international journal of engineering research and technology, vol.7,
No., 2018.

101

You might also like