Android Mobile Application for Heart Rate Measurement and Monitoring

It is an undeniable fact that technological advance in health aspect holds a very important role body because health is one thing that humans should be concerned about for living a proper life. One of the most vital parts of the human body is the heart. A heart condition can be measured by heart rate. Heart rate is the number of times of a human heart beats per minute that is usually called bpm (beats per minute). Due to the importance of knowing the heart condition every time, it is Necessary for the human to have a helping device to check the heart rate every time without going to a hospital or seeing the doctor first. This device and application is supposed to be easy to use and effective for daily life. In addition, this heart rate measuring device is designed using a microcontroller and Android phones.


Introduction
Development of the advanced technology has been growing rapidly as it affects many aspects of our lives, especially in the health sector. It can be seen by numerous tools, machines and even software that can be used by humans to check, examine and maintain their health [1], [2].
Technological progress in the health sector is inevitable. Body health is something that is essential for humans to survive in this world. One important part of the human body is the heart which is a vital organ to pump the blood that will be distributed throughout the body. The heart works continuously and repeatedly. Heart's condition can be detected by measuring the heart rate. [3]- [5]. The heart rate measurement is done by measuring the number of times the heart beats per minute which is usually shortened by bpm. The heart rate can vary according to the body's physical needs, gender, age, body mass, activity, etc. Sudden change in heartbeat can indicate heart failure that needs a medical treatment [6], [7].
However, a lot of research and projects have been carried out either nationally or internationally to invent something related to heart rate measurement. Several previous research has succeeded to measure heart rate using the pulse sensor. These studies mostly use The Arduino as a microcontroller and Bluetooth as data communication. In this project, the ESP 8266 is used as a microcontroller, and In this project, the ESP 8266 is used as a microcontroller as well as data-communicating tool using Wifi.
Based on the background and previous research review, it is necessary to have a tool to monitor the heartbeat at any time without having to go to a hospital or doctor. This tool should be simple and effective for everyday use like a smartphone that is always used by humans. Based on the exposure of the problem and review of research described above, a simple and effective tool for heart rate 2 1234567890''"" measurement has been created in this project. This tool uses pulse sensor, ESP 8266 as a microcontroller and data-communicating Wifi as well. After the trial, the error rate of this tool is 2,37 %.

Design and Methods
2.1. Basic theory 2.1.1. Heart. The heart is one of the most important organs of the human body. Heart plays a crucial role in performing daily activities. The heart functions as a pump in the circulatory system to provide a continuous flow of blood throughout the body and to transport O 2 and other elements needed by the muscle in order to actively move in daily basis [4].

Heart rate.
The heart rate measures the number of times the heart beats per minute which is usually shortened by bpm. The heart rate can vary according to the body's physical needs, gender, age, body mass, activity, as shown in Table 1 and Table 2 [6].
Normal heartbeat ranges from 60 to 100 BPM This table is a classification of heart rate based on frequency and age and gender [8]. ESP8266 is a microcontroller designed by Espressif Systems. As shown in Figure 1, ESP 8266 is a solution for independent Wifi network which becomes a bridge to connect the available microcontroller to the Wifi and to run its own application. ESP8266 modules which have a variety of input and output pins are also equipped with a USB connector. Just like Arduino, ESP8266 can be easily connected to a laptop using a USB cable [9], [10].

Figure 2. Heart Pulse Sensor
Pulse Sensor is a plug-and-play detector designed to be applied in Arduino. To analyze the heart rate, the sensor is placed in a certain body part, such as a fingertip, earlobes, and temples. Once it is programmed, the pulse sensor will soon scan the heart rate in the real time.
Pulse sensor has three legs named Pulse, Negative, and Positive Supply. Three to five volt is said to be the ideal voltage level for this sensor. This sensor, as shown in Figure 2, can only absorb the power up to 4 mA. That is why this sensor is suitable for mobile device [11].

