The Design and Implementation of Mobile Heart Monitoring Applications using Wearable Heart Rate Sensor

Heart monitoring is important to deter any catastrophic because of heart failure that may happen. Continuous real-time heart monitoring could prevent sudden death due to heart attack. Nevertheless, the major challenge associated with continuous heart monitoring in the traditional approach is to undertake regular medical check-ups at the hospital or clinic. Hence, the aim of this study is to develop a mobile app where patients can real-time monitor their heart rate (HR) and detect abnormal HR whenever it occurs. Caregivers will be notified when a patient is detected with abnormal HR. The mobile app was developed for Android-based smartphones. A wearable HR sensor is used to collect RR data and transmitted to the smartphone via Bluetooth connection. User acceptance test was conducted to comprehend the intention and satisfaction level of the prospective users to use the application. The user acceptance test shows compatibility, perceived usefulness, perceived ease of use, trust, and behavioral intention to use had a high acceptance rate. It is expected that the developed app may provide a more plausible tool in monitoring HR personally, conveniently, and continuously at any time and anywhere. Keywords—Personalized healthcare; heart monitoring; wearable sensor; mobile; android


I. INTRODUCTION
The heart is one of the most important organs in the human body. Heart monitoring is important to deter any catastrophic because of heart failure that may happen. There are many factors that will cause abnormal heartbeat rhythms such as injury from a heart attack, the healing process after heart surgery, coronary artery disease, and many more. One of the unfortunate incidents that could occur is a sudden heart attack while driving, having chest pain, feeling faint, dizzy, or lightheaded feeling faint, dizzy, or light-headed. The number of deaths annually due to heart disease is projected to increase to 22.2 million by 2030 [1]. Hence, continuous heart monitoring and its condition is important to actualize suitable preventive measures. Nevertheless, some individuals are busy with work until they do not have time to undertake annual medical checkups at the hospital or clinic.
The use of mobile technology and wearable devices focusing on heart disease prevention is rapidly growing [2]. It is expected that 62% of smartphone users use phones to gather health facts and gain knowledge about diseases and health issues [3]. Main technology companies such as Apple Inc., Google Inc., and Samsung Group (SAMSUNG, Suwon, South Korea) have incorporated modern styles for health monitoring in designing their smartphones [4], [5]. Mobile technology offers inbuilt applications such as Global Positioning System (GPS) and location-enabled services which is useful for health monitoring. Moreover, current progress in wireless technologies including short-range (Bluetooth) and wide-area (GPRS, UMTS) have made promising progress in the innovative era of health care systems that should offer portable, wearable and flexible health monitoring systems. These systems will empower continuous monitoring of health data and endless access to the patient despite the patient's recent location or activity. Wearable technology is used in HR monitoring, with high levels of accuracy in both smartphone [6] and wrist-based setups [7]. Recently, mobile cloud computing approaches gained huge popularity for real-time heart monitoring and analysis due to the possibility of utilizing the large data storage and abundant computing power [8]- [12].
The aims of this study are to design, develop, and test a Real-Time Mobile Heart Monitoring (RTHM) application. The android-based mobile apps enable HR monitoring by using wearable HR sensors and consequently notify the HR result in smartphones. The app notifies the caregiver or medical center through WhatsApp when an abnormal HR is detected. Moreover, the HR result will automatically save in a cloud database.

