Computerized Water Tank Filling System

Right here we have now designed an Computerized Water Tank Filling System utilizing Arduino.
In India, many homes have two sources of water to fill the rooftop water tank. These are underground water storage tanks and municipal water provide. Primarily based on the supply, the rooftop tank is crammed both with municipal water or with the underground tank water with the assistance of an electrical water pump.
Filling the overhead tank by manually switching on the electrical water pump requires frequent monitoring of the water stage contained in the tanks. It additionally ends in the wastage of water when it overflows from the overhead tank. This mission goals to fill the overhead tank mechanically with none human intervention.
The proposed system determines the extent of water within the rooftop tank, checks the supply of adequate water within the underground tank or municipal provide, after which fills the overhead tank to the specified stage utilizing any of the 2 out there sources. The filling of the tank by municipal provide is managed by a solenoid valve and the water pump is managed by a contactor.
The choice making is finished by a microcontroller in Arduino Nano and digital units like BJT, MOSFETs, and diodes. The working of the mission might be defined by two instances that utilise completely different water sources primarily based on their availability.
Case 1. Water stage in overhead tank is under 75% and municipal provide will not be out there. On this case, water shall be crammed by the underground tank utilizing water pump until 75% water stage is reached.
Case 2. Water stage in overhead tank is under 100% and municipal provide is offered. On this case, water shall be crammed by the municipal provide to the tank’s full capability. A solenoid valve shall be used to cease filling the tank after the tank is totally crammed.

Fig. 1 reveals the essential design thought of mission whereas circuit diagram of the automated water system is proven in Fig. 2. The digital and mechanical elements required to make this mission are listed within the Invoice of Materials desk.
Computerized Water Tank Filling System Circuit Diagram
The circuit is constructed round Arduino Nano (MOD1), 16×2 LCD with I2C/IIC interface (MOD2), three BC548 transistors, two IRF530 MOSFETs, and a relay.

Working
The supply of municipal provide is detected by the 2 electrodes drilled into the pipe and linked to Arduino. The hole between the electrodes acts as a hindrance to the circulation of present (as resistance). When the municipal water is offered, the present begins flowing by the electrodes, which is detected by the microcontroller in Arduino.
The circulation of water from the municipal provide is managed by a solenoid valve and the water pump is used to fill the water from underground storage tank to rooftop tank. Two one-way valves are used to forestall reverse circulation of water. The 2 water provides are merged to a single outlet by a ‘T’ connector.
The water stage is decided by the three BC548 BJT transistors that act as switches. The bases of the BJTs are linked to the electrodes dipped into the tank at completely different ranges (50%, 75%, and 100%) by resistors. When the water stage reaches an electrode then the corresponding transistor activates and thus the LED linked to the transistor additionally activates. The collector pins of two transistors are additionally linked to the digital pins of the Arduino to additional outline the logic of the circuit.
Invoice of Materials | |
Parts | Amount |
Arduino Nano (MOD1) | 1 |
16×2 LCD show with I2C/IIC interface (MOD2) | 1 |
12V, 2A SMPS | 1 |
LM2596 DC-DC buck converter (manually set to 5V) | 1 |
Solenoid valve (L1) | 1 |
10A, 240V, 2-pole contactor | 1 |
IRF530 n-channel MOSFET (Q1, Q2) | 2 |
BC548 BJT (Q3, This autumn, Q5) | 3 |
1N5402 diode (D1, D2) | 2 |
10A10 diode (D3) | 1 |
Inexperienced, yellow, and crimson LED | 1 Every |
100-ohm resistor (R4, R5, R6) | 3 |
1.5k resistor (R8, R9) | 2 |
2.2k resistor (R1, R2, R3) | 3 |
10k resistor (R7, R10) | 2 |
1×3 JST connector for the water stage probe | 1 |
DC jack to attach solenoid valve | 1 |
220V 3-pin connector for water pump | 1 |
AC 220V, 10A 3-pin panel mount plug socket for 220V enter | 1 |
10A rated swap | 1 |
5V, one changeover relay | 2 |
MECHANICAL COMPONENTS | |
1HP family water pump | 1 |
PCV pipe (minimize to completely different sizes as per diagram) | 1 metre (min) |
One-way valve | 2 |
Elbow joint | 2 |
Feminine copper adaptor | 4 |
Metal hose nipple | Metal hose nipple |
The 16×2 LCD linked to the Arduino Nano by I2C shows the standing of water provide and water pump.
The solenoid valve is managed through a relay. The relay is managed by the IRF530 MOSFET. The gate pin of the MOSFET is linked to the digital pin D9 of Arduino Nano by a resistor. The resistor linked between the gate of the MOSFET and the bottom acts as a pull-down resistor. A flyback diode is linked in parallel to the coils of the relay to guard the MOSFET from excessive voltage created by collapsing magnetic fields.
The water pump might be immediately managed by the relay however attributable to excessive inrush present of the pump, the contacts of the relay can simply get broken. Therefore, a contactor just like a relay is used, but it surely operates on 220V AC and has an even bigger and heavier steel contacts that don’t harm simply. The contactor is managed by the identical relay-MOSFET system as defined above. The gate pin of the MOSFET is linked to digital pin D8 of Arduino Nano.
The Arduino Nano is powered with a 5V enter, which is achieved by a buck converter linked to the 12V provide. A 4700µF capacitor is linked to the 12V energy provide to behave as a low-pass filter.
Water Tank Filling System Code
Arduino Uno IDE is used right here. Within the Arduino code, the behaviour of the {hardware} elements is outlined primarily based on the methodology talked about earlier.