OLED LCD
OLED is a Light-Emitting Diode which it's electromagnetic layer is made by organic compounds that emit light in response to an electric current. The organic semiconductor layer is located between two electrodes, one of which is a transparent electrode. OLED is used to create a digital display on a device, such as television screen, computer monitor, and portable systems, for example, mobile phone, handheld game console, and PDA. In contrast to LCD, OLED does not need back light; it glows on its own. OLED's waste is much lower than LCD's, making it very suitable for portable device [12].

Battery / Power Supply
The battery is a device that can convert the chemical energy contained in the active ingredient components of the battery into electrical energy through an electrochemical reaction of reduction and oxidation [13].  Figure 3. Installation Schematic Figure 3 shows a schematic of the circuit design and measurement of heart rate is. Table 3 is a scheme of the installation of such equipment.

Block program
Block diagram of the heart rate measuring device is shown in Figure 4. The block diagram of parts and their functions can be seen below: 1. Power supply serves as the power supply to all parts except android smartphone. 2. Screen LCD is used to display the heart rate measurement. 3. The pulse sensor is a heartbeat sensor. 4. The esp8266 microcontroller is used as sensor data processing and data transmission intermediaries. 5. Android smartphone as the heart rate measurement data viewer.  Figure  9 (b) shows the flowchart for the usage of the application on the Android smartphone.

Programming
Programming device using Arduino IDE. Arduino IDE (Integrated Development Environment) is software developed by the Arduino is used to design various processes associated with the Arduino programming [15].
Arduino app was created using App Inventor. App Inventor is an open source web app originally developed by Google and is currently managed by the Massachusetts Institute of Technology (MIT). App Inventor allows new users to create programs on the computer to create software applications for the Android operating system [16].

Data collection
The process of data completion is done by a test method. This tool is tested to ten people at random sampling. They were asked to use this tool and see the results of heart rate measurement. Sensors on the tool are mounted on the index finger. The comparison is done by conventional heart rate, by calculating the pulse next to the wrist.  Figure 6. Android Application Display Figure 6 is an android app view of this heartbeat measurement and monitoring tool. Figure 6 (a) is an icon display of an application called Heart Rate Measurement. Figure 6 (b) is the initial display when the application is opened, aka two key tones i.e., Start to start and Reset to reset. Figure 6 (c) is the view when the Start button is pressed; the user is prompted to enter the name and age of the column provided.  Figure 6 (d) is the view when the name and age have been entered, and the Go button can be pressed. When the Go button is pressed, it will go to the next screen like picture 6 (e). Figure 6 (f) is the display when the Refresh button is pressed which will bring up the measurement result of a heartbeat. When the Back button is pressed, then the display will return to view in Figure 6 (b).

Tool Measuremetn Result
In Table 4, it can be seen the results of varying heart rate measurements. Measurements are done by putting the sensor on the user's index finger; then the sensor will start reading and sending it to the smartphone. The sensitivity of the sensor is very high, so it takes some time for the sensor reading value to be stable. Due to the rapidly changing value of sensor readings, the heart rate taken is of minimal value and the maximum value that often appears at the time of measurement. Heart rate from tool measurements ranges from 70 to 95 BPM. This means that the measured heart rate can be said to be normal because the normal BPM ranges from 60 to 100 BPM. The variation in heart rate is influenced by various things, such as gender, age, and activity performed before or during measurement. Table 5 and Figure 7 show the comparison between the measurement results of the tool and the measurement of the heartbeat manually. Measurements are done manually by measuring the pulse on the wrist for 1 minute. It can be seen that the difference between the two measurements is ranging from 0 -4. From the difference is obtained error for each measurement. The average error of 2.37%, this means that the heart rate measurement tool is quite effective because it has a relatively small error. Figure 8 is a signal form of the heartbeat read by the tool that has been created. The signal on Serial Plotter software in Arduino IDE.