IOT Water level monitoring using Ultrasonic Sensor

(Last Updated On: June 25, 2020)

iot water level

Description:

IoT water level monitoring system-In today’s tutorial, you will learn how to make an IoT water level monitoring system using the HC-SR04 ultrasonic sensor, Nodemcu esp8266 wifi module, and Blynk application. This project is based on two-way communication, you can monitor the Water level in real-time and you can also control the water pump. The lamp indicator represents the water pump.

You might be wondering, why am I using the Arduino board with the Nodemcu ESP8266, if he same thing can be done using only the Nodemcu module. Well, in this tutorial, my main concern is to also explain how you can do Serial communication between the Arduino and Nodemcu Module.

 This is the 2nd version of the water level monitoring system. While in version 1 of the water level monitoring system I used only the LEDs to show the percentage of water available in the Water tank. As today’s episode is based on version 1,  so I highly recommend you should watch my previous tutorial on the water level monitoring system using led’s , because in this episode I will only explain the modifications.  This Tutorial covers

  1. Complete circuit diagram explanation.
  2. Blynk Application designing
  3. Arduino and Nodemcu programming and finally
  4. Testing


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

Arduino Uno:
Mega 2560:
HC-SR04 Ultrasonic Sensor:
Nodemcu esp8266 wifi module: Best price:

Other Tools and Components:

Super Starter kit for Beginners

Two Channel / 200 MHz Digital Oscilloscope

Variable Supply:

Digital Multimeter:

Soldering iron kit: “best”

PCB small portable drill machine:

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!


Circuit Diagram:

iot water level

Circuit Diagram of the IoT water leveling monitoring system

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 sensor are connected with the Arduino’s 5v and ground pins. LED3 to LED7, 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. These LEDs are connected with the Arduino’s analog pins A0 to A4…

The circuit in the upper left corner is the 5v regulated power supply based on the lm7805 voltage regulator. This 5v power supply will be used to power up the Nodemcu esp8266 wifi module. Two 470 UF capacitors are connected at the input and output of the 7805 voltage regulator. A 330-ohm resistor is connected in series with the led. This is a current limiting resistor.  J1 is the dc female power jack where you can connect a 12v adaptor or battery. A wire from the output of the voltage regulator is connected with the Vin pin of the Nodemcu module.

The tx and Rx pin’s of the Nodemcu are connected with pin2 and pin3 of the Arduino. So the Nodemcu will communicate serially with the Arduino through pin2 and pin3. Pin2 is the Rx and pin3 is the tx, which will be defined in the programming using the software serial library.

This is a 12v SPDT type relay which will be used to control the water pump. But for the demonstration purposes, I will connect an indicator lamp. This relay will be controlled using pin number 13 of the Arduino.


Blynk application for the water level monitoring:

IoT water level monitoring system, Blynk application designing

First of all, open the Blynk application…..

iot water level

set the project name as Water tank…..

iot water level

Click on the choose device and select nodemcu….

iot water level

make sure you set the connection type to wifi….

iot water level

then click on the create button…

iot water level

an authentication token will be sent on your email id, which will be then used in the programming, simply copy and paste it in programming …

iot water level

iot water level

iot water level

Now click on the screen and search for the level v widget and add it…..

iot water level

Click on the level v widget set the title as water level.

iot water level

now click on the pin and select virtual pin v2…

set the minimum value to 60 and maximum value to 0…

iot water level

then click on the push and select 1 second….

now again click on the screen and this time add the numeric input…

Click on the numeric input and set the title as water pump…

now click on the pin and select virtual pin v10…

iot water level

you can change the font size if you want, let’s select the large type…

set the minimum value to 10 and the maximum value to 11…

iot water level

so now our Blynk application is ready.

Iot water level Programming:

For the step by step program explanation watch video Tutorial given at the end of this article.

Water Level Monitoring Arduino Programming:


IoT water level monitoring system Nodemcu Programming:

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...

9 Comments

  1. Hi Sir Good Afternoon i am trying to interface the water level sensor using Arduino nano for harvesting the fish Aquarium automatic water level detecting and filling the water below average of water but, the tank depth was 45CM the sensor size only the 5 cm how to apply the same application using long height sensor OR if any chance to increase the size of sensor please reply this question sir thank you

    1. Ultrasonic Sensor has a long detection range. You can watch my other tutorial on water level monitoring system in which I have used LEDs for different levels. that tutorial will help you.

  2. Hi Sir Good Afternoon i am trying to interface the water level sensor using Arduino nano for harvesting the fish Aquarium automatic water level detecting and filling the water below average of water but, the tank depth was 45CM the sensor size only the 5 cm how to apply the same application using long height sensor OR if any chance to increase the size of sensor please reply this question sir thank you

  3. Hi, sir, I have tried your 1st water level indicator by pro mini. I have used only 3 nos of led for testing purposes. But it indicates only one led out of three led. The other two led indicates but very very dim and o/p voltage of Arduino for this two is 0.15 volt during on condition. Where’s 3.4 volt o/p of 1st led during on condition. The all three led off condition Arduino o/p is 0 voult. I have change by another new pro mini but same thing happened. Checked every loose connection but not found. I have upload the program to pro mini by uno. After uploading the tx led of uno is glowing continuesly. Now without your help I can’t compete this project. …… Susabhan.

Leave a Reply