Introduction: Automatic Water Level Controller

Hi all , are you looking to control your tank water level automatically here's the post for you, how can water level be controlled automatically?

There are many ways by using a float sensor to determine the water level, or using probes to detect peak and low level in the tank.

How to measure water level without using probe or contacting with water?

yeah there is a way just using a Ultrasonic sensor, this is very simple where the level of water is measured using ultrasonic sensor which gives the depth , by determining the tank depth we can set the maximum and minimum level

Step 1: Circuit Diagram

This water level controller uses only two components apart from arduino

1. HC-SR04 Ultrasonic sensor

2. relay board

Step 2: Working Model

Note : give the distance according to your specification, I've used a small bucket where 25 is the minimum level to turn ON the motor and if the water level reaches a distance of 10cm or lesser than that the motor automatically stops.

Step 3: Arduino Program

/*

HC-SR04 Ping distance sensor:

VCC to arduino 5v

GND to arduino GND

Echo to Arduino pin 9

Trig to Arduino pin 8*/

#define echopin 9 // echo pin

#define trigpin 8 // Trigger pin

int maximumRange = 50;

long duration, distance;

void setup() {

Serial.begin (9600);

pinMode (trigpin, OUTPUT);

pinMode (echopin, INPUT );

pinMode (4, OUTPUT);

pinMode (13,OUTPUT);

}

void loop ()

{

{

digitalWrite(trigpin,LOW);

delayMicroseconds(2);

digitalWrite(trigpin,HIGH);

delayMicroseconds(10);

duration=pulseIn (echopin,HIGH);

distance= duration/58.2;

delay (50);

Serial.println(distance);

}

if (distance >= 25 ){

digitalWrite (4,HIGH);

digitalWrite (13,HIGH);

}

else if (distance <=10) {

digitalWrite (4,LOW);

digitalWrite (13,LOW);

}

}

If you want the same project using labview and arduino check this out here: http://www.labviewarduino.in/

Comments

author
Mohanapriya nagarajan made it! (author)2017-03-29

i need a circuit diagram for this project

pls post the circuit diagram

author
Kaushik Ravi made it! (author)2017-03-25

I am a beginner .. so can u just tell me how to connect arduino to relay to motor

author
shubh23a made it! (author)2016-12-31

sir i have confusion which relay i use for arduino 328

author
GautamJ6 made it! (author)2016-05-05

how to attach motor to relay

please reply

author
downlz made it! (author)downlz2016-12-27

Get a relay module of either 5V or 12V based on power supply of arduino.Feed in the power and use the digitalwrite method to set any pin high like pin 13.This pin should be connected with the relay.

And don't use this method.The sensor can't withhold the moisture and humid condition of the tank and will stop working soon.I had tried this and it failed in 2 days because of the sensor.Use magnetic float sensor instead

author
GautamJ6 made it! (author)2016-05-05

Hiw much volt is the motor

author
ganeshsp made it! (author)2016-02-02

Hi, before starting the motor, I need to check the water level at the ground level tank also to prevent dry run. In which case, I need to put another ultrasonic sensor for the ground tank. Can you pls include a step to accommodate one more sensor, so when the water level goes down in the overhead tank, the system checks for the water level in the sump before starting the motor? Thanks.

author
rashmi around the world made it! (author)2015-11-08

will this program work if i use probes instead of ultrasonic sensor

author
rashmi around the world made it! (author)2015-11-08

can u please post circuit diagram of this project

author
ruchika000 made it! (author)2015-10-15

hey, please can u explain more about the setup

author
ganeshsp made it! (author)2015-03-16

Hi, Could you please include a step to show the current water level with the 16x2 lcd screen?

author
Magesh Jayakumar made it! (author)Magesh Jayakumar2015-05-06
author
MuhammadA17 made it! (author)2014-12-06

could you please include the labview file and motor details?

author
Magesh Jayakumar made it! (author)Magesh Jayakumar2014-12-06

This instructable I've made for only arduino, it'd be inappropriate if I add labview file to this, I'll post a labview tutuorial soon

author
peppypickle made it! (author)2014-12-05

thank you for sharing this Instructable! very clever project!

About This Instructable

35,233views

42favorites

License:

Bio: I make hobbyist stuffs and play with electronics follow me to know more https://www.facebook.com/arduinolabviewsolidworks https://twitter.com/learnrobotix
More by Magesh Jayakumar:Quick Start to Nodemcu (ESP8266) on Arduino IDECourse on MIT App Inventor and ArduinoHat for the Party
Add instructable to: