INTERNET OF THINGS BASED REAL-TIME VITAL SIGN MONITORING SYSTEM USING MOBILE APPLICATION

The development of telehealth technology in monitoring systems has been widely used to support applications in the health sector. The aim is to provide easy access for the people. One of the implications is a real-time monitoring system based on the Internet of Things (IoT) platform. Some health vital signs that focus on observation are electro-cardiogram (ECG) signal, oxygen saturation, blood pressure, and heart rate, providing heart health information. In this study, an integrated system has been implemented, namely a vital sign distributed monitoring system through the internet network. The implemented system was able to acquire vital signs then send data to the internet cloud to be stored and processed further for real-time monitoring needs by interested parties. An Android-based application called iHealthVitalSign monitor can send, process, and represent data in numerical and graphical forms. The average delay for each packet delivery was 154.73 ms and complied with the ITU-T recommendations for real-time data transfer. Heart rate (HR)detection algorithms have been evaluated on real-time ECG signals.From the test results for more than 2100 beats, the average detection accuracy is 98.78%.With this proposed application, it is hoped that it can increase the penetration of telehealth services.


INTRODUCTION
The development of telehealth technology is more sophisticated and practical has been widely used to support applications in the health sector[1]. One of them is the Wireless Sensor Network (WSN) technology for monitoringvital signs. Furthermore, WSN is linked to the widely accessible internet, and this technology is then known as the Internet of Things (IoT).The Internet of things is a dynamic network with intelligent interface capabilities that can be seamlessly integrated into global networks [2]. Some of the most important health vital signs that are of concern are ECG, oxygen saturation (SpO2), bloodpressure (BP), and heart rate (HR) that can provide information on heart health. Observation of these signals is sometimes carried out continuously, not limited to places and times, which means that it is not only done in health centers. Therefore, we need an integrated system that provides a solution for these challenges. One of them is making acquisition devices connected to the internet to facilitate data and information transfer. From these reviews, it is clear that IoT technology will be widely used to facilitate access to health services, especially online monitoring applications with high mobility. Acceleration of research is needed to support the availability of these devices and systems in a relatively short time. Therefore, the proposed research that will be carried out is building a system (model and implementation) of healthcare monitoring distributed through a wide internet network. Some researchers have built IoT-based vital sign monitoring systems, and they mostly focus on ECG moni-toring. Research by Nguyen,et al. [3] has designed and implemented the healthcare monitoring system, which uses an IoT-based 6LoWPAN network. He researched to make a real-time monitoring system centralized with several network topologies for many users. Online applications for ECG monitoring based on PC or mobile devices were also reported in the study [4]- [8]. Other research by Junaid. et al. [9] has developed Remote Patient Monitoring. His study's focus is to develop an android application for monitoring ECG signals and data storage for uploading to the cloud to be accessed by medical parties. This study does not address multi-user applications.Implementation of a health monitoring system such as ECG, body temperature, or blood pressure with local or point to point access was also reported in the study [10]- [14]. Research by Sugondo. et al. have realized an android application to detect arrhythmias using Bluetooth as a media of communication between signal acquisition devices and smartphones [15]. However, the monitoring system still uses peer to peer topology to not be used for many users.Other studies have focused on developing mobile applications to detect cardiac abnormalities based on a single vital parameter, as reported in [16]- [18].Therefore, this study proposes a real-time application to monitor various vital sign parameters. This application also supports multi-sensor and multi-user implementations. This proposed research is developing the study: PC-based Wireless Vital Sign Monitors use ZigBee and Wireless 802.11 LANs as data transmitter [19], [20]. In this research, the signal acquisition device of ECG, PPG, and body temperature was realized following monitoring applications on PC point to point through ZigBee and WLAN. Several T network topologies have also been made using ZigBee to transmit ECG signal data in real-time [21]. The mentioned research has not been widely accessible through the internet, so it still has limited access. Recently a web-based digital ECG signal monitoring application has been developed, but it has not been running in real time. The confirmed research, as explained above, is the main background for the development of this proposed study. The advantages obtained from this study are the availability of an embedded system of health devices for the acquisition of vital human signals that are integrated with global internet networks. Through the website page or mobile application, signals or data can be represented through graphs and numbers so that further analysis can be carried out. In the future, this application can be a prototype or model that is applied to healthservice centers and personal use.

