Thursday, February 27, 2025

Automatic Water Level Indicator and Controller

Electronics For You Tested DIY Project

Water storage often presents challenges such as monitoring tank levels, preventing overflow, and reducing manual intervention to operate the pump. Two types of devices, known as water level indicators and controllers, have been developed to address these issues.

These devices have key drawbacks. Water level indicators require manual pump operation and often waste power as multiple LEDs stay unnecessarily lit. Water level controllers face frequent pump cycling from minor fluctuations, accelerating the pump’s wear and tear and shortening its lifespan.

Also, Check the Water Pump Controller project that we built previously.

- Advertisement -

An automatic water level indicator cum controller device can address these problems. To build this device, the components listed in Table 1 are required. Fig. 1 shows the author’s prototype.

Automatic Water Level Indicator and Controller
Fig 1: Author’s prototype of Automatic Water Level Indicator and Controller
Table 1: List of components
ItemQuantity
Arduino Uno (MOD1)1
Water level sensors or float switch3
5V SPDT relay (RL1)1
BC547 NPN transistor (T1)1
1N4007 rectifier diode (D1)1
330Ω resistor (R1, R2, R3)3
10kΩ resistor (R4, R5, R6)3
1kΩ resistor (R7)1
Water pump1
5mm LED3
Power supply for Arduino Uno5V
Power supply for water pump motor230V AC

Arduino Code for Water Level Indicator and Controller

The code is written in Arduino IDE. First, the IDE must be installed. The code can then be downloaded and opened in Arduino IDE.

- Advertisement -

In the initial part of the code, sensor wires, LEDs, and the relay pin are defined. In the setup function, the pin modes are configured as input for the sensor wires and output for the LEDs and relay.

In the loop function, the levels are detected using the read function. Based on the detected level, the relay turns on or off, controlling the motor connected to it.

The board and port for the Arduino Uno should be selected. The Arduino Uno should then be plugged in, and the source code uploaded. Fig. 2 shows a snippet of the source code.

Code for Water Level Indicator and Controller Project
Fig. 2: Snippet of source code

Circuit

Fig. 3 shows the circuit diagram of the automatic water level indicator cum controller. It is built around an Arduino Uno board (MOD1), three LEDs, a 5V SPDT relay, and other components.

First, all sensors should be installed in the upper tank, and the pump motor should be installed in the lower tank.

The circuit can use either wires as sensors or float switches.

Fig. 3: Circuit diagram

Working

Filling Mode

During water filling, the three wire sensors are positioned at different heights in the tank. The pump motor starts automatically when water is below the lowest sensor.

When water touches the lowest sensor, LED1 lights up, but the pump remains on. When water touches the middle sensor, LED1 turns off, LED2 lights up, and the pump remains on.

When water touches the highest sensor, LED3 lights up, LEDs 1 and 2 turn off, and the pump switches off.

Table 2: Filling mode
Sensor PositionConditionLED1LED2LED3PUMP
Water touches no sensors (below lowest sensor)Tank is emptyOFFOFFOFFON
Water touches the lowest sensorTank is not emptyONOFFOFFON
Water touches the middle sensorTank is partially filledOFFONOFFON
Water touches the highest sensorTank is fullOFFOFFONOFF

Draining Mode

During water drainage, when the water level drops below the highest sensor, LED3 turns off, and LED2 lights up, but the pump remains off.

When the water level reaches below the middle sensor, LED2 turns off, and LED1 lights up, but the pump remains off.

When the water is below the lowest sensor, all LEDs turn off, and the pump starts.

Table 3: Draining mode
Sensor PositionConditionLED1LED2LED3PUMP
Water level is at the highest sensorTank is fullOFFOFFONOFF
Water level is below the highest sensorTank is partially filledOFFONOFFOFF
Water level is below the middle sensorTank is not emptyONOFFOFFOFF
Water level is below the lowest sensorTank is emptyOFFOFFOFFON

Testing

The source code must first be uploaded into the Arduino Uno. The components should then be connected as per the circuit diagram shown in Fig. 3. The Arduino Uno board should be powered using a 5V adaptor or a USB cable connected to a laptop or desktop.

The water pump should be connected to a 230V AC power supply through the relay contacts. After powering the device and installing the sensors in the tank, water should be filled into the tank. The LEDs will glow according to the water level, and the pump will switch on or off as described in Tables 2 and 3.

Check other Arduino Projects


Rakesh Jain, Assistant Professor in the ECE Department at Geetanjali Institute of Technical Studies, Udaipur, holds a master’s degree in VLSI, a BE degree in electronics and communication and a diploma in electronics. His research areas are sensors and microcontrollers, and he has 31 copyrights, 9 design patent registrations, and 3 Indian utility patents to his credit. He is the recipient of the Mewar Scientist Award 2023.

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Truly Innovative Electronics

Electronics News

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics

×