Analysis of Transmitted and Received ECG Signal Based on Internet of Thing Using Web Browser and Server-Client HTML Protocol

Cardiovascular disease is one of the leading causes of death worldwide. One of the reasons for the large number of deaths from heart disease is the lack of regular cardiac monitoring. Electrocardiograph (ECG) is a method of monitoring heart conditions. There are still many ECG examinations in hospitals that are carried out directly in certain places and the results can only be seen at that time. Meanwhile, when negligence or carelessness occurs, it can endanger the patient due to delays in handling. One of the efforts that can be made to improve service to heart patients is by having ECG monitoring based on IoT (Internet of things). The purpose of this study is to analyze the ECG signals sent and received by IoT media so that they are useful for the diagnostic process. The contribution of this research is to know the shape of the ECG signal that is sent and received through IoT media. The procedure to achieve this goal is with the AD8232 sensor whose output will be processed through the microcontroller and displayed on computer and smartphones via IoT. From this research, the results obtained that the average value of lost data at BPM 60 and BPM 120 is quite good, namely 21.26% and 24.44%. W hile the average time delay value at BPM 60 and BPM 120 is also quite good, namely 0.023 s and 0.03 s. So, it can be concluded that the sending of IoT-based ECG signals affects the form of signals sent and received. The results of this study are expected to be developed in further research with development in the form of adding leads or adding BPM parameters.


I. INTRODUCTION
Cardiovascular disease is one of the leading causes of death worldwide. This causes research on electrocardiograph devices is also increasingly developed [1] [2][3] [4]. According to data from the 2015 World Health Organization (WHO) data analysis, more than 17 million people in the world died from heart and blood vessel disease. About 31% or about 8.7 million are caused by heart disease. And it is estimated that by 2020, heart disease is the cause of death for about 36% of all deaths, and this figure is twice as high as the death rate by cancer. One of the causes of the large number of deaths from heart disease is the lack of heart monitoring that should be done regularly. Currently, Electrocardiograph or ECG is the most common method for detecting heart disease or disorders [5] [6]. There are still many ECG examinations in hospitals that use conventional methods where the examination must be carried out directly in a certain place and the results can only be seen at that time. Meanwhile, the process of monitoring the heart needs to be done regularly so as not to endanger the patient. When negligence or carelessness occurs, it can endanger the patient due to delays in handling. One of the efforts that can be made to improve services for heart patients is by monitoring ECG based on IoT (Internet of things). This IoT system allows users and other systems to connect and communicate so that it can be a solution to these problems [7][8] [9] [10].
In 2019, Ria Hariri et al., conducted research on the use of the AD8232 sensor as a heart rate monitoring sensor based on the Internet of Things (IoT) [11] [12]. In this study, they will record an ECG signal through 3 leads using the Node MCU ESP8266 microcontroller for signal processing and sending BPM values on a web browser. However, in this study there was no ECG signal transmission and the name of the web used was not mentioned. Then in 2021, Defyan Priyo N. et al., conducted research on IoT-based heart rate monitoring with an ESP32 microcontroller and an AD8232 ECG sensor using 3 leads and using an android application media. In this study, the results were quite accurate even though there was a fairly poor QoS value. In this study, only the BPM value is displayed without displaying the form of the ECG signal in real time [13] [14]. Then, in 2019, Tamanna Shaown et al., conducted research on IoT-based ECG monitoring for Smart Healthcare [15]. In this study, the AD8232 module was used to record the ECG signal which then used the Raspberry Pi as a microcontroller for signal processing as well as signal transmission via Wi-Fi. However, this study did not explain the application for the display of the signal and there was no ECG signal data before IoT-based delivery. In 2016, Zhe Yang et al., conducted research on an IoT-based Wearable ECG monitoring system that uses HTTP and MQT protocols to display ECG signal data [16]. In this study, it was found that the ECG signal sent via Wi-Fi can be displayed on a web server that can be accessed via any device. However, the resulting results are still fairly inaccurate [17]. In 2019, Pagalada P. K. et al., conducted research on ECG monitoring using an IoT system displayed on the Thingspeak platform. In this study, a graph of the patient's heart rate and BPM values is displayed. However, there is no display of the form of the ECG signal nor is there an analysis related to the error value of the received BPM value [3][18] [19]. In 2016, M. Ryan Fajar N. et al., conducted a study on ECG monitoring with an IoT-based multi-patient system. In this study using a Zigbeebased [20]transmission module with an ECG signal display on a web server that can be detected through patient ID. However, in this study there were no results of the analysis of the quality of the signal sent, but about the capacity of the server used which could only record 20 patients.
Referring to these problems, it can be seen that the ECG monitoring system by displaying the form of the ECG signal has not been widely implemented. So the author wants to do research on the analysis of the shape of the signal on the ECG that is sent and received via IoT media which will be displayed on a PC with leads I, II, and III [21][22] [23]. This study aims to analyze the ECG signal transmission data before and after delivery via IoT. With this research, it is hoped that the ECG monitoring system with signal display can be further developed. This study aims to develop and ECG machine which measure the ECG signal from leads I, II, and III based on IOT system. The contribution of this paper is the measurement of and analyze the quality of data transmission.