SYSTEM DESIGN AND IMPLEMENTATION
The implemented system is depicted in Fig. 1. The vital sign acquisition device is used to measure the ECG signal, blood pressure, oxygen saturation, and body temperature. The main processing unit will then process the data and arrange the order of measurement data to be forwarded to the access point via the Bluetooth module. This proposed system's access point is a mobile phone as a gateway between sensor devices and internet networks. By mobile phone, then the data is forwarded to the server. Users who have interests can access the data through the "iHealthVitalSign" application installed on mobile devices.

Signal acquisition device
The signal acquisition device consists of a single lead ECG, blood pressure meter, oxygen saturation meter, and a thermometer, as shown in Fig. 2. The ECG Analog front end design implemented is based on previous research [15]. The oxygen saturation sensor uses a MAX30100 based sensor module inside.The blood pressure acquisition device uses a BP meter with serial data output. Sensor 18B20 is used to acquire body temperature. The microcontroller is applied as the main controlling unit for processing and transmittingthe data. The diagram of hardware design in this study can be seen in Fig. 3.

Bluetooth interface
The Bluetooth module in this study is used to transfer data from the main control unit to the mobile phone, which acts as an access point and a client. We use the Bluetooth HC-06 module that works in slave mode and, on the other hand, Bluetooth on the mobile phone as a master. The activation and Bluetooth connection on the mobile phone is made automatically after the QR-Code authentication process is successful and is received by the server. Fig. 3 shows the wiring diagram between the microcontroller and the HC-06.

Client-server architecture
Online and real-time applications in this study are implemented using client-server-based network architecture. This architecture provides a connectivity model on networks that distinguishes computer functions as client and server. This control function is carried out by an operating system embedded in the cloud. The server is responsible for providing services to connected clients. This service is in the form of communication lines, user authentication, database, and data transfer. This architectural model's working principle is straightforward, where the server will wait for a request from the client, process, and provide output to the client. Meanwhile, the client will send a request to the server, wait for the process and receive the desired package. This study uses theTransmission Control Protocol/Internet Protocol (TCP/IP), while the operating system used is Ubuntu Figure 2: Hardware of acquisition device   . 4) is an Android application integrated with vital signal acquisition devices that display measurement results in graphical and numerical forms. Users can take measurements online and in real-time using this application via the internet network. The application was developed based on Android, with a size of 3.66 MB. The system is equipped with authentication based on QR-code to run the application as an initial activation. Where each device has a unique QR code that is registered on the database server. The iHealth application is also equipped with a user's medical record that can be used to view medical history. iHealth is supported by web-based applications to perform functions related to user settings (doctors and patients). An administrator can access new user input, delete users, select doctors, and manage medical records.
Applications that support iHealth can be seen in Fig. 5.