II. RELATED WORKS
QardioCore (Qardio®, San Francisco, CA, USA) is a chest strap ECG device targeted for daily continuous ECG monitoring [13]. It is worn below the sternum. In addition to heart data, QardioCore monitors body temperature, stress levels, respiratory rate, and activity tracking. The device is compatible with iOS smart devices only. Cardio App is used to visualize live ECG recorded from CardioCore, view charts, and graphs to analyze the trends of the heart data. Besides, patients can email 30 seconds of ECG records to their doctors.
The AliveCor KardiaMobile ECG device (AliveCor®, Mountain View, CA, USA) is one lead ECG that can be used for 30 seconds to five-minutes of ECG recording [14]. Users are required to lightly place their two or more fingers on the KardiaMobile's electrodes prior to ECG recording. The device uses Bluetooth energy technology to wirelessly transmit the www.ijacsa.thesai.org heart information to the Kardia app installed in iOS or Android smartphone or tablet. Kardia app is used to collect, view, and save ECG recordings. With a minimum of 30 seconds of ECG recording, the device is able to detect atrial fibrillation, bradycardia, tachycardia, or normal heart rhythm. The automatic algorithm has exceptional sensitivity (96.6%) and specificity (94%) for correctly interpreting atrial fibrillation versus physician-interpreted ECGs [15]. KardiaMobile ECG is recommended as an effective and safe device to detect irregular HR [16]. Users shall be notified of their heart status within the Kardia app once the ECG recording is completed.
Zenicor-ECG (Zenicor EKG® thumb, Stockholm, Sweden) is a handheld ECG device aiming for effective cardiac arrhythmias investigation [17]. It enables patients to repeatedly record their ECGs over a long period of time. Registered patients need to place their thumbs on two electrodes of the Zenicor-ECG to record 10 to 30 seconds ECG reading and press a button to transfer the reading to a central ECG database via a mobile network. Zenicor-ECG Doctor System is a web service that enables doctors to store, process, and view their patients' ECG recordings. The system supports ECG interpretation for a quicker and safer diagnosis. Hendrikx et al. [18] conducted a study to compare the efficiency of short ECG recording with 24-hour Holter ECG, in detecting arrhythmias in patients with palpitations and dizziness symptoms. Zenicor-ECG was used to record 30 seconds of ECG recording twice a day during a four-week period. The results proved that short ECG recording at regular time intervals and when having symptoms is more effective than 24-hour Holter ECG in discovering atrial fibrillation and paroxysmal supraventricular tachycardia.
Previous studies showed that handheld and wireless ECG devices are effective and safe for continuous HR monitoring in detecting arrhythmias [15], [16], [18]. However, patients should contact their doctor to review their ECG recordings. Patients may also email or print the ECG recording or doctors may have accessed the recording via the web service provided by the manufacturer. Moreover, the systems do not include a patient's location detection when abnormal HR occurs. On the other hand, an alert notification to the caregiver or medical center is highly important when abnormal HR occurs especially for cardiac patients. Consequently, immediate action or treatment can be taken to save a patient's life. Hence, Real-Time Mobile Heart Monitoring (RTHM) application is designed to notify the caregiver or medical center through WhatsApp when an abnormal HR is detected.

III. SYSTEM DESIGN
Section II explains RTHM system design including system architecture, activities involved in the real-time mobile heart monitoring, and graphical user interface (GUI) design.

A. System Architecture
The system architecture of RTHM is three-tier that consists of (1) HR wearable sensor, (2) android smartphone, and (3) cloud server as illustrated in Fig. 1. The first tier is the user's interface which contains HR wearable sensors. The sensor is used to collect the heart data of the patient. Real-time heart data is transmitted wirelessly from the wearable sensor to the user's smartphone via Bluetooth Low Energy (BLE). The second tier encompasses android smartphones. HR extraction and detection are done on this tier. The third tier comprises cloud servers. The results of HR monitoring are sent to the cloud server via wireless communication such as Wi-Fi, 4G, and 5G connections. The information saved in the cloud server can be accessed by doctors, patient, and their family members.

B. Activity Diagram of RTHM
The activities involved in the real-time mobile heart monitoring is presented in Fig. 2. A patient is required to create an RTHM account. Then, he is required to edit his profile and caregiver's profile and contact number. An alert notification is sent to the caregiver when abnormal HR is detected. To check or monitor HR, a patient has to wear a wearable HR sensor. The HR sensor needs to be connected to the smartphone via a Bluetooth link prior to the HR monitoring. In the case of an abnormal HR being detected, a permission request to send an alert notification including his location to the caregiver in the contact list will be displayed for 30 seconds. If the patient agrees to send the alert notification or does not respond in 30 seconds duration, the alert notification will be sent to his caregiver via WhatsApp. Finally, the results of the HR monitoring are saved to a cloud database. Fig. 3(a) and Fig. 3(b) represent the graphical user interface (GUI) of RTHM. It is an android-based application. Fig. 3(a) shows the login interface. The patient needs to be authorized by entering a username and password to login into the application. If a patient is a new user, he needs to click the create account button to register to the system. Fig. 3(b) shows the main menu. For profile, a patient can update his profile such as phone number and address. The question mark in Fig.  3(b) is the user guideline to use RTHM. The patient needs to wear a Polar H1 Sensor to check HR. Otherwise, no sensor connected will be shown as Fig. 3(b). Fig. 4 shows the GUI to check HR. The patient needs to touch the start button to check HR or the touch stop button to stop. The default duration to check the reading is three minutes. Fig. 5(a) shows request permission to send abnormal HR alert notification interfaces when abnormal HR is detected. The alert notification will be sent to his caregiver if the patient clicks on the ‗OK' button. The request permission interface appears for 170 | P a g e www.ijacsa.thesai.org 30 seconds and automatically sends an alert notification to its caregiver if the patient does not respond. Fig. 5(b) shows the alert notification that is being sent to his caregiver. The message includes the patient's name, his HR, and current location.

IV. IMPLEMENTATION
The implementation of RTHM including data acquisition and detection of abnormal HR are explained in Section B. Android studio 3.4 or higher was used to develop RTHM.

