Water level monitoring using Ultrasonic Sensor | Water Tank level monitoring

(Last Updated On: July 17, 2019)

Water level monitoring

Description:

In this Tutorial, you will learn how to make a Water level monitoring system using Arduino, ultrasonic sensor and some leds. The leds are used to show the percentage of water available in the Water tank. This is a beginner’s level project explaining the basics. While in the next version of the water level monitoring system I will use Nodemcu esp8266 wifi module to monitor the water level on my cell phone and also control the water pump from anywhere around the world, so the next version will be entirely based on today’s episode. So I highly recommend you should watch this tutorial from start to the very end. This Tutorial covers

  1. Circuit diagram Explanation
  2. Interfacing
  3. Programming and finally number
  4. testing


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
HC-SR04 Ultrasonic Sensor: https://amzn.to/2GJrjgP
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330 ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

HC-SR04 Ultrasonic Sensor:

Water level monitoring

This is the HC-SR04 Ultrasonic Sensor. As you can see the pins are clearly labeled with vcc, trigger Echo and ground. I have a very detailed getting started tutorial on how to use the HC-SR04 ultrasonic sensor with Arduino. I will provide a link in the description.


Circuit Diagram:

Water level monitoring

This circuit is designed in cadsoft eagle 9.1.0 version. if you want to learn how to make a schematic and pcb then watch my tutorial.

As you can see the circuit diagram of the water level monitoring system is really simple. The trigger pin of the ultrasonic sensor is connected with pin number 7 of the Arduino. While the echo pin of the ultrasonic sensor is connected with pin number 6 of the arduino.

the vcc and gnd pins of the ultrasonic senor are connected with the arduino’s 5v and ground pins. These are the 5 led’s which will be used to display the percentage of water available in the water tank. The first led will show 20% , the second led will show 40% and so on. So the last led will show 100%.

These are the current limiting resistors which are connected in series with these 2.5v leds. I have a very detailed tutorial on how to calculate the value of the current limiting resistor. you can find link in the description. These led’s are connected with the arduino’s analog pins A0 to A4…


Soldering & Interfacing:

For the Soldering and Interfacing watch video tutorial given at the end of this Article.

Programming:

 

The trigger pin is connected with pin number 7 and the echo pin is connected with pin number 6 of the arduino.

Then defined pins for the led’s which are connected with analog pins A0 to A4. Total of 5 led’s are used in this project. if you want you can increase and decrease the number of led’s as per your requirement.

As you know my friends every Arduino and Mega program has at least two functions, which are the void setup and void loop functions. Void means that these functions are not returning any value while the empty parenthesis means that these functions are not taking any arguments as the input.


The trigger pin is set to output while the echo pin is set to input. Set all the leds to output using the pinMode function. Turn off all the led’s using the digitalWrite function.

defined two variables with the names duration and distance. Turns on the trigger pin for 1000 microseconds and then turn it off. . then using this formula we find the distance in centimeters. The rest of the programming is very simple and is only consists of the if conditions. The led’s are turned on and turned off depending on the distance of the water level from the ultrasonic sensor. The Values used in these if conditions can be changed as per your requirement. The type of the ultrasonic sensor I am using is capable of measuring the distance up to 5 meters.


Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Close