II. METHODHOLOGY
The process of collecting data on the module is carried out at Ibnu Sina Hospital Gresik. The data retrieval process is carried out on Lead I, Lead II, and Lead III for 10 seconds with the AD8232 sensor [12][24] [21] to record the ECG signal from the Phantom ECG at the BPM 60 setting. The research design used in making the module is Pre-experimental with the After Only Design type. In this design the researcher only uses one group of subjects and only sees the results without measuring and knowing the initial conditions, but there is already a comparison group. The independent variables in this study were lead I, II, and III data before being sent in the form of a signal. The dependent variable is lead I, II, and III data after being sent in the form of a signal. and the controlled variable is the ESP32 microcontroller board [25] [26]. System performance on the module starts from the AD8232 sensor which is then processed by the circuit [27][28]. The entire system circuit includes a battery circuit, AD8232 circuit, ESP32 microcontroller circuit, and a character LCD circuit. In the battery circuit, 1 18650 battery will enter the step up module which produces +6V voltage output. Then, the AD8232 sensor circuit will record a 3 Lead ECG signal originating from the Phantom ECG (Contac MS400 Phantom Simulator ECG). The AD8232 output will be connected to 2 multiplexers to send 3 Lead signals alternately to the ESP32 microcontroller. Then, the ESP32 microcontroller circuit which will process the output from the sensor to be sent or displayed on a web server [29] [30]. And finally a series of character LCDs to display the IP address and the lead being tapped.
Data collection is carried out using the ECG Simulator (Contac MS400 Phantom Simulator ECG) as input from the circuit to the AD8232 sensor with BPM settings of 60 and 120. The AD8232 output will be connected to 2 multiplexers to send 3 Lead signals alternately to the ESP32 microcontroller. Then, the ESP32 microcontroller circuit which will process the output from the sensor to be sent or displayed on a web server. Data processing on the ESP32 is in the form of reading ADC data from the sensor which is then converted into a voltage value which will later become the form of an ECG signal on the prepared web page. And finally a series of character LCDs to display the IP address and the lead being tapped. Data collection was carried out alternately on each lead I, lead II, and lead III with BPM settings of 60 and 120 for 10 seconds. The resulting data is the value of the ECG signal in excel format both before delivery and after delivery. The data will then be compared before sending and after sending based on the shape of the signal, the lost data value, and the time delay value. The search for lost data values is done by comparing the amount of data between before delivery and after delivery. Searching for the time delay value is done by looking at how much time it takes for the data in the shipping process to arrive and be displayed on the web page.

