Home Education The Ultimate Guide to Automatic Water Level Controller

The Ultimate Guide to Automatic Water Level Controller


To develop an automatic water level controller will help us to save Wastewater with the help of ultrasonic Sensor (HC-SRO4) we are going to use Arduino IdE, MIT app inventor, Esp32 and real time database.

As we know water is very precious for the living beings and scarcity of the same is gradually increasing.

In this digital era, the life of human beings is getting simpler as almost everything is automatic, replacing the old manual systems.

Hence we are going to work on an idea that will reduce the wastewater and also this project will make the controlling of water level in the overhead tank automatic.

By this way the Automatic water level controller will make our life more comfortable and it will also help our society to save water in a huge amount.

What’s in for you

  1. Why we need it
  2. Problem summary 
  3. Aim and objectives
  4. Keywords of project
  5. Tools and resources used
  6. Methodology
  7. Working of the circuit
  8. Expected outcomes
  9. Stumbling blocks
  10. Conclusion
  11. FAQ

1. Why we need it

Most of the cities in the county and that of the world are facing this problem. If this kind of project works on than this would turn to be a great startup Idea.

The water is also getting wasted in cities due to improper infrastructure and less awareness towards the saving of water and hence to save water we must do something as soon as possible.

In many houses there exists unnecessary wastage of water due to overflow from overhead tanks etc. Automatic Water Level Controller can provide a solution to this problem.

Hence, it is of most important to preserve and save water.

This is one of the motivations for the current work and to deploy techniques in order to save water and which in turn ensures water for the future.

2. Problem summary to develop automatic water level Controller

1.There is no automatic way to turn on the motor of an overhead water tank.

2. Not having any appropriate way to determine the level of water or percentage of water in the tank.

3. No way to determine the flow rate of the tank.

4. There is no way for the alarm system to know that the tank is now full.

5. Not having an automatic way to switch off the Motor.

6. Apart from the automatic system there should be a way of getting into manual mode, in case of urgency or in any trouble.

 3. Aim and Objectives

To develop a product i.e an automatic water level Controller that could solve all the above mentioned problems and must be reliable for continuous operation and have a long life

4. Key things of Automatic water level indicator:

IoTinternet of things to operate motor automatically
Esp32a microcontroller with in built WiFi system
Relayan electrically operated or electromechanical switch
HC-SR04Easily available type of ultrasonic sensor
MIT app inventoran Android application building website
Google FirebaseTo create a real time Database got the IoT

5. Tools and resources used

Hardware tools:

  1.    5V DC motor 
  2.    Electromagnetic relay
  3.     Esp 32 or Esp 8266
  4.     5V HVDC converter 
  5.     Ultrasonic sensor 
  6.     Connecting wires
  7.     Led lights 

Software resources:

  1.     Google Firebase 
  2.     MIT app inventor
  3.     Arduino IDE

6. Methodology

1.Working of Esp8266:

The ESP8266 WiFi Module is a self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network.

The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor.

2. Working of HC-SRO4 (ultrasonic sensor):

The HC-SRO4 module consists of four pins

pin Name
VccVoltage pin
Gndground pin
Triggtrigger pin 
EchoEcho pin 

The module sends out a burst of sound waves, at the same time it applies voltage to the echo pin.

The module receives the reflection back from the sound waves and removes voltage from the echo pin.

On the base of the distance a pulse is generated in the ultrasonic sensor to send the data to NodeMCU or any other microcontroller.

The starting pulse is about 10us and the PWM signal will be 150us-25us on the base of the distance. If no obstacle is there, then a 38us pulse is generated for NodeMCU to confirm that there are no objects detected.

Before getting the reading of the HC-SR04 know about the calculation:

FORMULA: D = 1/2 × T × C where D is the distance, 

T is the time between the Emission and Reception and C is the sonic speed.

Also see : Project on Electricity through speed breaker

3. Interface HC-SR04 for making automatic water level controller

Interface HC-SR04 Interface HC-SR04

The circuit connections are made as follows:

The Ultrasonic sensor Vcc is connected to the NodeMCU +3.3v

The sensor GND is connected to the NodeMCU GND

Trigger Pin is connected to the NodeMCU Digital I/O D4

Echo Pin is connected to the NodeMCU Digital I/O D3

And now the microcontroller needed to be programmed through Arduino ide software with the following program of interfacing the Arduino ide with esp8266 or esp32.

You can get the Programming of Arduino ide from GitHub or write it by yourself.

