Design of Flood Early Detection System using WeMos D1 Mini ESP8266 IoT Technology

Flooding is a natural phenomenon caused by water flowing in a volume that exceeds the capacity of the media holding it. The floods affect various human activities. In addition, floods also cause material losses and other related fatalities. To overcome this problem, a flood warning system based on Arduino microcontroller technology and WeMos D1 Mini ESP8266 was designed. The data measured are water level, water velocity, and rainfall. Furthermore, the three data will be combined with Fuzzy logic to make decisions. The output of the system is in the form of a remote command signal that will activate the alarm sound and indicator lights to give a warning to the public about the potential flooding that will occur. The test results show that the measured data has become sufficient information for the microcontroller to generate the corresponding indicator lights and alarm sounds.


1.
Introduction Flooding is a natural phenomenon caused by water flowing in a volume that exceeds the capacity of its containment media. With an unsystematic system of paddy and mountain land management, when there is a high rainfall intensity for a long time, flooding is an unavoidable event. Floods affect various human activities. In addition, floods also cause material losses and even fatalities. Sumbawa Regency is located in West Nusa Tenggara (NTB) Province in Indonesia. This regency has experienced 46 times of flood disaster in the last four years. Flash floods that occurred in 2017 caused extensive material losses, especially for people who live on the banks of the river. This loss is caused by the unavailability of an early warning system for flood hazards for the community [1].
Several flood hazard early warning systems have been developed, for example, the exploration of ultrasonic sensors to detect water levels at dam doors. Then, the microcontroller sends a short message signal to the operator through the Internet of Things (IoT) module to open or close the dam floodgates [2]. Additionally, research using ultrasonic sensors to measure water level and flowmeter sensors to measure water velocity was also carried out. The output device is in the form of a web client application that displays graphs of data changes from time to time, as well as a GSM Prolink PHS100 modem to send alarm information in the form of SMS to the operator [3]. Also, other studies have been done to explore the use of ultrasonic sensors and microcontrollers to control the output device in the form of a servo motor to open and close the floodgates, as well as a buzzer that serves as a notification indicator of the system [4].
In this study, the authors designed a flood disaster early warning system based on Arduino microcontroller technology and the WeMos D1 Mini ESP8266 module. To measure water level, water velocity, and detect rain, each ultrasonic sensor, flowmeter sensor, and rainfall sensor are used. The output of the system to be designed in the form of a remote command signal will activate the alarm sound and indicator lights as a form of warning to the public about the potential for flooding that will occur. The existence of this system is expected to help the community to be better prepared to face the possibility of flooding, both in terms of soul and property.

2.
Method The workflow of the flood detection device designed in this study is shown in Figure 1. There are three measured data, namely water level, water velocity, and rainfall. Each of these is measured using an ultrasonic sensor, flow meter sensor, and rainfall sensor. Furthermore, the measured data will be used by the microcontroller to make the decision to turn on different indicators based on the conditions measured by the three sensors. Decision making on the system employed Fuzzy logic [5], according to the rules referred to in Table 1.
Level 1 interprets safe conditions that are marked with a green indicator. Level 2 interprets the alert condition that is indicated by a yellow indicator. In this situation, the communities were asked to start preparing themselves and their belongings that are possible to be saved. Level 3 interprets the alert condition that is indicated by a red indicator and an alarm sound. In this situation, the communities had to evacuate themselves and their belongings to a safer place.
.   In general, the designed flood detection device is shown in Figure 2. Each component such as the ultrasonic sensor (a) functions as a gauge of river surface water level [4]. WeMos D1 Mini ESP8266 (b) functions as a remote communication device between the transmitter and the receiver [6]. Flowmeter (c) sensor functions as a measure of river water rate [7], [8]. Rainfall sensor (d) functions as a gauge of rainfall [8]. Buzzer (e) functions as an indicator to provide a warning in the form of an alarm sound [9]. LED (f) functions as an indicator to give a warning in the form of a colored light [10].