III. RESULT
In this study, the module has been tested using a calibrator, namely by using Phantom. Designs featured is shown in FIGURE 1. FIGURE 4 is displayed the module part consists of the arduino ESP32 microcontroller which is the main board of the device and the AD8232 sensor. The process of collecting data on the module is carried out at Ibnu Sina Hospital Gresik. The data retrieval process is carried out on Lead I, Lead II, and Lead III for 10 seconds with the AD8232 sensor to record the ECG signal from the Phantom ECG at BPM 60 and BPM 120 settings. In the graph FIGURE 3 is the result of a comparison plot of the ECG Lead I signal data sent and received for 10 seconds using ESP32 at the BPM 60 setting. During those 10 seconds, it can be seen that there is a difference in the amount of data sent and received. The data sent amounted to 433 data, while the data received was 376 data. The difference in the amount of data will then be analyzed based on data loss and time delay. is the result of a comparison plot of the ECG Lead II signal data sent and received for 10 seconds using ESP32 at the BPM 60 setting. During those 10 seconds, it can be seen that there is a difference in the amount of data sent and received. The data sent amounted to 433 data, while the data received was 301 data. The difference in the amount of data will then be analyzed based on data loss and time delay. is the result of a comparison plot of the ECG Lead III signal data sent and received for 10 seconds using ESP32 at the BPM 60 setting. During those 10 seconds, it can be seen that there is a difference in the amount of data sent and received. The data sent amounted to 433 data, while the data received was 325 data. The difference in the amount of data will then be analyzed based on data loss and time delay. FIGURE 6 is the result of a comparison plot of the ECG Lead I signal data sent and received for 10 seconds using ESP32 at the BPM 120 setting. During those 10 seconds, it can be seen that there is a difference in the amount of data sent and received. The data sent amounted to 433 data, while the data received was 325 data. The difference in the amount of data will then be analyzed based on data loss and time delay. is the result of a comparison plot of the ECG Lead II signal data sent and received for 10 seconds using ESP32 at the BPM 120 setting. During those 10 seconds, it can be seen that there is a difference in the amount of data sent and received. The data sent amounted to 433 data, while the data received was 301 data. The difference in the amount of data will then be analyzed based on data loss and time delay.

FIGURE 7. Data Comparison of Sent and Received ECG Lead II Signals
At 120 BPM FIGURE 8 is the result of a comparison plot of the ECG Lead III signal data sent and received for 10 seconds using ESP32 at the BPM 120 setting. During those 10 seconds, it can be seen that there is a difference in the amount of data sent and received. The data sent amounted to 433 data, while the data received was 337 data. The difference in the amount of data will then be analyzed based on data loss and time delay.    TABLE 2 is displayed testing the time delay in the delivery process, the highest time delay value is found in testing data on Lead II with a setting of 120 BPM, which is 0.04 s, while the smallest time delay value is found in testing Lead II and Lead III data with BPM settings of 60 and Lead I on settings BPM 120 is 0.02 s. If seen, the average time delay value at BPM 60 and BPM 120 is quite good, namely 0.023 s and 0.03 s. With this, it can be said that the delivery system on the module is real-time enough to monitor ECG Lead I, Lead II, and Lead III.  The block diagram as shown in FIGURE 9 has 3 main parts, namely input, process, and output. The input consists of the AD8232 sensor which will later be processed so that it becomes an ECG signal which is the source of ECG data input on the ESP32 microcontroller, the process section consists of an ESP32 microcontroller which functions to receive data from the sensor and process it so that the sensor value can be sent. Then design an IoT system that is carried out on a PC so that it can make deliveries on an IoT server which will later be displayed on the IoT platform via mobile devices.
FIGURE 10 is an illustration of the system flowchart. Turn on the ON button, after the module turns on the process will initialize after the initialization process is complete it will continue in the next section, namely the selection of input readings from the electrode leads after there is input from the electrode leads, the process will continue on reading the output leads that have been processed by the module after the output data is read then the process will continue on recording and temporary data storage on the microcontroller, after the process is complete it enters the process of determining whether the data recording has exceeded the time limit and the internet is connected.? If the condition is no/No then the process will return to reading the data, and when the condition is yes then the process will continue on sending the data that was stored on the microcontroller on the IOT Platform. The system starts with the initialization of the program. Then, the system will detect whether there is a connection on the client server. If it is connected, there will be data reception and data collection from the client. The received data will then be recorded and will display a notification on the media.

