Designing Early Warning Flood Detection and Monitoring System via IoT

Flooding is one of the biggest natural disasters that occurs frequently around the world. It can occur without warning and the after effect of it leaves great damage to the surrounding environment and exposes life threatening to citizen. Therefore, early flood detection and monitoring system with the implementation of Internet of Things and Global Positioning System is proposed in order to reduce the risks that may cause flooding. The aim of this project is to provide the information of a current water level in a drain. When water level increases to a certain level, the system will send a warning notification to users indicating three categories of water level, which are safe, warning and critical level. This system contains an ultrasonic sensor to detect the current water level and at the same time allows users to observe the period of the water level from their phone so that users are more aware of when flooding ought to happen. Moreover, the system consists of a flooding avoidance method that requires the usage of a solenoid as a shutter valve of the drain and water pump to pump out excessive water flow to a suitable place for water release purposes.


Introduction
Flood contributes to significant danger in life and property damage in many areas over the world. In Malaysia, monsoonal flood and flash flood occur respectively during the northeast monsoon and heavy rains causing the loss of life and property damages. Flood is one of the most common natural disasters that Malaysia faced annually. Based on data collected by the Centre for Public Policies Studies, due to climate change, rainfall in Malaysia is above average especially during monsoons seasons affecting cities particularly in the eastern states such as Kelantan, Terengganu, and Perak. However, urban cities with rapid growth like Kuala Lumpur also face this problem due to the inefficiency of the drainage systems. In 2009, researchers have found that an estimation of the area at risk of flooding is approximately 29,800km 2 that is about 9% of the total area in Malaysia affecting almost 4.85 million people, which is approximately 22% of the total population in this country [1]. Over 28% of citizens supported that undeniably the main cause of the flooding is due to the improper drainage system in Malaysia [2].
Although flooding was an abnormal phenomenon years ago, it is now considered as a life threatening natural disaster for the humankind. A study stated that the effects of flooding include damages to homes, shops, transportation disrupt and industries [3][4][5]. The research pointed out that, flood victims usually have problems with the repair cost causing for example, small shops fail to reopen after the disaster. Other organisations and the government need to spend a lot of money to restore all of the broken facilities due to flooding while providing a rescue unit to keep all of the victims safe. Not only it will The 7th AUN/SEED-Net Regional Conference on Natural Disaster (RCND 2019) IOP Conf. Series: Earth and Environmental Science 479 (2020) 012016 IOP Publishing doi:10.1088/1755-1315/479/1/012016 2 cost so much money, but it will also need a lot of human force such as nurses, doctors, rescue workers and others [6][7][8].
Due to its relative regularity, flood mitigation, forecasting, and warning system efforts have been undertaking by various agencies to minimize impacts brought forth by floods [9]. Such an event scrutinizes Malaysia's ability to respond to floods in the area of readiness, relief, and rebuilding. Despite various preparations, present countermeasures remain insufficient as experienced during December 2014 to January 2015 flood crisis; where close to 250,000 residents were displaced. It is in the general interest of all stakeholders to minimize the effects of floods inflicted on Malaysian residents, not only due to its disruptiveness to the livelihood of its victims, adverse environment and health effects, and various causes to individual victims suffering from the catastrophe, but also due to the massive cost involved in the redevelopment of infrastructure. Therefore, minimizing flood occurrences would ultimately be more cost efficient for all stakeholders, primarily the taxpayers, especially in areas where floods occur on a consistent basis.
If only early flood warning system has been effectively utilized, these issues can be reduced and appropriate steps in fighting against the flooding scenario can be taken in the shortest time within the available resources [10]. Problems like this can be prevented by warning directly to the public, especially those living near the drainage [11]. Along with advances in computing technology, each community in Malaysia has been affording to have a smartphone that the usage is in rapid growth in our society. This is where Internet of Things (IoT) can come in handy. IoT is a technology that connected anything and everything to the Internet. IoT is the newest technology rapidly widen in its usage. This technology brings new products such as disaster monitoring [12]. Since flood disaster is the main concern in Malaysia because every year there are floods occurring, we can use this technology to do monitoring activity that people are not able to do in 24 hours before.
Moreover, the increase of water level without any controls when flood happens can also troubles drivers to pass through the road [13]. In most cases, flood water level rises faster and less time is available for the people to evacuate [14]. The alerts for early flood warning system usually needed for the respective organizations and authorities; this is because it will take time for them to reach as water rises quickly in most cases [15]. In general, flooding is unavoidable but the early detection and warning system will be able to reduce overheads bared by the victims and government. Therefore, the aim of this Flood Detection and Avoidance System with the implementation of IoT is to be seen as a great approach to help overcome the flooding problems in big cities. This is because, this system is needed for citizens to be aware of the flooding in their nearby areas by getting the information from the mobile phone's application such as the current water level and the flood locations. Further, the system is needed for prevention of worst damages in the country by controlling the excessive water to flow to suitable places.