Sensor Experimentation
Sensor experimentation was done separately. As a means of simulating the existence of a river, a prototype in the form of a rectangular aquarium container was made of hard plastic (acrylic) with a thickness of 4 mm and had a length, width, and height of 50 cm, 20 cm, and 20 cm respectively. Then, the sensor output was connected to the Arduino Nano microcontroller. As an indicator, a buzzer and several LEDs of different colors were used.

Ultrasonic Sensor Experimentation
Ultrasonic sensors were placed above the aquarium. The ultrasonic sensor works based on the time required by the waves emitted by the transmitter sensor until it returns to the receiver sensor section. The longer the time needed, the further the distance of the water surface to the sensor is. To find out the performance of the ultrasonic sensor, water is filled into the aquarium slowly, and the sensor will provide information on changes in water level in real time. Three levels are used as an indication of water level height, namely green for heights of 1.0-3.9 cm (Figure 3.a), yellow for heights of 4.0-7.9 cm (Figure 3.b), and red for height 8.0-10.0 cm (Figure 3.c). The test results of the ultrasonic sensor are shown in Table 2.  Red LED 4 Yellow LED 5 Yellow LED 6 Yellow LED 7 Yellow LED 8 Green LED 9 Green LED 10 Green LED Table 3. Results of experimentation using a rainfall sensor.

Condition Output Dry
Green LED Wet Yellow LED

Rainfall Sensor Experimentation
This rainfall sensor serves to detect the presence of rain. The rainfall sensor is a module used as a sensor of drops of water that falls into the detection board. In a dry condition, the output voltage from the sensor is 5 V. The output voltage will decrease with the presence of water that hits the detection board.
To simulate the rain, water is sprinkled on the sensor. Then, the change in the LED indicator output is running. In this experiment, dry conditions are indicated by green LEDs (Figure 4.a), while rain conditions are indicated by yellow LEDs (Figure 4.b). The results from the rainfall sensor are shown in Table 3.

Experimentation of Flowmeter Sensor
Flowmeter sensor functions to measure the speed of water flow. To simulate a change in the flow of water, it is done by changing the valve opening size of the water tap. When the valve is opened by 25%, the green LED lights up, which indicates that the water velocity is small ( Figure 5.a). When the tap is opened at 65%, the yellow LED lights up, which indicates that the water rate is at a moderate level ( Figure 5.b). When the tap is opened at 100%, the red LED lights up, which indicates that the water rate is fast ( Figure 5.c). The results of the flowmeter sensor are shown in Table 4.   Table 4. Results of water flow measurements using a flowmeter sensor.

Water Tap (%) Output 25
Green LED 65 Yellow LED 100 Red LED

System Experimentation
After viewing the performance of each sensor, the next test step is to combine three sensors, a microcontroller, and several indicators into one system. In the initial conditions, the aquarium is not filled with water. Then, the water is filled through the water tap channel, which has a large valve opening. The combination of these three sensors is done using the Fuzzy method with reference to Table  1. The overall system circuit is shown in Figure 6. The overall test results can be seen in Figure 7. The overall experimentation results of the system are shown in Table 5. Table 5 shows the output produced in each situation in accordance with the results of the operation of three sensors and Fuzzy logic that has been determined in the predetermined planning. This shows the overall system performance is good enough.

4.
Conclusion Flood detection system that is designed to measure water level, water velocity, and rainfall precisely and accurately by utilizing three sensors has been successful experimented. The measurement data is then used by the microcontroller to make decisions based on Fuzzy logic and send from the transmitter system to the receiver system in real time through the Internet of Things WeMos D1 Mini ESP8266 technology. Thus, indicators in the form of lights and alarm sounds can be raised remotely automatically in accordance with specified warning criteria. For future development, it can add other types of sensors, as well as props that can display visually to make it easier for the public to see the development of the measured parameters.