ANALYSIS AND DESIGN ANDROID-BASED RESPIRATION RATE MONITORING FOR CLASSIFICATION OF RESPIRATION DISORDERS

The hospital patient monitoring system that has been carried out so far is mostly done conventionally, namely with a sched-uled patient visit system. The monitoring equipment for the patient's condition is stored in the room and can be checked only while in the room. Remote Patient Monitoring (RPM) is a solution for utilizing technology in the health sector that allows patients to be monitored in real-time and can be accessed at any time. One thing that needs to be continuously monitored in monitoring the patient's condition is the respiratory rate. This respiratory rate is one of the most important parameters in monitoring patients because it is a sign of the patient's pathological condition. In the monitoring of patients, which is referred to as Secondary ABC, one of the parameters of concern is breathing.Through this paper, a respiratory rate monitoring device that can be accessed in real-time has been developed to implement the RPM concept. There is also an additional feature where the device can report the results of monitoring in detail whether the patient's respiration is normal or not. This breathing monitoring device that has been made can be accessed in real-time by using a wifi network and then received on a smartphone device so that its condition can still be known even though it is not in the patient's room. Monitoring data can be seen through graphic visualization on a smartphone and then classifying the patient's condition based on the calculated respiratory rate value. The system that has been designed has an accuracy of 95.16%. The threshold used is 27 which is a representation of the analogue signal value from the sensor. It is hoped that this respiratory rate monitoring system can be used and developed to provide optimal services, especially in terms of monitoring the patient's condition.


I. INTRODUCTION
NE of the patient's conditions that need to be continuously monitored is the respiration rate. Respiratory rate is the important parameter to be monitored in healthcare. This information could lead into several signs of medical condition for example clinical deterioration, predicts cardiac arrest, and supports the diagnosis of pneumonia [1,2]. Other research also found that breathing rate also indicates the stress of the patient [3]. Another factor is a concept of patient supervision called Secondary Airway, Breating and Circulation (ABC) [4]. This is a three vital parameter to monitor into a patient including respiration rate measures the patient's respiratory O condition. The existing methodology used in hospital is a device is placed in the patient room. It will show and record respiration rate of patient. Thus, if no one is in the room then the patient's respiratory condition is unknown. Therefore, a respiration rate monitoring device is needed that can be accessed in real time. Result reports of monitoring in detail whether the patient's respiration is normal or not is also needed. It also will decrease the load of medical employee to monitor all devices in different place continuously which could lead into another issue. Research show that medical error can be caused by an over workload of medical employee [17] In term of integration information and communication technology and healtcare, a system called Remote patient monitoring (RPM) is introduced. This system allow healthcare and telemedicine services is developed with technology [5]. In fact, this method where health is combined with technology is rapidly growing nowadays [15]. Implementing RPM would allow not only a real time but also a continuous monitoring of patient. Technically, RPM can be implemented with IoT [14] [16]. Given these problems, this research aims to implement an RPM system where the patient's respiration rate can be monitored realtime using a mobile devics that can be accessed anywhere. The system will also display the average number of respirations rate every minute as well as the category of respiration rate measurement results based on the calculation of respiration data. In order to send the data in realtime, the wireless devices will be added. For device performance, several testing will be conducted especially in term of capability if this will be implemented in hospital patient room. To ensure the accuracy of display and data analysis results, accuracy testing will be added. Thus, the respiration rate system with RPM is expected to be able to use for patient breath monitoring, determine the patient's average number of respirations, classifying whether the patient respiration rate is normal or abnormal.
So, in this paper, a respiration monitoring device has been developed as a part of RPM implementation. It can be accessed in real time by utilizing a wifi network so that its condition still available to monitor even though it is not in the patient room. In addition, the ability to report the patient's respiratory condition category such as normal or not is also added.

II. RESEARCH METHODS
The method used to complete this paper is experimental with the following research stages: 1. Literature Study, is the stage of collecting literature related to the problems to be discussed in the form of references, articles, journals, internet and books to facilitate understanding of the problems discussed. 2. Engineering, is making a system with the support of certain theories and changing systematically as desired. 3. Observation, is the observation and measurement of the results of manipulation and collecting data from observations. 4. Control, the process of controlling the research conditions is carried out when the manipulation takes place.
A. Respiratory System 1) Mechanism of breathing [7] The mechanism of respiration is closely related to the activity of the diaphragm and chest muscles, which contract and relax, causing changes in the volume of the chest cavity. There are two types of breathing, namely chest breathing and abdominal breathing. Chest and abdominal breathing occur simultaneously.