IV. DISCUSSION
After testing the module, data collection and analysis of the results are carried out to determine the stability and accuracy of making the module. This study also aims to analyze the quality of data transmission on ECG Lead I, II, and II signals on the HTML web server. After conducting experiments on research to send ECG 3 Lead signals alternately on the HTML web server, it will have the following results. During the 10-second test, it was seen that there was a difference in the amount of data sent and received. In Lead I with a BPM setting of 60, the data sent was 433 data, while the data received was 373 data. In Lead II with a BPM setting of 60, the data sent was 433 data, while the data received was 301 data. In Lead III with a BPM setting of 60, the data sent was 433 data, while the data received was 325 data. Then, in Lead I with a BPM setting of 120, the data sent was 433 data, while the data received was 325 data. In Lead II with a BPM setting of 120, the data sent is 433 data, while the data received is 301 data. In Lead III with setting BPM 120, the data sent is 433 data, while the data received is 337 data. For testing lost data in the delivery process, the highest lost data value is found in the test data on Lead II with a setting of 120 BPM, which is 30.50%, while the smallest value of lost data is found in testing data on Lead I with a setting of 60 BPM with a value of 14.61%. If seen, the average value of lost data at BPM 60 and BPM 120 is quite good, namely 22.64% and 26.03%. With this, it can be said that the delivery system on the module is quite good at sending ECG Lead I, Lead II, and Lead III signals.
For testing the time delay in the delivery process, the highest time delay value is found in testing data on Lead II with a setting of 120 BPM, which is 0.04 s, while the smallest time delay value is found in testing Lead II and Lead III data with BPM settings of 60 and Lead I on settings BPM 120 is 0.02 s. If seen, the average time delay value at BPM 60 and BPM 120 is quite good, namely 0.023 s and 0.03 s. With this, it can be said that the delivery system on the module is realtime enough to monitor ECG Lead I, Lead II, and Lead III.
This research is compared with the research of Ria Hariri et al., who conducted research on monitoring heart rate using the AD8232 sensor based on the Internet of things (IoT). In this study, we will record ECG signals through 3 leads using the NodeMCU ESP8266 microcontroller for signal processing and sending BPM values to a web browser. However, in this study there was no ECG signal transmission and the web name used was not mentioned [31]. The results of this study say that sending signals can be done on an HTML web server. This module has limitations on the display on the tool. The display on this tool is only displayed on a PC with a web server so that it can only be accessed using Wi-Fi via an IP address. The lead tapped in this study was limited to 3 leads, it is hoped that in the future it can be developed into 12 leads.

IV. CONCLUSION
The purpose of this study is to analyze the ECG signal transmission data before and after sending via IoT, it can be concluded that from the research method, data collection, and analyzing the measurement results are as follows. Based on the data obtained, the ECG signal transmission can be said to be quite good. If seen, the average value of lost data at BPM 60 and BPM 120 is quite good, namely 21.26% and 24.44%. Then, the average time delay value at BPM 60 and BPM 120 is quite good, namely 0.023 s and 0.03 s. With this research, it is hoped that the ECG monitoring system with signal display can be further developed so that ECG monitoring can be carried out routinely without having to go through direct patient monitoring and can be accessed anywhere with the same Wi-Fi. The results of this study are expected to be developed in further research with development in the form of adding leads or adding BPM parameters.