Basement Flood Control with Adaptive Neuro Fuzzy Inference System Using Ultrasonic Sensor

This paper proposes the basement flood management system based on an Adaptive Neuro-Fuzzy Inference System (ANFIS). The basement is one of the main parts of a building that has a high potential for flooding. Therefore, the existence of a flood control system in the basement can be a solution to this threat. Water level control is the key to solving the problem. Fuzzy Inference System (FIS) has proven to be a reliable method in the control system, but this method has limitations. It needs to have a basis or a reference when determining the fuzzy set. When there is no basis or reference, Adaptive Neuro FIS (ANFIS) can be a solution. The Neuron aspect in ANFIS determines fuzzy sets through training data. In terms of the Internet of Things (IoT), this system uses ultrasonic sensors to monitor water levels. Water level data is sent to the IoT platform using the NodeMCU microcontroller. The data obtained will be processed using ANFIS to determine that the water level has been declared flooded. Then the water pump will turn on to control the water level when there is rainfall. By undergoing a comparative test with the FIS method, ANFIS provides a lower Root Mean Square Error (RMSE) and is recommended for use in basement flood management systems.


I. INTRODUCTION
n the construction of tall buildings, the basement is one of the important components that must be considered for its functionality. Nowadays, one of the building's basement functions is for parking lots and warehouses. Basements that exist under the ground can be affected by the structure of the environment around the building.
The nature of water that always goes to a lower place is one thing to think about when building a basement. The structure of the environment around the building also needs attention. Soil structure, water, soil type, and natural drainage should be the focus of basement development.
Basement has a water drainage system in the form of a narrow storage space on the wall or basement floor, which will be channeled directly to the ground [1]. Therefore the absorption of water is very dependent on the absorption of the soil around the building. If the land which is near the building has low absorption, it will cause water not to flow.
The ultrasonic sensor is one of the sensors that can detect objects in front of it. Ultrasonic measurement systems are designed and applied for hydrological measurements for the river, lake, or reservoir water levels [2]. The use of ultrasonic sensors in knowing the water-level can be done using the help of a pipe because the data obtained with a closed area will be more accurate than an open area.
Adaptive Neuro-Fuzzy Inference System is a hybrid learning method that combines two methods, namely Artificial Neural Network (ANN) or artificial neural network and Fuzzy Inference System. Fuzzy Inference System has the ability to be able to process human experts into rules, but it takes a long time to determine the function or value of its membership. Because of its weaknesses, to reduce the process of determining its membership function, the learning method used is ANN. Therefore, the ANFIS method is used in this study.
Based on the background above, the problems that will be faced in the execution of this research are such as, how does the system retrieve water-level data in the basement by using an ultrasonic sensor? Furthermore, when will the water pump turn on when the data has been obtained and processed using the Adaptive Neuro-Fuzzy Inference System method?
The limitation of the problem that will be given for this research is as follows. First, the height of the sensor is 21 cm. Then, the distance scale used is 0-21 cm. Finally, the container used for the testing process is 31 cm in size, 18 cm in width, and 24 cm in height.
The purpose of this paper is to reduce the risk of basements submerged by using ultrasonic sensors to determine the water level in the basement and the Adaptive Neuro-Fuzzy Inference System method to determine when the water pump can run.
The writing systematics of this paper consists of several parts, starting from the introduction. The introduction contains the background, topics, and limitations, as well as the purpose of doing this research. The second part contains related research, namely previous studies, which are the stages that form the research question of this study. Then the third part contains the flow of the system being built, the block diagram of the system being built, the hardware specifications, and the workflow explanation of the ANFIS algorithm, which is implemented in this paper. Then the fourth part is the evaluation of this paper, which contains test results and analysis of test results, which will be a bridge to the conclusions that can be drawn from this study. The fifth part contains research conclusions and suggestions for future work.

