Software apps and online services
Floods are dangerous and devastating. Some of the most damage to the world, especially economic, is caused by floods. Floods are mainly caused by 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 a 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 assess drought, agricultural productivity, weather forecast and also floods, obviously.How It Works
We implemented this using a two-layered, interrupt-based approach. The first layer is a network of bolt processors that receive data from sensors and transmit this data to central second layer 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 layer server node continuously communicates with the first layer 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 email and message is sent by the server node itself to all the registered hosts in that region. A curious user can logon to the 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 the first layer blot node to the second layer server node continuously.
We are also using a soil moisture sensor which has four terminals: Vcc, GND, AO, and 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 WSNs. This layer consists of a server node or server nodes. Our idea was to have a server farm that coordinates the WSNs 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 with is sensitive and time lag is not tolerated.
The idea is that the lower layer of WSNs 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 convert 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 the 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 Implementation DBMS 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 a graph of that particular region. The server responds with the graphs.