Also see : basic details of Instrument Transformer and it’s specifications

4. Creating Real time Database: 

After this one has to create the  real time database from the Google Firebase or from any other Platform available.

Google Firebase is a Google-backed application development software that enables developers to develop iOS, Android and Web apps.

Firebase provides tools for tracking analytics, reporting and fixing app crashes, creating marketing and product experiments.

This real time database will have an URL key and a password, this URL and password needed to be put in the program of Arduino before uploading.

By this way the real time database will now be linked with the Esp8266 and the value of the esp pin’s can be shown or can be changed from the database.

5. Creating an Android App:

To operate the Automatic water level indicator, we have to make an Android App to switch On/Off or control the circuit.

MIT App Inventor is an online platform designed to teach computational thinking concepts through development of mobile applications.

Students create applications by dragging and dropping components into a design view and using a visual blocks language to program application behavior.

After interfacing the Esp8266 and ultrasonic sensor one needs to create an app from the MIT app inventor or from any other websites as per their needs.

While developing this app it would ask the database secret key ( password ) and URL key, by this way the App will be linked to the Firebase.

Hence the value stored in firebase can be seen from the app and also it will be able to change the value stored in firebase as ultimately changing the value of Esp’s pins, and controlling the ON and OFF operation of the relay thereby controlling the motor.

Also see : how to do a project on Electricity through road speed breaker

6. Output demonstration: 

Now, you’re done with your interface.

You can see the readings of the ultrasonic sensor in the serial monitor.

Well, now let’s measure the distance of the object.

7. Measurement of the Distance:

We can determine the distance because we know how long it took for the sound waves to travel out from and back to the module (by how long the echo pin was HIGH) and we know the speed of sound in the air.

But I am not getting into that. We’re going to let NodeMCU figure out that stuff.

Look at the distance in the serial monitor of the object placed in front of the sensor, the sensor gives an accurate measurement range from 2 – 400cm.

7. Working of the circuit

The Ultrasonic sensor will be mounted on the top of the tank, it will measure the distance of the water level by producing ultrasonic waves.

This level will be received by Esp8266 and Eep8266 will send the level of the tank to the Google Firebase in real time through which it’s is interfaced through coding, this level  ( data ) will be sent to the app which is connected with the firebase and develop through the MIT app inventor

Hence one could see the level of the water through the app and there will be also buttons for controlling the the esp8266 pins and ultimately the motor connected through relay.

Thus by this way the automatic controlling of the Motor of the overheard tank will be possible.

8. Expected outcomes

1. This method the operation of the on and off of the motor will be on fingertips.

2. The Ultrasonic sensor will be mounted on top of the tank, hence by this way it will not be in direct contact with the water. 

3. Hence the circuit will be safe from the damages and will last longer.

4. The controlling of the Motor will be occurring in very less time, as it is connected to the real time data base.

5. This method will be cheapest.

6. It’s implementation will be very much easier as compared to other methods available.

7. This method will save a lot of wastewater. Apart from automatic mode, there will also be feature of manual mode

9. Stumbling blocks

1. The automatic mode with the manual mode can create complexity while designing circuits as well as while operation.

2. If the circuit is damaged during the operation then it will create a lot of problems, but the chances of happening this kind of thing will be very less.

3. There can be a latency in actual operation when the number of devices will increase on the firebase.

4. A little monetary charge will apply if one uses a database of any other Platform other than Google Firebase.

10. Conclusion

By this project, we will be able to save a huge amount of waste water from the overhead tank and also it will save electricity by switching off the motor on the right time due to real time database of Google firebase.

Also see : If you are preparing for Gate Examination then read this blog.

Frequently asked questions

What is the Aim of Water level Controller?

To develop a product that could solve all the above mentioned problems like Saving wastewater, making it Automatic and easy to use.
And also must be reliable for continuous operation and have a long life.

What are the objects used in the Water level controller?

In the implementation of Water level Controller Arduino IDE software, IoT Programming, Esp8266, Relay, ultrasonic sensor HC-SR04 and MIT app inventor are used. 

What is MIT app Inventor?

MIT App Inventor is an online platform designed to teach computational thinking concepts through development of mobile or Android applications.

What is Esp32?

The ESP8266 Wi-Fi Module The ESP32 is a low-cost system-on-chip (SoC) series created by Espressif Systems.
The Esp32 has both Wi-Fi and Bluetooth capabilities, which make it an all-rounded chip for the development of IoT projects.



Please enter your comment!
Please enter your name here

Exit mobile version