II. RELATED WORK
ANFIS has been the subject of research on smart systems area in several previous works; one of them is research on sludge treatment using density sensors and ANFIS [3]. In this research, ANFIS proves to be the method with the least error when compared with several other methods such as multiple regression and arithmetic mean.
IoT has been in rapid growth since the introduction of NodeMCU. Research has been conducted to experiment with a thorough comparison of NodeMCU with Arduino Uno plus NRF24L01+X [4]. The results of this research show that both are capable of sending and receiving data from various kinds of sensors. Furthermore, it was proven that Arduino Uno shows less speed, memory, and processing, although being more low-cost.
Water level monitoring has also been the subject of several previous types of research. One of them is research on water level sensor based on Time-Domain Reflectometry [5]. The concept of the sensor uses a probe that is planted in the water container to measure the water level of the container. The sensor proves to be accurate, using the ultrasonic sensor as the baseline. The sensor proposed in this research is claimed to be low-cost as it is 20% the price of ultrasonic sensors.
Another research on water level control was conducted through cost analysis [6]. The purpose of this research was to reduce water usage costs by minimizing wasted water through unmonitored bathtub filling. To solve the problem, the research proposes the use of an ultrasonic sensor to control the water level in the bathtub. By collecting wasted water data through a full year on two compared systems, the research proved that water waste could be minimized with the system. At present, developments in computing technology and consumer electronics have triggered the paradigm Internet of Things (IoT) [7]. Internet of Things itself is a concept where an object will communicate or send data using only the network without the need for human interaction. So that everything works automatically. Therefore life will be easier with the Internet of Things (IoT).
Tall buildings or buildings usually have basements or basements. In making basements in every building must have a different design or concept, but still have to think about the surrounding land and the type of foundation needed. Basements are usually used as a place to store goods, parking lots, and so forth.
Basements have high flood potential due to the nature of the water moving from the highlands to the lower plains. The wall in the basement must retain the water that is on the surrounding soil. The drainage system in the basement must be very good to prevent flooding. Most basement water drainage systems drain water into the drainage system.
Neuro-Fuzzy is a combination of two systems, namely Fuzzy Logic, and artificial neural networks. The data obtained will be represented using logic fuzzy, while artificial neural networks function to carry out the functions contained in logic fuzzy. Good learning skills make Neuro-Fuzzy called an Adaptive Neuro-Fuzzy Inference System (ANFIS). ANFIS can learn well, build, charge, and classify [8]. ANFIS shows a better ability to avoid information disturbances with different input differences [9]. Hydrologic systems are dynamic and usually not linear [10]. Therefore ANFIS can be used in this system because it is suitable for measuring the height of water that is always moving and not fixed.

A. System Overview
The sensor used in this study is an ultra-sonic sensor, which is used to get the water level monitored in realtime. Then for the microcontroller used is NodeMCU, because it already has a WiFi module that can facilitate data transmission. Relay is also used in this study, serves as a switch to adjust the on or off the water pump. The IoT platform used is Node-Red, because Node-Red can read data in real-time.  In general, this system works starting from the ultrasonic sensor, which takes water level data, which is then processed and sent by the microcontroller to node-red. Then the red node will send water level data to Matlab for processing using the ANFIS method. After processing, it will produce data that will be used to determine whether the water pump will turn on or not. The data is sent back to the red node and forwarded to the tool. Fig.  1 shows the system block diagram of the basement control system.
B. Device Specifications 1) NodeMCU: NodeMCU is an ESP8266 module -Internet of Things platform based that has the ability to connect directly with WiFi. Function to transmit data that has been obtained by ultrasonic sensors.
2) Ultrasonic Sensor Ultrasonic: Sensor is a sensor that can convert sound into electricity. This sensor works by using sound waves, which will later be reflected back by the object in front of it. It functions to get the water level.
3) Relay: Relay is an electromechanical component consisting of 2 parts, namely electromagnet and mechanical. In this study, a relay with 5v power was used. Serves as a switch to turn on or turn off the water pump.

4) Water
Pump: In this research, a 5v water pump is used. It serves to pump water out of the water container used in the testing process.
To implement the system, two RFID Readers are required. Each RFID reader needs to be connected to a common database, so each RFID Reader will be connected to a NodeMCU. A NodeMCU is a microcontroller with WiFi capabilities. A database is deployed in a server. The server communicates with the NodeMCU, creating the Shamir Secret Share system.  Fig. 2 shows the flow of the system used for this research. Ultrasonic Sensor will get the distance or water level, which will then be sent to node-red and forwarded to the Matlab. Matlab will process the water level data that has been obtained using ANFIS and produce a value that will be sent back to the tool. The resulting value will determine the water level can be said to be flooded or not. When it is said to be flooded, the water pump will turn on.

D. Adaptive Neuro-Fuzzy Inference System
Adaptive Neuro-Fuzzy Inference System has five layers, as shown in Fig. 3. Each layer has its own algorithm. Layer 1: Input Nodes. In this layer, each value input has its own membership value [8][9][10]. Layer 2: Rule Nodes, in this layer, the AND operator is used to determine the resulting product related to Layer 1 [8][9][10].
Layer 5: Output Nodes, in this layer, all incoming values are added up and change each output to be more accurate.
IV. EVALUATION