System Design
IoT is being implemented in the design of this project where it is used as a foundation for data transmissions between the detection devices to the mobile application. Ultrasonic sensor helps to convert energy into ultrasound and in this project, a waterproof sensor used to detect and monitor the level of water from time to time. Global Positioning System (GPS) is being implemented to provide the exact location of the flood area. The system also consists of a flooding avoidance method that uses a solenoid valve to control the excess water flowing out so that the water level can be controlled before flooding occurs. Flood detection and avoidance system not only can create awareness so that citizens can make early preparation after being notified by the mobile phone application, they are also able to monitor water level at any time of the day. Users can also know the flooding areas that are shown by the GPS map in the application. An avoidance system is made to slow down the increase of water level so that users have enough time to make preparation before flood occur. Figure 1 shows the block diagram of the system where there are two inputs in the system consisting of the ultrasonic sensor and the GPS 3 module used to receive the data processed in the NodeMCU controller. Meanwhile, the outputs of the system include the IoT platform which are the Blynk app and the solenoid valve. Table 1 summarizes the function of the components used.

Working mechanism
The detection system includes three levels where the water is measured at the safe level, warning level and critical level. Ultrasonic sensors are used to detect the water level and for each level, the depth has been decided where for the condition to be at the safe level, the water must be less than 14cm deep while for warning level, the water has reached a depth between 14cm to 18cm. The critical level is when the water is over 18cm deep.
Throughout the three levels, users are able indirectly to monitor the current water level in the drain at a specific location that they desire through an app on their phone. During safe level, a shutter that is used to flow out any excess water will be OFF. This is because there is no triggering danger yet based on the current water level. However, as water continues to rise to the warning level, app users will start to receive a notification alert on their phone to remind them of the current water level. The same method applied when the water level reaches the critical level. App users will once again receive a notification alert but this time it will warn users of the critical water level.
During both of these situations, the shutter will finally turn ON and therefore will allow excessive floodwater from the drain to flow out to other suitable places. This mechanism of flood avoidance is fairly new and never been done by other companies before. In fact, the GPS system that is available in this project allows users to know the exact location of a place with a rising water level. This in return will enable road users to avoid driving through flooded areas and at the same time can avoid heavy traffic congestion due to flood. Figure 2 summarizes the working mechanism of the system in a flow chart. Allows excess water to flow out to suitable places   Figure 2. Flowchart of the system.