A. Data Acquisition
Polar H10 (Polar Electro Oy, Kempele, Finland) was used in this study to acquire RR intervals data and then transferred to a smartphone. Polar H10 is a chest-strap HR monitor sensor. The sensor is chosen due to its recording being highly accurate and offers continuous measurement [19], [20]. Polar has implemented wireless Bluetooth Low Energy technology (BLE) for data communication between the sensor and mobile app.
Polar mobile SDK (software development kit) was used to implement the connection between Polar H10 sensor and RTHM app and data acquisition from Polar H10 [21]. Polar H10 transferred RR intervals data (unit of 1/1024 seconds) to a smartphone via Bluetooth communication link. R is the peak of [ Fig. 6 shows the implementation to load the default Polar BLE API with only FEATURE_HR enabled and add callback. The code snippet only presents some of the override methods of the PolarBleApiCallback abstract class. Fig. 7 shows the implementation to automatically connect a nearby Polar device. -50 represents the Received Signal Strength Indication (RSSI) value in dbm. The value is typically from -40 to -60, depending on the used Bluetooth chipset and/or antenna tuning. "180D" represents service in hex string format and null represents any polar device.

B. Detection of Abnormal Heart Rate
RTHM records HR in three minutes. The mean HR and other HRV features such as SDNN, RMSSD, CV, pnn50, VLF, LF, HF and LF/HF ratio is calculated in the RTHM apps based on the RR transferred from Polar H10. Mean HR in beats per minute (bpm) is calculated from RR (ms) as shown in Equation (1) [22].  An adult HR is normal when the ranges between 60 and 100 bpm. The abnormal HR is below 60 bpm is classified as bradycardia or above 100 bpm is classified as tachycardia [23]. An alert notification is sent to the caregiver when abnormal HR detected via WhatsApp application. The implementation to send an alert notification is shown in Fig. 8.
Google Location Services API is used to get a patient's location. It provides the best accuracy, simplicity, availability, and power-efficiency [24]. The code snippet in Fig. 9 shows the implementation to assess Google API. The Google API Client provides a common entry point to the Location Service API.
Firebase is the cloud database used to save all the patients' data including profile, HR and HRV. The implementation is shown in Fig 10.   172 | P a g e www.ijacsa.thesai.org V. USER ACCEPTANCE TEST A user acceptance test was conducted to comprehend the intention and satisfaction level of the prospective users to use RTHM. An online survey was conducted to test the user's acceptance. The online survey was created using Google Forms. Table I presents the user acceptance questionnaire items. It consisted of 12 questions, using a 5 point Likert scale. The questionnaire items were adapted from [25], [26]. The questionnaire items were divided into six constructs named compatibility, perceived usefulness, perceived ease of use, trust, perceived financial cost, and behavioral intention to use. Participants were asked to use the RTHM app for five to ten minutes before they answered the questionnaire. Participants wore the Polar H10 sensor while using the app.

VI. RESULTS
Sixteen participants were involved in the user acceptance test. About 56% of the participants were female. The participant's age was between 18 and 65 years old. More than half of the participants were between 21 and 30 years old as illustrated in Fig. 11. The participants' education level ranged from high school to PhD. A quarter of the participants had bachelor's degrees as shown in Fig. 12. Table II indicates user acceptance results. Compatibility, perceived ease of use, trust, and behavioral intention to use had more than a 90% satisfaction level. Most of the participants believed that the app is suitable for their lifestyle, easy to use, and useful for continuous heart monitoring. Besides, the majority of the participants had an intention to continuously use RTHM Nevertheless, half of the participants perceived the financial cost to deploy the app is expensive. They believed that the app required an expensive smartphone.

VII. LIMITATIONS AND FUTURE WORKS
This study merely focused on the design and implementation of RTHM. System validation and comparison with other similar products should be conducted in the future. The validation includes the accuracy, reliability, efficiency, and energy consumption of the proposed app. Large scale feasibility study involving different age ranges and patients shall be conducted to verify the viability of the app. Besides, the RTHM concentrated on users'/patients' perspectives on continuous heart monitoring. The system can be enhanced in the future by developing a web-based system for doctors to view and diagnose their patients' heart data stored in a cloud database. A real-time mobile heart monitoring application on android platforms has been proposed to enhance continuous heart monitoring and subsequently reduce death due to heart failure. An alert notification is sent to the caregiver when abnormal HR is detected. The app uses a wearable HR sensor to transfer RR data to the smartphone via a Bluetooth communication link. The HR data is saved to a cloud database and can be accessible to the hospital management system web portal. The user acceptance results showed that compatibility, perceived usefulness, perceived ease of use, trust, and behavioral intention to use had a high acceptance rate. Overall, the results indicated a positive influence on the readiness to use RTHM. The proposed app innovates patient-centered healthcare. It is expected that the RTHM may provide a more plausible tool in monitoring HR personally, conveniently, and continuously at any time and anywhere.