Water Tank Level Controller Using Arduino

Water is very essential in our daily life. As we know the earth is made of 3 parts of water. But only 3% of this is fresh water. So we have to stop the wastage of water. There are many ways where water gets wasted. One of these is overflowing of tank or reserver of multiplexes, houses, flats, etc. We have an excellent solution to this problem. In this project, we are going to make an Arduino based Water Tank Level Controller System. This project is going to be very interesting.

Principle Behind Arduino Based Water Level Controller

The principle of the Arduino based water level controller is very normal. This project is based on Arduino and ultrasonic sensors.

Ultrasonic sensors are working on the basis of ECHO. We all know ultrasonic sensor works using sound waves. Sound waves get transmitted in the environment and received back to the sensor as ECHO.

We just need to calculate the time of both sound waves travelling time. When they strike obstacles and return to the sensor. After calculation, we have the distance in the result. We used this concept to control the water tank. The water pump is automatically turned on when the water level is low and turned off when the level is high.

Must Read Water Tank Overflow Alarm

Project

Water Tank Level Controller Using Arduino

Circuit Diagram

Water Tank Level Controller Circuit Diagram
Water Tank Level Controller Circuit Diagram

Components Required

  • Arduino
  • Ultrasonic Sensor HC-SR04
  • 16×2 LCD Display
  • 5V Relay Module
  • BC547 NPN Transistor
  • Resistors (1K, 10K, 100 (x2))
  • Red LED
  • Green LED
  • 5V HI-Link AC-DC Converter (For PCB Use Only)
  • Veroboard
  • 5V Power Supply

About Parts

Arduino UNO

Arduino uno
Arduino UNO

Arduino Uno is a microcontroller board based on the ATmega328P chip. It has 14 digital I/O pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller, simply connects it to a computer with a USB cable or power it with a DC supply.

HC-SR04 Ultrasonic Sensor Module

ultrasonic-sensor
Ultrasonic Sensor

This is a sensor that can measure the distance of an object from the sensor position by ultrasonic sound waves. It sends ultrasonic waves of 40 KHz in the medium. If the waves are reflected on the object and bounce back to the sensor, it calculates the distance by calculating the travelling 111time and speed of sound.

Circuit Connection of Water Level Controller using Arduino

The circuit is the same as the diagram. You just need to fix the ultrasonic sensor module at the top of the tank. So that the module can measure the water surface and collect the data from the tank. When the water level is low about 30 cm, the Arduino turns on the pump and the LCD display shows “LOW WATER LEVEL” and the Led starts glowing.

When the space in the tank is about 12cm the pump will turn off and the LCD display shows “TANK IS FULL“. The buzzer starts beeping at this time and the LED turns off at this moment.

Working Principle of Water Tank Level Controller

The working of this circuit is very simple. We use an ultrasonic sensor that detects the reflection of sound waves from the water surface. At first, we trigger the ultrasonic sensor to transmit the signal and then wait for the ECHO. Arduino calculates the time between triggering and receiving ECHO. We know sound travels with a 340 m/s speed in the air. So we use,

Distance = (Travel time / 2) × Speed of Sound

Now we have the distance between the sensor and the water level in the tank. Now we need to calculate the length of the water tank. Then subtract the resulting distance. Now we have the water level. The Arduino converts it into a percentage. The LCD Display shows the percentage of water present in the tank every moment.

By this process, we can control the water level. The second part is when the water level is low and the relay activates the pump and the pump starts to fill up the tank. When the tank water level gets high the pump turns off automatically.

Arduino Code

14 thoughts on “Water Tank Level Controller Using Arduino”

  1. A couple of thoughts, not a criticism, just something that might help:-

    Considering that it’s in a ‘moist’ environment (which might promote corrosion -especially between dissimilar metals ) How durable is the water level sensor ?

    If the capacity of the tank and the flow rate of the water supply ( via the pump ) are known, several things are possible : the filling process could be monitored – i.e. the height of the water should rise with time when the pump is active – if it doesn’t this could flag an error. Also the tank should be full after a finite period – again if not flag an error. Summary : beyond delivering the desired functionality, consider what might happen in the real world – things occasionally go wrong or operate outside the design parameters – therefore can unexpected ( but plausible ) events be detected and then can the system respond appropriately ?

Leave a Comment