Flood water disaster warning system

Introduction
IoFloodBeacon is a flood water disaster warning system. The system will have multiple sensors such as ultrasonic water level sensor, temperature, humidity sensors, rain detector and rain gauge, atmospheric pressure sensor and light intensity sensor, wind speed and wind direction sensor. All the sensors will collect the environment and weather related data and pass those to control center using the Digi XBee3™ Cellular LTE-M embedded modem. The system will be battery powered and the battery will be charging through a solar panel. So the device can be place any remote location water reservoirs (river, tank, lake, etc.). I will create an android mobile, web interface and rest API then retrieve data from the control center then convey the information such that whether river or lake about to overflow or not to public and save their lives from the disaster. Furthermore I will develop this system to predict the disaster before it happened then I can save more people and properties from the flood water. This system will be served other disaster situation too such as land sliding.

BOM
The project requires

View attachment 184938 Digi XBee3 Cellular Development Kit
View attachment 184939 BMP180 Barometric pressure and temperature sensor
View attachment 184940 HC-SR-04 Ultrasonic sensor for measuring the water level
View attachment 186649 Rain drop sensor
Schematics
View attachment 186793


Instructions

DIGI-XBEE3 with BMP 180
BMP180 is used to measure the temperature and atmospheric pressure the most vital information for weather forecasting. Apart from flood water disaster warning the system gather environment data to predict the natural disaster beforehand. In step 1 we are going to see how the BMP180 communicate with DIGI-XBEE3 via I2C.

The BMP180 need to be wired with DIGI XBEE3 in following manner
DIGI XBEE 3 -> BMP 180
VCC -> VCC
GND -> GND
DIO1 -> SCL
DIO11 -> SDA​

View attachment 186071

Download the bmp180.py from the below link on github
https://github.com/Wickramanayaka/DIGI-XBEE3

Connect DIGI XBIB development board to a PC via USB port and install XCTU (download XCTU from https://www.digi.com/products/embedded-systems/digi-xbee-tools/xctu#productsupport-utilities )

Run XCTU and click “Add device” to add radio module to the list.
Go to Tool menu → File system manager
Click on Open to make a connection with the device.
Create folder called “lib”
Upload downloaded “bmp180.py” into the lib folder.
Go to Tool menu → MicroPython Terminal
Click on Open to make a connection with the device.
Press CTRL+B to get the python REPL
Press CTRL+E to get into the PASTE mode
Copy code snippet 1 into the terminal
Press CTRL+D to exit from the paste mode and run the pasted code snippet.
The code snippet shows temperature and pressure readings from the sensor with 1 second interval. To stop the execution press CTRL+C
View attachment 186073

DIGI-XBEE3 with HC-SR-04
The flood water disaster system periodically monitoring the water level the river , lake , tank or any water reseviour and send update to the MQTT server. The server decide whether the alarm certain parties or not. The main sensor of the system is the Ultrasonic distance measuring sensor. In the step 2 we will figure it out how the ultrasonic sensor works with the DIGI-XBEE3.


The HC-SR-04 need to be wired with DIGI XBEE3 in following manner
DIGI XBEE 3 -> HC-SR-04
VCC -> VCC
GND -> GND
DIO0 -> TRIGGER
DIO1 -> ECHO​
Download the hcsr04.py from the below link on github https://github.com/Wickramanayaka/DIGI-XBEE3
Connect DIGI XBIB development board to the PC and load the MicroPython Terminal
Get into the paste mode
Copy and paste the code snippet 02 then press CTRL+D to exit from the paste mode run the code snippet.
Point HC-SR-04 sensor to any object and the terminal will show the distance between sensor and the object in centimeters.
View attachment 186174

DIGI-XBEE3 with Rain Drop Sensor
Rain drop sensor is used to detect the rain. The sensor can be simply connected to Digi XBee3 via digital input. The wiring should be done as below.
Digi XBee3 -> Rain drop sensor
VCC -> VCC
GND -> GND
DIO0 -> DO​
Follow the same steps as other two sensors. You will not need any additional library or module in order to work with the sensor. Try the code snippet 3 to get reading from the sensor.
View attachment 187098

Video
DIGI-XBEE3 with BMP 180

Source Code
DIGI-XBEE3 with BMP 180
Code snippet -01
Code:
from bmp import BMP180
from machine import I2C, Pin
import time
bus = I2C(1, freq=100000)
bmp180 = BMP180(bus)
bmp180.oversample_sett = 2
bmp180.baseline = 101325
temp = bmp180.temperature
p = bmp180.pressure
while True:
    print("Temperature : ", temp," Pressure : ", p)
    time.sleep_ms(1000)

DIGI-XBEE3 with HC-SR-04
Code snippet -02
Code:
import hcsr04
import time
from machine import Pin
p = hcsr04.HCSR04(Pin.board.D0,Pin.board.D1)
while True:
   p.distance_mm()
   time.sleep_ms(2000)

DIGI-XBEE3 with Rain Drop Sensor
Code snippet -03
Code:
import Pin from machine
import time
dpin = Pin(Pin.board.D0, Pin.IN)
while True:
if(dpin.value()==0):
    rain ="Yes"
else:
    rain ="No"
    print(" Rain : " , rain)
    time.sleep_ms(2000)[/B][/I][/B][/B]

Blog entry information

Author
chamal1982
Views
158
Last update

More entries in General

Share this entry

Top