A. ANFIS Fuzzy Set Training
The data training process was carried out by taking 100 data from the ultrasonic sensor, which was then processed in Matlab with ANFIS. Retrieval of water level data is taken by placing an ultrasonic sensor above the aquarium, then putting water into the aquarium and removing it again. The following are the steps to do the training.
As is known, ANFIS is used because Fuzzy Set is unknown. Here, the boundary between flood and non-flood is given, which is 5 cm. If it exceeds 5 cm height, it is considered a flood. If not, it is considered no flood. These sets determine the action of the pump. It must be known that FIS works by relying on uncertainty so as to achieve better control. Here the set of a flood, no flood, or fuzzy is unknown. So labeling is done by estimation. The determination of these sets will be done through training.
After the dataset is collected, making ANFIS goes through two stages, namely the training phase and the testing phase. The training phase is used to determine fuzzy sets, fuzzy rules, and defuzzification. All are determined by varying the weight of each neuron in ANFIS. Changing these neurons is done repeatedly to get the highest accuracy. That is the highest similarity between the best FIS settings for the labels that have been given in the creation of the dataset. The repetition made is called an epoch. In this study, the specified epoch value is 736, meaning 736 repetitions to get the best performance. Fig. 4 illustrates the training phase. The visible curve explains that in each epoch, the error gets smaller, which means that a better fuzzy set is obtained. Here Matlab is used as a tool. The root mean square error (RMSE) of the training, which is the most recent value of the error curve in Fig. 4, which also means the lowest error value is is 0.001173. The next step is data testing, where RMSE will be reevaluated. The next step is testing. The testing phase is used to ensure that the ANFIS that is created already has good performance. Testing is done by using ANFIS that has been formed at the training stage in a data set that has never been used during training. Before the training stage, the dataset has been divided into two, first into training data and testing data. Data testing may not use training data. As an analogy, it is the same as giving a cheat sheet during an exam. Data testing uses 800 data. RMSE is also used to measure the performance of data testing. The result is 0.049909. Data testing also uses Matlab as a tool. Fig. 5 is the result of testing data. The closer it is to 0, the better RMSE. The RMSE of testing is not as good as the RMSE of training, but it is still close to 0.

B. Comparison Analysis
The ANFIS testing process is continued by comparing it with the FIS method, meaning that it is compared with an expert determined fuzzy set. This expert determination is based on assumptions. Table 1 shows the FIS configurations performed on Matlab. Matlab is used as a tool to create FIS. The testing process in this method is done using the same data as the data used in the ANFIS method. From the results of tests conducted on 800 data, the resulting RMSE value is 6.125. The resulting error value is higher than the value generated by the ANFIS method. In Fig. 6, a comparison of error values generated in the testing process with the ANFIS method and the Fuzzy method is presented in a bar chart form and can be seen.

C. Field Test Analysis
In the previous sub-chapter, the RMSE value from the dataset test shows that ANFIS is better than FIS and is recommended to be implemented as a flooding control system. In this section, the performance of ANFIS in a flooding control system that is implemented on an IoT basis is shown. The IoT system of the flooding control system is in accordance with the illustration in Fig. 1 and the Flow Chart are in accordance with Fig. 2. This system is in the form of a limited test environment. The limited environment here uses an aquarium with a size of 20 cm x 30 cm x 40 cm. To pump the water out, a 5v pump is used, commonly utilized in fish aquariums. The line graph in Fig. 7 shows the system performance.

D. Rainfall Analysis
Based on data from the Indonesian Meteorology, Climatology and Geophysics Agency (BMKG) in 2010, rainfall is divided into 4 categories: light with a value of 1-5 mm/hour, moderate with a value of 5-10 mm/hour, heavy with a value of 10-20 mm/hour, and very heavy with a value of more than 20 mm/hour. This can be obtained from calculations using formula (8).
Water Volume = Area x Rainfall Value (8) With an area corresponding to the container used in this study and the value of rainfall in the very heavy category, the volume of water will be worth 0.001116 cubic meters or 1,116 liters. Based on the test results, the water pump is capable of removing 600 ml/min of water in an area of 0.08 m2. Then this system can be used to overcome floods with rainfall intensity in the category of light to heavy in the area of 0.08 m2.  1  30  59  88  117  146  175  204  233  262  291  320  349  378  407  436  465  494  523  552  581  610  639  668  697  726  755  784 Pump Condition Water Level (cm)

Water Level
Pump Condition

V. CONCLUSION
In this study, it can be concluded that the use of the ANFIS method for flood control systems in the basement is recommended. This is obtained based on the results of training data, that the value of Root Mean Square Error (RMSE) from ANFIS training is 0.001173. Then based on ANFIS test results on the test data, the RMSE is 0.049909. After compared to the RMSE of FIS, the RMSE of ANFIS is better. The FIS RMSE is 6,125. ANFIS can work well in an IoT-based flooding control systems. Where the pump manages to control the water level at 5 cm, and overshoot does not occur. Based on the results of rainfall analysis, this system can be used in light to heavy rain levels. Future work is to conduct research in the test area according to the real situation. High wattage pumps can be used, and circuits that can handle high currents will be needed.