2) Respiration rate
The average number of respirations per minute can be calculated by the change in the contraction of the ribs that occurs during exhalation. The number of breaths that occur depends on several factors such as age, activity and body condition [7]. Normal conditions are based on several existing references. in healthy conditions obtained 12-18 respirations in a minute [8] and others obtained data 16-18 [9]. Based on age also obtained data on the average number of normal breaths. As follows. [ [2] Figure 1. Airflow nasal sensor Figure 1 shows an airflow sensor. This sensor could detect respiratory events in the patient. The working principle is as Thermal Resistive. The different air temperatures when taking a breath with the breath out when exhaling gives a different resistance value to the sensor component. This difference is used as a reference for processing in Arduino. E-Health Shield is a shield specially designed for Arduino. This shield as can be seen in Figure 2 is specifically designed to support several sensors that are specifically used for applications in the health sector.

C. E-Health Shield
D. Arduino UNO R3 [5] Arduino UNO is a microcontroller board that uses the ATmega 328. Arduino UNO has 14 input/output pins (of which 6 can be used as PWM outputs), 6 analogue input pins, 16 MHz ceramic resonators, USB connection, a power jack, ICSP header, and the reset button. Arduino UNO contains all the necessary supporting microcontrollers and can be connected to a computer with a USB cable or can stand alone using an AC to DC adapter or battery. The Arduino UNO differs from all previous boards in that it does not use the FTDI USB-to-serial driver chip. Arduino UNO has been used for many e-health implementation and prototype [12]. Figure 3 shows an Arduino UNO. When the WiFi module is activated but the module is not working, the WiFi module will be set to low power E-ISSN : 2540 -8984

JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika)
Volume 07, Nomor 03, September 2022 : 981-992 standby mode, and the module only needs to be active when it needs to work. This module is provided as a bridge from TTL serial port communication to IEEE802.11b/g/n wireless communication. So, devices with TTL serial ports can be easily connected with this WiFi module and set up and managed remotely via a wireless network. In this module as seen in Figure 4, the Arduino architecture can easily integrate this module into an Arduino-based project.  Technically operational, Wi-Fi is a variant of communication and information technology that works on networks and WLAN (wireless local area network) devices. Figure 5 shows an illustration of wifi network.

G. Eclipse ADT
Eclipse is an IDE (Integrated Development Environment) for developing software and can be run on all platforms (platform-independent). The concept of Eclipse is an IDE that is open (open), easily extensible (extensible) for anything, and not for anything specific [7]. So, Eclipse is not only for developing Java programs, but can be used for various purposes, simply by installing the required plug-ins. If you want to develop C/C++ programs, there is a CDT plug-in (C/C++ Development Tools). In addition, visual development is not impossible by Eclipse, the UML2 plug-in is available to create UML diagrams.

H. Android OS
Android is a Linux-based operating system for mobile phones such as smartphones and tablet computers. Android provides an open platform for developers to create their own applications for use by various mobile devices. Initially, Google Inc. bought Android Inc., a newcomer that makes software for mobile phones. Then to develop Android, the Open Handset Alliance was formed, a consortium of 34 hardware, software, and telecommunications companies, including Google, HTC, Intel, Motorola, Qualcomm, T-Mobile, and Nvidia. In term of implementation of remote system, Android has been used for many applications such as smart home and remote control [13]

I. Design and Realization
The respiration monitoring control system consist of two parts, namely hardware and application programs for monitoring and regulating respiration and its classification. The hardware that is made is adapted to the conditions that exist at this time. While the software created is an application program for Android-based smartphones. An overview of the respiration monitoring can be seen in the Figure 6.

J. Hardware design and configuration
In general, how the respiration rate monitoring system works is as follows.

1) Sensor design and configuration
The sensor will detect the difference in air temperature that comes out and enters the body through the nose. The condition of the sensor working with changes in temperature will cause a change in voltage. This change will be represented through a signal that enters the e-Health shield on the Arduino.
2) The output signal from the sensor will be input to the conditioning signal block.
This conditioning block is already in the E-health shield. The input signal from the voltage sensor is 1 millivolt, it will be amplified.

3) The signal is still in the e-Health shield and enters the filter block.
To perform filtering of high-frequency signals arising from electrical effects. 4) The output of the E-Health Shield will enter the Arduino in the form of an analogue signal and then convert it into a digital signal. With a value range of 0-1023. 5) These values will change in real-time according to sensor input. 6) Through the wifi shield the data will be sent according to the configured port. 7) Mobile phones that already have a monitoring application that has been created will retrieve data from Arduino via an AP that is accessed directly by the cellphone.

K. 3.2 Wifi Device Design
In this project, we use the WiFi Shield WizFi210 V2.2 For Arduino (SKU: TEL0047) device which can transmit serial data on a wifi network. Before this device can be used to transmit data, there are three basic parameters that must be set.

1) Network settings
Network configuration is done to provide a device IP (Internet Protocol) address so that it can communicate with other devices on the wireless network. In this design, the device's Respiration rate will be assigned an IP address via a wifi shield. This IP will act as an Access Point that can be accessed by mobile phones. The IP address of the AP is 192.168.55.1 using the Net ID address 192.168.55.1 which plays a role in identifying a network from another network, while the host ID address is 192.168.55.3.