Integration
The integration between the software and hardware is made by using a nodeMCU with ESP8266. For the IoT part, nodeMCU has uploaded the sketch of the coding of Blynk mobile phone application, Wifi ID and WiFi password, this allows nodeMCU to process the WiFi module to connect the WiFi and then connect to the Blynk apps. With the connect of Blynk, the nodeMCU proceeds the coding which acts as the controller to control the flow of the system such as assign ultrasonic sensor as the input data and process the input in the nodeMCU to identify the current water level categories and send data to Blynk. When the input data from the ultrasonic is matched to the warning level value which is set inside the coding of the nodeMCU, the nodeMCU will process the part of the warning level process to send warning level's notification ("water increase to WARNING LEVEL") and activate solenoid and water pump.
Meanwhile, for critical value, nodeMCU still activates the solenoid and water pump and sends critical level's notification ("ALERT!! water increase to CRITICAL LEVEL!!") to the Blynk app. For the GPS part, the activated GPS coding is uploaded inside the nodeMCU and nodeMCU activates GPS antenna to have the connection with the satellite and if the satellite is connected, the longitude and latitude values are received inside the nodeMCU and then the data is sent to the BLYNK to show the location. Figure  3 shows the schematic diagram of the system and Figure 4 shows the overall circuit setup.

Result and discussion
The main results of this project are divided into two categories, which are the function of the prototype and the data collecting results. The prototype was shown in Figure 5 below where the design was made according to the situation. The categories of the water level in the drainage designed together with the prototype is measured based on the depth of the water that has been set such as in Table 2. Figure 6 shows that the water level is at a safe level where from inside the drainage, it can be seen that the water level is lower than 14cm. In this stage, the solenoid and water pump are inactive. Figure 7 shows the water level graph that can be monitored in the Blynk app. It shows there are some inaccurate current water level, data happens frequently; this is because of the limitation of the ultrasonic sensor due to the affect from temperature, wind rate, noise and humidity. Figure 8 shows the water level inside the drainage of the prototype showing that it is at a warning level where the water level is below critical level and higher than safe level, roughly between 14cm and 18cm. At this stage, the solenoid valve and water pump are activated where the solenoid opens the valve and the excessive water is flown out of the drainage by the water pump. The users can also monitor the water level through the monitoring graph that was built-in the app where the graph, such as in Figure 9 shows that the water level is above 14cm. When this condition occurs, a warning message is sent to the users of the mobile application to alert them about the water level rising. Figure 10 shows the demonstration of the pop-up warning message that the users will receive via the Blynk app.          Figure 11 shows the water level inside the drainage at a critical level, which is above 18cm. At this stage, the solenoid valve and water pump are still activated to flow out the excessive water in the drainage. Figure 12 shows the water level monitoring graph in the mobile phone application during critical level. Besides that, when the water level exceeds 18cm, a warning message will pop-up on users' mobile phone to notify users about the rising water level that has reached a critical level. This message will allow users to act faster before the flooding situations worsen. Figure 13 shows the alert message that popped-up on users' mobile phone.

Testing on critical level
When the water level decreased from warning level to safe level, the solenoid and the water pump will switch OFF automatically where the extra drainage system is shut off hence resulting in the water to stop flowing out of the drainage. The system designed also includes a GPS to tell the users the exact location of the flood so that they avoid the area especially when they are on the road. The GPS takes about 15 minutes to receive data from the satellite and it displays the pinpoint at the GPS map in the Blynk app as shown in Figure 14.

Conclusion
In conclusion, this product has been successfully applied by using the ultrasonic sensor to detect water levels and send the data to the mobile phone application through IoT. The activation of GPS Neo -6M to connect to the satellite allows the coordinates of a specific location to be transmitted thus providing accurate flooding locations that can be monitored through the mobile application. Next, the nodeMCU is used to control the system's water level features (safe level, warning level, and critical level). NodeMCU allows the system to detect the water level according to the set values for each level. The water level that matches the value of a warning level will result in activating the solenoid valve to pump the excessing water out and notifying the users simultaneously via the mobile application. The action of the activated solenoid valve is the same while the notification message that pops up on users' mobile phone will alert them on the critical state of the rising of water level once the water level reach its critical set value. Hence, users are alerted and precautious steps can be taken ahead of time before the flooding worsens.