Body Temperature and Heart Rate Monitoring System Using Fuzzy Classification Method

Climbing becomes one of the extreme sports that test endurance with nature, just like in a mountainous environment. In addition to the excitement and fun that climbing provides, climbers enjoy the opportunity to view breathtaking natural scenery and breathe in the fresh air drawn directly from the surrounding environment. Because of the temperature in the cold mountains, there are frequent and common obstacles Not realized by the climbers, such as hypothermia. Hypothermia is a condition in which the body temperature drops below 35 o C. When body temperature is below normal 37oC, nervous system function and other body organs will experience interference. If not soon Left untreated, hypothermia can lead to heart failure, disturbances respiratory system, and even death. To anticipate things requires a system that functions to know the condition of mountaineer health. The system to be created uses the Mamdani fuzzy logic method, which decides whether the climber is healthy. The fuzzy logic method is used for decision-making based on body temperature and heart rate values. Implementation of the system in the form of a prototype containing sensors and mini-computers located at the climbing post, with data transmission using a node sent from post x to the main post to be uploaded to the database so that it can be known by the admin or rescue team when climbers need help in critical situations. This is done so that the condition can be monitored.


I. INTRODUCTION
Climbing mountains is a dangerous and exciting extreme activity that requires a lot of strength and stamina. The risks and problems they must overcome make this activity appealing [1]. This is a test of one's nature as well as their ability. A major challenge for mountain climbers is maintaining their stamina, which suffers a significant loss as they get closer to the top. This condition can persist in climbers who are weary of managing their bodies, which can cause fainting [2]. It occurs when the air pressure drops, and it can continue in the condition of climbers who are getting tired to control their bodies. According to research published in 2011 by Scottish Mountain Rescue, hikers rescued from dangerous situations stated that hypothermia was the most common cause of health concerns. The weather is the most important contributor to this phenomenon. The air temperature, the object's temperature, or both can be low in cool conditions. As a result of the fact that many climbers frequently are unaware of this potential health risk, they frequently proceed with their ascent while being unaware of the dangers they will face along the way. Their body condition is already showing indicators of hypothermia, such as their skin becoming blue or a slowed down heart rate [3]. It is necessary to have instrumentation that can determine the health condition of mountain climbers by making use of the specified parameters to be able to anticipate conditions of health for mountain climbers to prevent the occurrence of a drastic decline in health conditions that can cause death if left unchecked to prevent the occurrence of a drastic decline in health conditions that can cause death if it is left unchecked Existing studies use a heart rate sensor and a sweat acid level pressure sensor. After experiencing the quantization process and converting from analog to digital via the ADC, the resulting data will be processed by the microcontroller, which will display heart rate data and acid level pressure for both outputs, namely on the LCD, which will display the measurement results and a short message that will be sent via the A6 GSM Module which displays the results of measurements via messages according to the condition of the climbers [2]. Furthermore, there is research that uses two components, namely the bracelet and sleeping bag, which function as transformations to obtain data from the body, which is an object and then sent to the sleeping bag, which functions to warm the body of hypothermic sufferers based on the input obtained from the bracelet to control the temperature of the sleeping bag [3].
There were deficiencies in previous studies, namely the method of making decisions from sensor values taken and if there was no data or GSM communication signal to communicate messages or data. Through this Final Project, the idea was born to create a health monitoring system for climbers who experience problems during climbing, such as difficulty communicating and knowing their health conditions. The system that will be created aims to help determine the health condition of climbers, whether they are in good health or will experience hypothermia which can be monitored at the main post.

A. Fuzzy Logic
Fuzzy logic maps a variable word (linguistic variable) from an input space into an output space. This fuzzy logic can be defined as fuzzy logic because this fuzzy set has an infinite boundary precision, and not in the form of true or false logic, but expressed in degrees of membership. This method is often used in statements someone makes, evaluates, and makes decisions [4]. Fuzzy logic has a step-by-step process in the system, as shown in Fig.1. The membership function is a curve that displays the mapping of data input points into membership values ranging from 0 to 1 inclusively. The functioning technique is one of the many methods that may be used to retrieve the membership value. Linear Representation, Triangular Curve Representation, and Trapezoidal Curve Representation are all examples of functions that can be utilized [5].
Linear Representation. In the ascending linear representation of Fig. 2, the inputs' mapping to membership degrees is depicted as a straight line. There are two states of linear fuzzy sets. First, the linear representation increases starting from a value of zero (0), leading to a higher domain value or one (1) using Equation (1).
Where, the x variable is the degree point of the fuzzy member, while the a and b variables are the input values of the fuzzy member class. Triangle Curve Representation. The triangular curve seen in Fig. 4 is, in essence, the combination of two lines. These lines are a linear representation of increasing and decreasing linear using Equation.
Where, the x variable is the degree point of the fuzzy member while the a, b, and c variables are the input values of the fuzzy member class. Trapezoidal Curve Representation. The trapezoidal curve is almost similar to the triangular curve. In Fig. 5, there is a difference between the trapezoidal curve and the trapezoidal curve. That is, a domain with degree 1 members has not only 1 point but several points using Equation (4).
Where, the x variable is the degree point of the fuzzy member while the a, b, c, and d variables are the input values of the fuzzy member class. The fuzzy inference system consists of four units, namely: • Fuzzification is the process of changing numeric variables and linguistic variables. The fuzzification function is used to change the firm value, for example, A B, to a fuzzy set C with membership value A. Fuzzification is expected to help simplify computing what the system must do in the inference process. • Fuzzification is expected to help simplify computing what the system must do to process the inference.
• The knowledge base (rule base) contains all the membership functions of the fuzzy set associated with the values of the linguistic variables used and the rules in the form of fuzzy implications. • Defuzzification is the final stage to determine fuzzy system output results. The defuzzification process works to find the maximum value in the crisp set between 0 and 1. The defuzzification process in the Mamdani method using the Centroid method (composite moment) using Equation (1).