Heart rate detection
Heart rate (HR) is one of the vital parameters that can be implicitly calculated based on the ECG signal. The QRS complex on the ECG is an important component in heart rate detection. Real-time HR calculations using the Pan Tompkins method to provide good performance in QRS detection according to what was a report(ed in a study by Pan and Tompkins [22]. Pan Tomkins has adaptive properties for each ECG signal pattern, so this algorithm is very suitable to be applied without having to do previous learning [22]. All QRS detection processes are implemented on mobile phones. The stages of the QRS detection process on Pan Tompkins are as follows: 1. Band Pass Filter (BPF) BPF is used to reduce the noise of artifacts, muscle, and baseline wanderers. We designed BPF with a frequency range of 5-15 Hz by LPF and HPF. The design of the LPF and HPF follows the following difference equations:

Moving-Window Integration
Window integration is applied to get the slope of the R wave. It is calculated from where N is the size of the sliding window 5. Thresholds The threshold function works adaptively to determine the heartbeat. Pan Tompkins uses two thresholds (low and higher) to identify peaks of the signal.

RESULTS AND DISCUSSION
The real-time vital sign monitoring system developed is an integrated system between signal acquisition devices and software applications. All communication protocols are configured smoothly so that this system can work with good performance. We conducted several tests to determine the performance of the proposed system so that it can be applied to real applications. Tests carried out include data integrity, transfer delay, storage capacity, HR detection, and medical records.

Data integrity
Integrity is one of the parameters for conformity testing between the data sent by the device acquisition and the data displayed by the iHealth application. Although there is a guarantee by the TCP/IP protocol, there is still a possibility of errors. This test is done by observing and comparing the data sent by the device, the server's data, and the data displayed by the application. In this study, we made a protocol in terms of timing of sending data based on necessity in displaying the examination results. Samples of ECG waves are sent continuously with a frequency of 100Hz to keep the ECG graph can be displayed smoothly. Meanwhile, SpO2 and body temperature are sent with a time interval of 2.5 seconds and 45 seconds. The value of the blood pressure measurement results will be sent when the user presses the button on the device. Several examination results of vital signs taken from serial communication are shown in Table 2 Table 2, Fig. 6 and 7, we conclude that the device's measurement results have consistent values both on the database server and iHealth application. The proposed system can send and represent the vital sign parameter on a server and iHealth applications during the testing. In conditions where the SpO2 data, body temperature, and blood pressure are simultaneously sent can cause errors. In this situation, the patient can measure blood pressure with activation on the device.

Transfer delay
The real-time monitoring system is one of the objectives of the proposed system. One of the parameters to guarantee the fulfillment of QoS in real-time data transfer applications is a delay. The developed systems are susceptible to delay because they are very dependent on existing cellular traffic. Based on ITU-T recommendations, the standard data requirements for real-time services are <250 ms. Delay testing is done using a cellular internet network with an upload/download service speed of 19.3/4.91 Mbps. Testing is also done using a fixed internet network based on fiber optic transmission with the upload/download service speed of 1.60/9.96 Mbps. Delay calculation based on the time interval between packages sent and received as in example Fig. 8. The results of delay testing for each scenario are shown in Fig. 9.  Fig. 9, as many as 30 data packet samples have been tested in the process of sending and reading data. The average delay of the test for each scenario is 154.73 ms. This means that it meets the standards of the recommended real-time data communication requirements from ITU-T. From these results, it can be concluded that the system built can be used in real-time monitoring applications.

Storage capacity
The database server is used to store patient medical examination data. In this research, we use storage media with a maximum capacity of 40 GB. We analyze to estimate the number of examinations that patients can perform. The data sample size for each transmission is shown in Table 3.   Table 3 above, then we assume that the total duration of the examination is 5 minutes. The total size of data sent, including blood pressure data with 2 times measurements, is: Param   Table 4, we know the total size of data at each examination is close to 1884 Bytes. If we have 40 GB of storage, this system can store the examination data as much as = 21x10 6 .

Evaluation of HR detection
System performance testing in detecting heart rates is an important parameter because this is a valuable feature in applications. We evaluate the Pan-Tompkins algorithm for real-time HR detection through ECG signals. Table 5 shows the results of the experimental evaluation of HR detection. We have evaluated more than 2100 beats from 30 ECG signals. Table 5 shows the performance of the algorithm that is applied to the mobile application. The average error is 1.22% due to false positives and false negative detection. The high magnitude of T wave or QRS peak, which tends to be negative in some people, can cause error detection.

Medical record
A medical recording is a mandatory feature for health service applications and the telehealth monitoring system application. The system that we have developed is equipped with medical record applications on database servers managed through web pages and can be accessed through iHealth by a doctor's account. By default, when a user activates a vital sign device and is connected to a network, all measurement data is automatically stored in the server database until the device is deactivated. Each recording is labeled as a user ID, vital sign parameter, and time of data recording. The results of recording the patient's medical history can be seen through iHealth, as shown in Fig. 10. The doctor who has the authorization can access the patient's medical record, as shown in Fig. 11.

CONCLUSIONS
In this research, a real-time application for a vital sign monitoring system has been developed. The application was then called iHealth VitalSign, which is run on Android mobile. This system was able to measure blood pressure, ECG, SpO2, temperature, and heart rate. iHealth was used to send data to the cloud server and represent data in numerical and graphical forms. This system uses the TCP/IP protocol to guarantee data sequences and perform error control functions.
The proposed system has been tested for its performance. Testing includes data integrity, transfer delay, storage capacity, HR detection, and medical records.
The proposed system was able to store and represent medical check-up results on server applications and iHealth, which is by the results of device acquisition. The average delay for each packet delivery was 154.73 ms and met the ITU-T recommendations. This study also evaluated the HR detection algorithm through ECG signals. From tests that have been carried out on more than 2100 beats, it is known that the application generates a detection accuracy of 98.78%. The high amplitude of T  Figure 11: List of medical records on iHealth (a) record files (b) repeat ECG signals' playback wave or QRS peak, which tends to be negative in some people, can cause error detection. The system that we have developed has been equipped with medical record applications on the database server and is fully accessible through iHealth by a doctor's role. The proposed system is expected to be applied for telehealth in health centers or personal use.

CONFLICTS OF INTEREST
All authors declare that they have no competing interests. All authors acknowledge and agree to the publication of this manuscript.

ACKNOWLEDGMENT
We would like to thank the Ministry of Research, Technology and Higher Education of the Republic of Indonesia, who has give us financial support through Penelitian Strategis Nasional Institusi scheme. Also for Telkom University for giving us full technical support through the laboratory and the research center.