Automatic Water Level Monitoring And Controlling System using Arduino (IoT)

LCD Display - GeoITHub

 Automatic water level monitoring and controlling system

Automatic water level monitoring system project explained here is going to measure the water level of a water tank using ultrasonic sensor. The project will automate the water filling in a tank i.e when the water level reaches up to the brim of the tank, the water pump will stop automatically and when the water level in the tank remains up  to few centimetres, the pump will start automatically to fill up the tank till the water reaches again up to the brim. We can implement the project in following steps:

A. Hardware required:

1. Arduino UNO Board: This is a microcontroller board required for coding and it has input/output pins for connecting other required accessories.

Adruino Board - GeoITHub

2. Ultrasonic Sensor HC-SR04: This is a sound based sensor for measuring the water level in a tank.

ultrasonic Sensor -GeoITHub

3. LCD Display 16 x 2: This is required to display the values and other information for user.

LCD Display - GeoITHub

4. Relay 6Volts: Relay 6V acts as an electromagnetic switch, it is the voltage that controls the voltage action.

Relay 6v - GeoITHub

5. Relay Driver ULN2003: ULN3000 provides a high current which a Arduino board cannot provide so it is used to drive the relay.

Relay Driver - GeoITHub6. IC 7806(Voltage regulator): It is a voltage regulator that maintains the constant voltage across the circuit to which it is connected. It provides +6V regulated power supply.

Voltage Regulator - GeoITHub7. Buzzer: It will alarm when the tank goes empty or when the tank is filled completely by the water.

Buzzer - GeoITHub

8. 12 Volt battery/12 Volt adaptor: It will provide 12V DC supply to the Arduino and other components.

9. Copper wire and connecting wires: Copper wire will be required to connect water pump to 220V AC supply and connecting wires will be required to connect the above components with Arduino.

B. Connect the above components using the below circuit diagram:

Circuit Diagram - GeoITHub

C. Explanation of circuit diagram:

A 16×2 LCD is connected with Arduino in 4-bit mode. Control pin RS, RW and E are directly connected to Arduino

pin 7, GND and 6. Ultrasonic sensor module’s “trigger” and “echo” pins are directly connected to pin 10 and 11 of Arduino. A voltage regulator 7806 is also used for providing 6 Volt to relay and to remaining circuit. 6 Volt relay is also connected at pin 8 of Arduino through ULN2003 for turning on or turning off the water motor pump.

The ultrasonic sensor must be placed at the top of the tank facing the transmitter and receiver to the bottom of the tank. The ultrasonic sensor will read the distance from the bottom of the tank to the sensor module using ultrasonic wave by using the formula (distance = speed x time), the LCD in the meantime will display “Empty space in tank is ‘MEASURED_VALUE’ CM”. If the distance between the sensor module and water in the tank is 60CM or above, the relay driver will drive the relay thus turning ON the pump to fill the tank. When the distance between the sensor module and the water in the tank is 12cms, the buzzer will buzz and the pump will turn off automatically.

D. Programming the Arduino:

  1. First, we will define all the pins that are attached with the components like buzzer, LCD etc.

#define trigger 10

#define echo 11

#define motor 8

#define buzzer 12

  2. Initialise all the device connected in the circuit:

lcd.begin(16,2);

pinMode(trigger,OUTPUT);

pinMode(echo,INPUT);

pinMode(motor, OUTPUT);

pinMode(buzzer, OUTPUT);

lcd.print(”  Water Level “);

lcd.setCursor(0,1);

lcd.print(”   Indicator  “);

delay(2000);

  3. Initialise Ultrasonic sensor module and read time for sending and receiving waves the perform the calculation for measuring the distance using formula Distance= Speed X Time.

digitalWrite(trigger,HIGH);

delayMicroseconds(10);

digitalWrite(trigger,LOW);

delayMicroseconds(2);

time=pulseIn(echo,HIGH);

distance=time*340/20000;

lcd.clear();

                                        lcd.print(“Empty space in  “);

lcd.setCursor(0,1);

lcd.print(“tank is: “);