B. Flask
Application programming interfaces (API) are a way for two or more computer programs to communicate. This is a kind of software interface that offer services to other software. Python using flask API, flask depends on Jinja template engine and Werkzeug WSGI toolkit.

C. Database MySQL
MySQL is a system management software SQL database to create an open source database and runs on all platforms, both Linux and Windows. An API (Application Programming Interface) allows computer applications written in various programming languages to access the database.

D. Raspberry Pi
Raspberry Pi Foundation makes computing and digital creation accessible to everyone by providing high-performance singleboard computers and low-cost and free software. Raspberry Pi 3 Models B single board computer with wireless LAN and Bluetooth connectivity.

E. LoRa Node RAK811
The RAK811 Breakout Board was developed to make point-to-point (P2P) LoRaWAN and LoRa communications easier to understand and use. The RAK811 includes simple AT commands that can be executed using the UART communication interface, making it ideal for incorporating LoRa technology into the project. With the help of this AT command, the research will be able to configure the necessary settings for LoRa P2P and LoRaWAN communication. Control even the available pin GPIO and RAK811 analog inputs. Controlling the RAK811 Breakout Board using a microcontroller with a UART interface is also an option.

F. Oximeter
The oximeter is a digital device that can measure pulse rate (bpm) and SpO2 (blood oxygen level or saturation oxygen) [6]. This oximeter is used by placing the tip of the finger in the middle. With infrared LED, red LED, and IC, This sensor generates pulse data via the I2C interface. To get data from this oximeter connected to the raspberry pi uses low energy Bluetooth connection (BLE).

G. MLX90614
The MLX90614 sensor here is used as a component that gets body temperature data from victims of natural disasters. This sensor can read temperatures with a range of -70 °C up to 380 °C for precise object temperature ±0.5°C [7].

H. LCD 16x2 I2C
LCD is the display medium that produces the clearest character display, making it the simplest to read and the most convenient to use 32 characters have the potential to be displayed on a 16x2 LCD, with 16 characters per line across the top and 16 characters per line across the bottom. Since 16x2 LCDs typically use 16 pins for controls, using all 16 of those pins would be an extremely inefficient use of resources. As a result, specialized drivers are implemented to control the LCD via the I2C line. If the LCD is controlled using I2C, then all that is required is to use the SDA and SCL pins.

III. RESULT AND DISCUSSION
To prepare for testing, try every sensor and microcontroller to work. Then make sure that the method used is correct after all functions can be integrated by understanding the flowchart in Fig. 7 of the system to be created. In the fuzzy algorithm that will be made, there are two membership class inputs: heart rate and human body temperature, one of the membership class outputs are the climber's health condition. Fig. 6 is the result of the prototype design that was successfully made.

A. Fuzzy Algorithm Testing
After inputting two values, notably those for the temperature and the heart rate. The fuzzification process will occur when the body is fed, and the information will be entered into the rule evaluation. After that, it will be matched with the appropriate rule base that has been made in Table I. When the value obtained has been determined, the meal will be defuzzification to produce the fuzzy set value from the fuzzy rules and output data. The number of domains from the fuzzy set that will be obtained as a consequence is what has been determined in Table II. to provide a value precisely defined as the output. Fig. 8 shows the results of the fuzzy values found based on Fig. 12 regarding the climber's health status according to the average value of the two inputs presented in Fig. 10 and Fig. 11. Fig. 9 illustrates the location of the program for entering random values. The outcomes of the evaluation of the fuzzy technique, based on whether or not the random values entered were correct, are presented in Table III. These outcomes are consistent with the findings presented in Table II.    The climber's condition, including the degree of hypothermia, will be evaluated based on the results of the input values that have been compared to the fuzzy algorithm. These results will be obtained. However, if we have not compared the output value in the program with the theoretical reference value, the output value cannot be a valid reference value. The two values are compared to arrive at the final error value, which must then be subtracted from the total before the data can be considered legitimate or accurate. Table IV compares the theoretical values obtained from the Matlab software with the same fuzzy arrangement as random data input into Matlab. This comparison can be found in the middle of the Table. The results of entering random values in Matlab are compared to the results of entering the same random values in python like the results in Fig. 13. The findings can be found in Table  IV, compare the theoretical Matlab scores and the practical Python scores in terms of their respective error values.