The variables GreenState, YellowState document the states of the transistors linked to inexperienced and yellow LEDs. For the reason that output is 180-degree part shifted, ‘HIGH’ corresponds to a transistor being off and ‘LOW’ corresponds to the transistor being on. Fig. 3, Fig. 4, and Fig. 5 present snapshots of the supply code.

The information from this variable is additional used to outline if-else logic to manage the solenoid and the water pump. The LCD used to show the state of the 2 water sources is managed utilizing I2C communication. The libraries, Wire.h and LiquidCrystal_I2C.h, are utilised for I2C communication with the LCD. After every loop, a delay of 2000ms is added within the execution of the code.
You possibly can obtain the whole code from electronicsforu.com. After getting the code prepared, add the code to Arduino by choosing the suitable port and board.
Building and Testing
You possibly can assemble the circuit on a small general-purpose PCB. However earlier than meeting don’t forget to add the supply code into Arduino Nano. The mission has two elements, the mechanical meeting, and {the electrical} circuit. The pipe mechanical meeting is proven in Fig. 6.

The mechanical a part of this mission might be constructed utilizing a 1.3cm (½-inch) dia PVC pipe and corresponding fittings. The next fittings could also be required:
- Elbow connector
- ‘T’ connector
- Feminine copper adaptor
- Metal hose nipple

Two steel nails are inserted into the PCV pipe to behave as electrodes to detect the supply of municipal provide, as talked about earlier.

The whole circuit is soldered on a perf board as per the circuit diagram proven in Fig. 2. Terminal blocks are utilised to attach the 12V DC energy, stage probe, electrode, and solenoid. The three LEDs are soldered on a separate perf board and mounted on the enclosure. Warmth-sinks are used for the MOSFETs to dissipate warmth generated throughout their operation.

The whole meeting is proven in Fig. 8, Fig. 9, and Fig. 10.

The circuit is enclosed inside a plastic enclosure with the lid used to mount the LCD and the LEDs. Together with the circuit board, the 12V, 3.3A SMPS and the contactor are additionally fitted contained in the enclosure.
On the perimeters of the enclosure, completely different connectors are mounted to attach the sensing components and units, as proven in Fig. 9. These connectors are:
- JST connectors to attach the water stage probe and the electrodes
- DC jack to attach the solenoid valve
- 220V, 3-pin connector to attach water pump
- AC 220V, 10A rated 3-pin panel-mount plug and socket for 220V enter
- A 10A rated swap

The mechanical meeting is mounted vertically on the overhead tank and thru a small gap the water stage probe is inserted within the tank. A 0.5HP water pump is linked to the mechanical meeting, which shall be managed by the circuit. Working and testing of the circuit is proven in Fig. 11 by Fig. 12.

Case 1: Water stage is under 75% and municipal provide will not be out there
- Water is crammed by the pump and the crimson LED is on.
- Water filling stops when 75% water stage has reached and now the yellow LED switches on.
Case 2: Water stage is under 100% and municipal provide is offered
- Water is crammed by the municipal provide and the yellow LED is on.
- Water filling stops (solenoid valve turns off) when the tank turns into full and the inexperienced LED
switches on.
Enhancements Potential
The mission is not at all good and might be improved as per necessities. As an illustration, the water stage probe might be additional enhanced by including a grid of steel contacts to exactly measure the water stage.
Water remaining within the municipal provide traces, even when the availability will not be out there, generally provides false information concerning the availability of the availability. It may be improved by
enhancing the mechanical design or by utilizing a strain sensor as a substitute of a steel electrode.
Obtain Supply code
Naman Tanwar is an IoT and electronics fanatic who’s pursuing his engineering from the Faculty of Electronics Engineering, Vellore Institute of Know-how in Tamil Nadu