2) Setting the channel used
In this design, the port number 5000 is used.

3) Serial port settings
Using 115200bps baud rate 8 data bits, 1 start bit, 1 stop bit, no parity, no overflow control.

L. Viewer Application Program
The respiration rate monitoring display application is part of the respiration rate monitoring system. The flowchart of the created application program can be seen in Figure 7.

M. Respiration rate calculator design
To determine the patient's respiration rate, it is necessary to design a calculation process based on the data received by the application.
The following Figure 8 is a flowchart for designing a respiration rate calculator application.

N. Classification of conditions of respiration rate
After the respiration rate is known, the next step is to classify the condition based on the classification that has been made.

O. Flowchart Activity
To determine the patient's respiration rate, it is necessary to design a calculation process based on the data received by the application. The following Figure 9 is a flowchart for designing a respiration rate application.

A. Hardware configuration testing 1) Sensor configuration testing, E-health and Arduino UNO
The process in this section is important because it is the first step of all respiration rate monitoring systems that are built. The test in this section is carried out in several steps.
1. Testing the condition of sensor readings and E-Health on Arduino before sending it via wifi. Figure 10 shows data sending from sensor Figure 10. Sensor configuration testing, E-health and Arduino 2. testing using telnet software. The IP that has been configured on the Arduino is 192.168.55.1 with port 5000. This IP and port are accessed through the Telnet application as shown by Figure 11.

JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika)
Volume 07, Nomor 03, September 2022 : 981-992 Figure 11. Sensor configuration testing, E-health and Arduino via wifi 2) Testing of the wifi device used in the respiration rate monitoring system was carried out by applying three scenarios.
1. The first scenario: the wifi device is placed in one room with the distance between the smartphone and the wifi device ± 5 meters 2. In the second scenario: measurements are made in a different room with a distance of ± 10 meters 3. Third scenario: measurements are carried out without obstructions Each scenario is done 20 times. Data retrieval is carried out using the Terminal for Android application. Delay is the time difference between data transmission and the time when data is received at the recipient. In the measurement process, the respiration rate device and the wifi device are placed at a height of + 50cm, according to the average height of a table.
1. First scenario measurement In this scenario, the android device is in the same room as the wifi device. In this measurement, the average delay is 7.33 ms. Details meaurements can be found in Table 1.  In this scenario, the wifi device is placed in room 1 and the android device is in room 2. In this measurement as shown by Table II, the average delay is 8.35 ms. The measurement of the third scenario is carried out in an open room to determine the delay of packets sent from via wifi on the system that has been created. At the same time, the maximum distance between the device and the mobile phone can be obtained. Figure 12 shows the measurement between delay and distance. At the time of measurement with a distance of about 30 meters, the condition is not always connected. Therefor, a distance of 30 is an unsafe distance for maximum performance. For maximum performance, the ideal distance is a maximum of 25 meters. All the button as well as the display work perfectly. The display shows the breath monitoring of the patient. An application is shown by Figure 13.

4) Respiration rate monitoring accuracy testing and analysis
This test was conducted to determine how accurate the respiratory rate value from the respiration rate monitoring system was made. This test requires the help of several people to calculate manually. 1 breath is counted with 1 inspiration and 1 expiration. All measurements can be seen in Table III. From the data from the application test results by measuring the patient's respiration, the average accuracy of the measuring instrument is as follows: Average tool accuracy = = 551 579 x 100% = 95.16%

5) Threshold Analysis
Threshold when calculating the respiration rate value is very important because it determines whether the data value received by the application when deciding is counted in 1 breath or not. To get the right value, what is done is to test and read the data given by the maximum and minimum value device. The maximum value obtained is 3.73 then the maximum value obtained is 94.433 The threshold value is Threshold= (94,433-3,733) x 30%= 27,21 The threshold value that we use is 27.

IV. CONCLUSION
Some coclusion provided based on the project that has been done can be seen below: 1. In this paper, a respiration rate monitoring system based on RPM application has been developed that can display the patient's respiration process in real-time. 2. The respiration rate monitoring application created is able to display data on the number of patient respirations every minute, with an accuracy rate of 95.16% 3. The threshold value for calculating 1 breath marked with 1 inspiration and 1 expiration respectively used is 27. 4. The respiration rate monitoring system that is made is capable of classifying abnormalities in the patient's respiration based on the respiration rate value. 5. The wifi data transmission used has a transmission delay SUGGESTION There are several things for improvement and development of this tool, including: 1. We could use the router configuration for a large number of patients at the same time can increase the range of the device. 2. Respiration rate detection is combined with other parameters of the patient's condition so that the symptoms of the disease (disease) present in the patient can become more accurate. 3. Respiration rate monitoring can be developed as an early warning system to determine a person's condition in carrying out activities so as to avoid accidents.