Posted by Circuits Arena on Friday, 2 January 2015
Water Tank Pump Switcher Microcontroller Circuit is the artlcle explaining Water Tank Pump Switcher Circuit : This projects helps for rural area pump sets for automatic switching ON and OFF . For the residen...
Water Tank Pump Switcher Circuit :
This projects helps for rural area pump sets for automatic switching
ON and
OFF. For the residents who live in rural-areas, limited water-availability is
a very common problem. Therefore, many people install a water tank on
the roof of the building.
- The water, stored in a water tank at the basement (ground) is pumped
into the water tank on the roof using a pumping motor. In this manner,
the limited water-availability problem can be improved and the water can
be used in a more efficient way if an automatic water tank pump
controller is included in the setup.
- Traditional water level controller can control the water between two
levels with the help of floating balls/float switch as the sensors for
level detection. According to the positions of the floating balls/float
switch, the electric connection of the pumping motor is set to be on or
off.
- However, the controller unit is usually placed at the top of water tank,
humidity may corrode the contact points of the sensor switch. This will
cause the sensor switch to mal-function. Meanwhile, since there are no
means to detect the water level of the basement water tank, it is
possible that the pumping motor will be burned if there is very low/zero
water level in the basement water tank.
- Since the traditional water level controller has inherent problems, many
people prefer digital electronics to detect and control the water level
in an intelligent manner. Here is a simple yet effective water tank
pump switcher circuit, realized using the renowned AVR microcontroller
Atmega328P-PU. The circuit can be used to maintain the level of water
in the overhead water tank within prescribed limits.
Micro Controller:
- Microcontroller Unit: The designed circuit shown here
includes an Atmega328P-PU as the kernel, a number of LEDs to display the
system status, a push button switch for auto/manual mode selection,an
electromagnetic relay as the driver of the pumping motor, and a few
other external components.
- The basic design idea is to set two ports of the MCU for water level
detection, one port for automatic/manual mode switch selection, and two
ports for visual status indication. From the reading of the water level
detection ports, the internal software can determine the water level of
the overhead water tank. Note that E2PROM storage option of the microcontroller is also used here.
- Water Level Sensors: The roof (overhead) water tank
level sensor is nothing but a (readymade/homemade) reed-switch actuated
vertical-mount (2-point level) float switch consists of low and high
water level sensors, placed at two different heights in the overhead
water tank.
- The basement water tank level sensor is another simple (1-point level)
float switch, added as a dry-run protector. Hermetically sealed-in-glass
reed switches located inside the stem are activated/deactivated by the
upward/downward movement of the strong magnet in the tailpiece of the
float.
- Power Supply Unit: The circuit will work with dc supply
voltages in the 9 – 12Vrange, and hence any standard 1Ampere-rated dc
power adapaters with an output voltage in the range can be used to
energize the entire system.
- An on-board linear voltage regulator is included in the system to provide a clean dc supply to the whole electronics circuitry.
System Working:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfXc53hUioYGUBf-id2MZgh7ZBGPgoL2jAUV6N5tuPHfU8oXjBcvGpQT5cDLO87EeHrMJoaSuBVsaw1vb077vPYLEAC-3g4tzw4hGRrS4OxkIh_HRO9b9wCSAaJfQX_pRIwBLymtYSLJPq/s1600/water+head+tank.jpg1.jpg)
- The water level of the overhead water tank there are two sensors, one
for low level (L) and the other for high (H) level. Try to use a
magnetic float switch that activates two reed sensors so that the float
(with magnet) should terminate its travel in front of L and H reed
sensors. If the L sensor triggers its microcontroller input, the water
pump is activated.
- Now the STANDBY indicator LED goes off, and PUMP ON on indicator LED
lights up. When H level is reached, ie the H sensor triggers
its microcontroller input, water pump is deactivated. Now the
PUMP ON indicator goes off, and the STANDBY indicator lights up
again. Water pump is reactivated only when water drops back to L level.
- In automatic mode, if the (optional) third sensor (dry run sensor) is
fitted in the basement water tank, the sensor (G) triggers its
microcontroller input to inform the system that there is no water in the
basement water tank.
- The system also features an Auto/Manual operation. In AUTO
mode, the water pump stops then maximum water level (H) is reached.
In MANUAL mode, water level detection process is overridden and the
water pump keeps working endlessly. Simultaneously, MANUAL mode
indicator LED lights up as a warning indicator.
Circuit Working:
The Atmega328P-PU (IC1) chip in this circuit is infact an Arduino UNO
chip, that is to say IC1 holds a small code prepared & processed
using Arduino IDE. Switch S1 is the traditional reset switch as found in
the Arduino board. Here, ports PD2, PD4 and PD7 of IC1 (D2, D4, D7 of
Arduino) are configured as input ports,and ports PB0, PB4 and PB5 (D8,
D12, D13 of Arduino) are configured as output ports. PD2 port is
connected to the AUTO/MAN mode selector switch.
- Water level sensors are read by ports PD4 and PD5. Port PB5 is used to
conttrol the water pump motor through a heavy-duty electromagnetic relay
(RL1) with the help of the driver transistor (T1). Rest of the output
ports (PB0 & PB5) are used to drive the system status indicators
(LED1 & LED2).
- IC1 can be
programmed/re-programmed through the serial interface socket J3 using a
commonly available FTDI Basic board (usb-serial converter board). Water
level sensors of the water tank at roof, and water level sensor of the
water tank at basement (ground) can be connected to the circuit through
sockets J1 and J2 respectively.
- Socket J4 is the DC input socket, from where the system is powered by a
regulated 5VDC supply, pre-processed by the on-board voltage regulator
chip (IC2). LED4 works as the power supply status (on/off) indicator.
Software Description:
- /*
- *Smart Water Tank Pump Switcher
- *An Arduino-Based Project
- *Designed by T.K.Hareendran
- *Tested @ TechNode PROTOLABZ
- *IDE: Arduino 0022 / Board:Arduino UNO-R3 / Chip: ATmega328P-PU
- *Date: November 14,2014
- *Source: http://www.electroschematics.com
- */
-
- #include <EEPROM.h>
-
- #define inputLevel1 4 //Tank Level-Low
-
- #define inputLevel2 7 //Tank Level-High
- #define modeSwitch 2 //Auto/Manual Mode Switch
- // OUTPUT PINS
-
- #define statLED 8 //System Status Indicator
-
- #define modeLED 12 //Auto/Manual Mode Indicator
- #define driveOutput 13 //Water Pump Swicth Output
- #define memposL1 0 //Set constant eeprom position 0 to save Level1
-
- int state=0;
- int level = 0;
- int lastlevel = 0;
-
- void setup (){
- pinMode(modeSwitch,INPUT);
- pinMode(inputLevel1,INPUT);
- pinMode(inputLevel2,INPUT);
-
- digitalWrite(modeSwitch, HIGH);
- digitalWrite(inputLevel1, HIGH);
-
- digitalWrite(inputLevel2, HIGH);
-
-
- pinMode(driveOutput, OUTPUT);
- pinMode(statLED, OUTPUT);
- pinMode(modeLED, OUTPUT);
-
- level = EEPROM.read(memposL1);
- lastlevel = level;
- if ((level == 0)||(level>2)) {
- level=1;
- refreshmem();
- }
- visualdrive();
- delay(1000);
- pumpdrive();
- }
-
- void visualdrive() {
-
- digitalWrite(statLED, LOW );
-
- if (level >1) digitalWrite(statLED, HIGH );
-
- }
-
- void pumpdrive(){
- if (level < 2) digitalWrite(driveOutput, HIGH );
- if ((level == 2) & (state == 0)) {
- digitalWrite(driveOutput, LOW );
- }
- else {
- digitalWrite(driveOutput, HIGH );
- }
- }
-
- void refreshmem() {
-
- lastlevel = level;
- EEPROM.write(memposL1, level);
- }
-
- void loop () {
- if ( (digitalRead(modeSwitch) == LOW) & (state == 0) ) {
- state=1;
- digitalWrite(modeLED, state );
- pumpdrive();
- delay(400);
- }
-
- if ( (digitalRead(modeSwitch) == LOW) & (state == 1) ) {
- state=0;
- digitalWrite(modeLED, state );
- pumpdrive();
- delay(400);
- }
-
-
- if ( digitalRead(inputLevel1) == LOW ) {
- level = 1;
- }
-
- if ( digitalRead(inputLevel2) == LOW ) {
- level = 2;
- }
-
- if (level != lastlevel) {
- visualdrive();
- pumpdrive();
- refreshmem();
- }
-
- }