B. Sensor Testing MLX90614
Tests are carried out to determine the accuracy of the sensor. The MLX90614 sensor has 2 values, namely, the temperature of the human object and the ambient temperature. The default environment temperature will be issued when the human temperature object is not detected. Human temperature objects can be detected around 1 -5 cm for sensor accuracy because the MLX90614 sensor works wirelessly. The following are the results of testing the sensor readings on object distance in Table V. Because the authors have not been able to conduct tests directly on climbers to determine the actual temperature that climbers experience when their body temperature is optimal or suboptimal for sensor readings, the authors tested sensors on three people who were engaged in three different types of activities: sports, rest, and normal activities. This is done to determine whether the readings from the sensors remain the same or change when the health status of the individuals being tested varies. The results of the sensor test performed on three individuals with varying activity levels are given in Table VI below. C. 16x2 I2C . LCD Testing Fig. 14 the LCD is used by the author to convey the status climber's health directly when the user performs a status test health before climbing or at the post x to find out his health status in addition to the admin side and BASARNAS. Unlike LCD, 16x2 I2C LCD is usually necessary to set the I2C so that the LCD display.

D. Oximeter Test
The author checks the tool to output its value. The oximeter can issue 3 values, namely SpO2, PR (Pulse rate), and PI (Perfusion Index). Because the input value used is heart rate, the authors only take the BPM value from the oximeter, namely the heart rate, when the oximeter has been integrated with the system. The way to get the input value from the output oximeter is with a Bluetooth connection between the raspberry pi and the oximeter. Table VII shows the results of the oximeter output values before system integration.

E. System Integration Testing with Raspberry Pi
After going through several stages of testing, the method was tested using random data and has been validated with the same method in MATLAB, producing a small percent error. The method will be incorporated into the Raspberry Pi along with the integration of the input values from the sensors so that it becomes a unified system. In Fig. 15, the author tests the integrated system via Raspberry Pi to determine when an error occurs. In Table VIII are the results of system integration.

F. LoRa Testing
In order to communicate from post X to post 1, this system uses a LoRa communication module. This is because it is believed that there will be no signal in the highlands to allow for communication. The results of a health test are transmitted through LoRa at post x using the notation Tx and received via LoRa at post 1 using the notation Rx. The RAK811 version of LoRa is used, and the node type is LoRa. Because LoRa can only transmit a limited amount of data, the protocol combines two inputs and one output into a single string before sending it. This test, delays delivery with diverse site conditions because it is hoped that it can be implemented since different sites in mountainous areas have different heights or lows. In other words, different places in mountainous areas have different heights or lows. The trial was conducted in two different locations: one was a packed area, and the other was a field. The results of the tests conducted in a static environment can be found in Table IX, and the results of the field  tests can be found in Table IX.  . The total length of delay testing in congested areas is 300 meters. This is possible because of the noise caused by the test area with lots of buildings and the test road, which is tortuous so that reception is easily interrupted. Whereas in the field, data transmission can be as far as 1 km. The difference is when in the field, when sending, it is easy to receive and not easily interrupted like in densely populated areas causing long delays. The results of Tables IX and X can be combined in one graphical image in Fig. 16 to observe delivery delays.

G. Database Testing
In this study, a data recap of the climber's health status is stored in the database. This is because the data will soon be lost if we do not use the database. The data will be updated for every climber who undergoes a medical test. If you do not use the database,  the data will be lost. In addition to that, while climbers are at the primary post to post x, it acts as a monitor to keep track of how their health is doing. The conclusion, as depicted in Fig. 17, is that the data can be saved in the database.

IV. CONCLUSION
The research findings have been fruitful, but they also have some shortcomings. The research successfully created a prototype by building a tiny PC or Raspberry Pi integrated with two temperature and human heart rate sensors connected to the Lora communication module as either a data sender or receiver. This prototype was successfully created. Because the error percentage is only 0.345%, the value of the sensor that is processed by the raspberry pi is considered to be genuine. The Fuzzy Mamdani method is responsible for calculating it. The prototype placement takes up residence in both the main and x posts. If a climber checks their health at post x, the check results will be transmitted to the main post using the LoRa network. For the data to be monitored, the data received at the main post and the data obtained during a health check will be uploaded to the database. This will be done in conjunction with the sending of the data. In the main post, the LoRa function is that of a receiver, while in post x, it is that of a sender. The use of the MLX90614 sensor, which is sometimes difficult to read the sensor because it doesn't touch directly or works wirelessly, is one of the drawbacks of this study. Another drawback of this study is the transmission of data using LoRa, which can sometimes have delays depending on the terrain and the distance between LoRa nodes.