lcd.print(distance);

lcd.print(“Cm”);

delay(2000);

  4. Check the conditions and make it perform the actions accordingly:

if(distance<12 && temp==0)

{

digitalWrite(motor, LOW);

digitalWrite(buzzer, HIGH);

lcd.clear();

lcd.print(“Water Tank Full “);

lcd.setCursor(0,1);

lcd.print(“Motor Turned OFF”);

delay(2000);

digitalWrite(buzzer, LOW);

delay(3000);

temp=1;

}

else if(distance<12 && temp==1)

{

digitalWrite(motor, LOW);

lcd.clear();

lcd.print(“Water Tank Full “);

lcd.setCursor(0,1);

lcd.print(“Motor Turned OFF”);

delay(5000);

}

else if(distance>60)

{

digitalWrite(motor, HIGH);

lcd.clear();

lcd.print(“Low Water Level”);

lcd.setCursor(0,1);

lcd.print(“Motor Turned ON”);

delay(5000);

temp=0;

}

}

  5. Complete code for this project is cited below:

#include <LiquidCrystal.h>

#define trigger 10

#define echo 11

#define motor 8

#define buzzer 12

LiquidCrystal lcd(7,6,5,4,3,2);

float time=0,distance=0;

int temp=0;

void setup()

{

lcd.begin(16,2);

pinMode(trigger,OUTPUT);

pinMode(echo,INPUT);

pinMode(motor, OUTPUT);

pinMode(buzzer, OUTPUT);

lcd.print(”  Water Level “);

lcd.setCursor(0,1);

lcd.print(”   Indicator  “);

delay(2000);

}

 

void loop()

{

lcd.clear();

digitalWrite(trigger,LOW);

delayMicroseconds(2);

digitalWrite(trigger,HIGH);

delayMicroseconds(10);

digitalWrite(trigger,LOW);

delayMicroseconds(2);

time=pulseIn(echo,HIGH);

distance=time*340/20000;

lcd.clear();

lcd.print(“Empty space in”);

lcd.setCursor(0,1);

lcd.print(“tank is: “);

lcd.print(distance);

lcd.print(“CM”);

delay(2000);

if(distance<12 && temp==0)

{

digitalWrite(motor, LOW);

digitalWrite(buzzer, HIGH);

lcd.clear();

lcd.print(“Water Tank Full “);

lcd.setCursor(0,1);

lcd.print(“Motor Turned OFF”);

delay(2000);

digitalWrite(buzzer, LOW);

delay(3000);

temp=1;

}

else if(distance<12 && temp==1)

{

digitalWrite(motor, LOW);

lcd.clear();

lcd.print(“Water Tank Full “);

lcd.setCursor(0,1);

lcd.print(“Motor Turned OFF”);

delay(5000);

}

else if(distance>60)

{

digitalWrite(motor, HIGH);

lcd.clear();

lcd.print(“LOW Water Level”);

lcd.setCursor(0,1);

lcd.print(“Motor Turned ON”);

delay(5000);

temp=0;

}

}

E. Possible Applications:

  1. It will automate the water levelling and controlling.
  2. It can be used in homes
  3. It can also be used in industries, hotels, offices.
  4. It will greatly avoid water usage.

F. Conclusion:

 Water is one of the necessities of life. Every government in every country is emphasizing on avoiding water wastage. It will greatly reduce the water wastages if it will be implemented in especially govt offices and departments, private industries, hotels and even in homes. SAVE WATER, SAVE LIFE.

Image Source: Arduino.org

Image Source: robotistan.com

Image Source: miketrask.com

Image Source: aliexpress.com

Image Source: engineersgalllery.com

Image Source: modmypi.com

Image Source: circuitdigest.com

Related Posts

About The Author

Leave a Reply

Be the First to Comment!

Notify of

wpDiscuz
GKC 2.1 Entry has been Closed.
Sign Up
Fields with (*) are required
Account Info
Password must be at least 7 characters long. To make it stronger, use upper and lower case letters, numbers and symbols.
Type your password again.
 
Profile Info
 
 
Prove you're not a robot