Simple Water Level Controller Circuit with Microcontroller and Alarm

Nowadays many houses store water in underground tanks and pump the water to the overhead tanks. At times, the water overflows from the overhead tank leading to wastage of water. To overcome this problem, a water-level indicator with an alarm system is the best option as it controls the water level to an extent that will allow reduction in wastage of water. A Water level controller using microcontroller is a low-cost controller that is capable of managing water levels in different systems like water tanks, boilers and swimming pools, etc. Water level controller  can be used in houses, industries, factories, power plants, chemical plants and other liquid storage systems to save power and money.

Water Level Controller
Water Level Controller

Water Level Controller Circuit

A water-level-controller circuit monitors the level of the overhead tank and spontaneously switches on the water pump whenever the level goes below a specific limit. The level of the overhead tank is indicated using 5 LEDs, and the pump is switched off when the overhead tank gets completely filled up. The water level controller circuit does not allow the pump to start if the water level inside the sump goes low, and switches off the pump even during the pumping period if the water level inside the sump sinks low while the process of pumping the water towards the overhead tank continues.


Water Level Controller Circuit
Water Level Controller Circuit

The above mentioned circuit consists of four probes arranged in an overhead tank and are interfaced with port 2 of the microcontroller. The probes are arranged in such a way that they sense ¼th, 1/2, ¾th and even full levels as they are placed with equal spacing one above the other with the bottom positive probe. A positive voltage supply is placed at the bottom of the overhead tank, and a full-level probe is placed in the tank and the other end is connected to the base of the transistor Q4 through a resistor R16.

Whenever the water level rises to the maximum, then current flows through the base of the transistor and the collector voltage becomes low and is interfaced with the port p2.4. The programming is done in the microcontroller and sends the data to the microcontroller and LED. D1 indicates the level of water and the motor switches off automatically whenever the water level goes below the full-level probe, and then the base of the transistor Q2 opens by switching it off; the collector voltage of Q2 is high at P2.4, which means the tank is not full and the same process is applied to the remaining sensing probes ¼, 1/2, 3/4 as they are connected to the base of the transistors q1,q2,q3 and interfaced with the ports p2.5, p2.6, and p2.7 while programming is done within the microcontroller. The LED D3, D4 and D5 glow as an indication of the levels (¼, 1/2 and empty), and then the transistor gets on and the motor will be on.

The ports P0.0, P0.1, P0.2, P0.3 and P0.4 are interfaced with the LEDs for the purpose of indicating the levels and are connected to the resistors. The port P0.5 is used to control the pump and the transistor Q6 remains on as the relay also gets activated while the port P0.7 is connected to the LED D7 as an indication of low level in the sump and the LED glows.

It is also possible to add alarm system to the above circuit which is capable of alerting inmates of a home whenever water levels are high or low or exceeds higher limits. This type of water-level indicator circuit is shown below.

PCBWay

Water Level Indicator with an Alarm

Water Level Indicator Circuit with Alarm
Water Level Indicator Circuit with Alarm

This circuit is similar to the above discussed circuit except for the alarm speaker used in it. As we have seen above, for a particular level, the sensing probes enable appropriate pins of the microcontroller. When these pins are logic high, the microcontroller sends control signals to the speaker as well as to the LED indicators depending on the program.

The tone system attached to the alarm system gives level information as ‘tank is full’ and ‘tank is empty’ so that a user can easily recognize the level of the water. As the above discussed level control is of contact type wherein the probes are in contact with liquid or water, so there is a chance of it becoming corrosive easily. This can be overcome by using a contactless sensor level measuring system which is described below.

Contactless Liquid Level Controller

Contactless Liquid Level Controller
Contactless Liquid Level Controller Kit

This contactless liquid level controller uses an ultrasonic sensor to sense the level of the liquid in a tank. This type of level-control system is useful where the liquids are of chemical in nature and it is not practical and possible to use contact-type level sensors.

In such contactless liquid level controllers, the mains’ available power supply is rectified, filtered and regulated to a circuit operating range and is given to the microcontroller and other circuit components. The ultrasonic sensor is also powered by this regulated DC supply.

Contactless Liquid Level Controller Circuit
Contactless Liquid Level Controller Block Diagram

The Ultrasonic sensor attached to a liquid tank continuously monitors the set level limit and whenever this limit exceeds, the sensor gives input to the microcontroller. Based on the program, the microcontroller sends control signals to the transistor, which is responsible for switching the relay so that the pump or motor gets turned on or off.

Whenever the level distance, which is measured by centimeters falls below a set point limit, the pump starts sensing the ultrasonic module signal coming out from the Transmitter sensor which gets reflected from the level and is received by the ultrasonic Receiver sensor, and then the output is fed to the microcontroller.

This level limit can be varied based on the user requirement by arranging ultrasonic sensor in appropriate place. This level information is also displayed on a LCD display so that a user can easily know the level in tank.

This is all about the water tank level controller using microcontroller with contact and contactless sensors. We hope that you have got a better understanding with the given circuits and its brief explanation.

Photo Credits

4 Comments

  1. ashlee makaya says:

    why are we taking power of the sensor from the rectifier and not the regulator

  2. How to interface ultrasonic sensors with 8051 and how to controll motor ,pls help.

  3. Oyebamiji Kamil A. says:

    what is the distance range of this ultrasonic sensor?
    can the design can be set up in an underground tank or well to monitor the level there should in case water level goes down beyond pumping machine.

    1. Tarun Agarwal says:

      Hi Oyebamiji Kamil ,

      Please follow the link: for your exact requirement. Please check the website https://www.elprocus.com for complete details in the kit content section and go through the FAQ for details.

Add Comment