Introduction: Automatic Water Level Controller

About: I make hobbyist stuffs and play with electronics follow me to know more https://www.facebook.com/arduinolabviewsolidworks https://twitter.com/learnrobotix

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/

Formlabs Contest

Participated in the
Formlabs Contest