Water Level Monitoring System

6,790

62

22

Introduction: Water Level Monitoring System

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

Step 1: Preparing the Plexo Box

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.

Step 2: Putting the Components

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.

Step 3: Tinkercad Circuit

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.

Step 4: Connecting the Wire

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.

Step 5: Adding Leds and Push Button for Troubleshooting

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.

Step 6: Coding

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

Step 7: The Thing Network Setup

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

Step 8: Receive Data

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.

Step 9: Final Solution

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.

Arduino Contest 2020

Participated in the
Arduino Contest 2020

1 Person Made This Project!

Recommendations

  • Back to School: Student Design Challenge

    Back to School: Student Design Challenge
  • Micro:bit Contest

    Micro:bit Contest
  • Tinkercad Student Design Contest

    Tinkercad Student Design Contest

22 Comments

0
Rabill_MR
Rabill_MR

Answer 1 year ago

I used the second one because it is waterproof while being accurate enough

0
georg.stackelberg
georg.stackelberg

Reply 1 year ago

Just found this in the Arduino forum and it sounds very interesting:

"I had received that AJ-SR04M sensor once when I had ordered JSN SR04T. Personally I found it quite unstable in terms of readings. Instead of hassling with soldering of resistors on JSN-SR04T/AJ-SR04M to make it work in mode 3 UART, I personally switched to a better sensor from here (https://www.ebay.com/itm/253978673298).It has less minimum detection/blind distance of around 3cm as compared to JSN-SR04T/AJ-SR04M and it works in mode 3 i.e UART mode out of the box directly."

s-l1600.jpg
0
Rabill_MR
Rabill_MR

Reply 1 year ago

Oh thats nice, i need to check this out. Thanks

0
georg.stackelberg
georg.stackelberg

Reply 1 year ago

I have just received a sensor model JSN-SR04T-2.0 and it works well.

IMG_7459.jpeg
0
Rabill_MR
Rabill_MR

Reply 1 year ago

Nice, good to know

0
georg.stackelberg

Nice project and I got it running👍
My comments:
- The sensor in use (4-Pin) does not match the TinkerCad Circuit (a 3-Pin)
- The black sensor on your photo (is it a AJ-SR04M?) says "Out of Range". Only HC-SR04 works fine!
Missing: TTN Payload Decoder

0
Rabill_MR
Rabill_MR

Reply 1 year ago

Thank you. Yeah i use the 3pin HC-SR04 sensor in the tinkercad just for an example. DC5V JSN-SR04T Ultrasonic Module i used.
I will post the Payload Decorder too

0
Rabill_MR
Rabill_MR

Reply 1 year ago

I will need to order 1 too then i can do the test

0
Rabill_MR
Rabill_MR

Reply 1 year ago

I will need to order 1 too then i can do the test

0
georg.stackelberg
georg.stackelberg

Reply 1 year ago

Thx for your quick feedback👍

I have tested:
- a AJ-SR04M which gives a "Out of Range" (black, splashproof)
- a HC-SR04 which works OK
You have tested:
- a JSN-SR04T which works OK (black, splashproof)

So seems there is a difference between AJ-SR04M and JSN-SR04T.
Actually both look the same...
I will do a research. But maybe you know the difference?

0
Rabill_MR
Rabill_MR

Reply 1 year ago

No i have never work with the SR04M

0
Rabill_MR
Rabill_MR

Reply 1 year ago

Do check the photo i attached in step 7 it shows the payload decorder. Thanks again

0
Rabill_MR
Rabill_MR

Answer 1 year ago

Yeah thats would be great, need to do some datasheet research on that sensor

0
georg.stackelberg
georg.stackelberg

Question 1 year ago on Step 7

TTN Decoder works fine for ultrasonic.
Would you like to add temperature data?

0
Rabill_MR
Rabill_MR

Answer 1 year ago

Im still working on that, but as the sensor will be place far from the gateway, i can not send long payload. Im only using temperature and humidity to calculate distance and send only the distance value to gateway. It is good to try this too.