Introduction: Flood Detection and Warning System

Floods are dangerous and devastating. One of the world's most damage especially economic is caused due to floods. Floods are mainly caused due to heavy rainfall or increased water flow rate. Floods cannot be measured solely using increased height of water because the width of river and topology of river channel also matters. One thing we can do is use flow rate as a direct measure to detect flooding. We also use soil moisture sensor to find volumetric water content of soil and using rainfall level, we can detect floods due to heavy rainfall.Also measuring volumetric water content can be used to asses drought, agricultural productivity, weather forecast and also floods obviously.

We implemented using a two layered, interrupt based approach. First layer is a network of bolt processors receive data from sensors and transmits this data to central second layered bolt processor. There is a soil moisture sensor and a piezoelectric sensor for measuring volumetric water content in soil and flow rate of water. The second layered, server node continuously communicates with first layered blot processors and stores the readings in a database and also draws flow rate and soil moisture content graphs w.r.t time of day. Whenever the readings cross the threshold value, a warning mail and message is sent by the server node itself, to all the registered hosts in that region. A curious user can logon to app and check the flow rate graphs and soil water content graphs for any particular river and region.

Step 1: BOLT Implementation for Peizo-electric Sensor and Soil Moisture Sensor

We are using the above piezoelectric sensor. A clear explanation of it is given in wikipedia. More pressure in middle part causes increase in voltage measured across the terminals. The values of this sensor output is directly proportional to the pressure with which water exerts and so forth the flow rate. The outer terminal is connected to GND and inner is connected to A3 and this analog value is sent by first layered blot node to second layered server node continuously.

We are also using soil moisture sensor which has four terminals Vcc, GND, AO, DO, we use AO presently as we need analog values for computing graphs. AO is connected to A0 pin of blot. The code is here .

Step 2: Server Node Implementation of the App

As we have seen there is another layer of network between the end users i.e. the common people and the wsn's. This layer consists of a server node or server nodes.Our idea was to have a server farm that coordinates the wsn's across the region for faster response.For the prototype model due to lack of resources and time the second layer has a single server node.The main reason we went for a server node is to provide an interrupt based system and real time system as the issue we are trying to deal is sensitive and time lag is not tolerated.

The idea is that the lower layer of WSN's transmit JSON objects to the server node at a constant rate i.e. the average flow of water (in correlation with the pressure) and the moisture content of the soil.We then convet the JSON objects to csv format and then load it to the database.The database file structure and the receipt of sensor data code is included in the files.

We are sensing the average water flow per minute and then comparing with average so far we decide if the water level is alarming or not.Then we have the alerting system that is based on the IFTTT module of the bolt processing unit.The better suited sensors were water flow sensors and sonars as they provide more accurate means of the depth of the water which is a major factor in detecting floods.Then we moved to plotting graphs using the data we stored using gnu plot which will then be loaded onto the end user web portal explained in the next section.Server Node ImplementationDBMS Structure

Step 3: End User Implementation of the App

The third part and the final part of the project is End User implementation of the app. This shows what a user sees when he opens the app.The code for this: is given above.Here, when a user fills the river and area fields, we send a request asking for graph of that particular region. The server responds with the graphs.