Water Level Monitoring System

by Rabill_MR in Circuits > Arduino

9820 Views, 66 Favorites, 0 Comments

Water Level Monitoring System

20200514_102343-01.jpeg
20200429_161624.jpg
20200430_112229.jpg
20200514_102343.jpg

As a DIY Maker, I always try to find a way to make my life and other's life easier and safer. On the 30 march 2013, at least 11 people have died after sudden rain caused flooding in the Mauritian Capital Port louis. On the same day several houses were flooded while many villagers assets were damaged. As I live few kilometers where this tragedy happens, I decided to build a water level monitoring system. Together with a fantastic and motivated team, we were able to build it.

The project is quite easy to replicate it compose of an arduino MKR WAN 1310, ultrasonic sensor, DHT11 sensor and some leds and push button to make the project cool.

Supplies

Material :

  • Arduino MKR WAN 1310
  • Ultrasonic Sensor
  • DHT11 J
  • ump wires
  • Plexo box
  • Gateway
  • Leds
  • Push button

Tools :

  • Hand drill
  • 5mm bit

Preparing the Plexo Box

20200429_161837.jpg
20200429_161804.jpg

For the enclosure, i'm using a 80x80mm plexo box as it is strong and durable. Firstly I removed the the caps for the ultrasonic sensor and the power cable. This is very easy as the diameter of the hole is same as the diameter of the ultrasonic sensor.

Secondly, I drill a 5mm hole on the top of the case for the antenna. For this, you can use a drilling machine or a hand drill as in my case.

Putting the Components

20200429_162152.jpg
20200429_162010.jpg
20200429_161919.jpg
20200429_162250.jpg
20200429_162125.jpg
20200429_162135.jpg

I had to trim the length of the ultrasonic sensor wire as it was too long to fit in the box and finish it with female pin header at the end for connection. The sensor can then be push inside the case and lock itself with the built in lock system.Then i added the mkr wan 1310 board and the sensors module.

I put the waterproof side connector for power outlet as i do not want water to come inside.

Tinkercad Circuit

fdhd.png

During the past 3 years, I have made a lot of circuit. But i did not have an arduino. Tinkercad was the only way for me to learn and develop arduino circuit and simulating them. Even after I got my arduino uno, I still use tinkercad circuit to simulate my project first.Tinkercad circuit allow you to use a multiple of component and troubleshoot them. I highly recommend tinkercad circuit for beginner and arduino user as it will prevent you from burning your arduino when trying new circuit.

Connecting the Wire

20200429_162625.jpg

You can follow the tinkercad circuit as above or you can follow the bellow connection.

DHT11

+ > 5v

Out > pin13

- > ground

Ultrasonic sensor

+ > 5v

Trigger > pin7

Echo > pin8

- > ground

Using jumper wires you can make the connection easily and attached them with zip ties.

Adding Leds and Push Button for Troubleshooting

20200430_123425.jpg
20200430_121235.jpg

I'm using a red and green led to show the state of the device and a push button to reset the device. As my design has work on tinkercad circuit, i pretty sure it will be in real life. So i have made a small pcb so that i can reduce the amount of wires.

Coding

I'm using the online IDE and the code are as below file

The Thing Network Setup

20200528_061936.jpg

You can follow these steps on that link . It is super easy with detail explanation. I added the payload decorder in the image above and the text.


function Decoder(bytes, port) {
var decoded = {};
var result = "";
for (var i = 0; i < bytes.length; i++) {
result += String.fromCharCode(parseInt(bytes[i]));
} return {
field1: result,
};
}


This is very important in order to get a readable alue

Receive Data

Screenshot_20200429-170307_Chrome.jpg
Screenshot_20200429-170405_Sheets.jpg

You can see on the above screenshot how i'm receiving data via TTN on my phone.I'm also using the IFTTT integration to display the data in my google sheet.comment down below if you want to know how I made it.

Final Solution

20200501_144654.jpg
IMG-20200426-WA0007.jpg
IMG-20200426-WA0006.jpg

The product is still in the phase of development. I 3d print a new enclosure but need to reinforce it. It is using a 12v solar panel to power it. I'm currently testing it before I install it at the river bank. I will soon publish an instructable to show how i will place the device at precise location.