Introduction: Automatic Water Level Controller Without Ultrasonic Sensor
I'm gonna show you how to make an Automatic Water Level Controller.
Which will cost you less than 4$.
This circuit will detect the water level, and once it reaches the low level it enables the motor pump, and when the water reaches the higher level the motor pump stops.
Step 1: Materials Required
- Arduino Board
- Led Indicator
- Relay (If required)
- jumper wires
- glass mug
Step 2: Set-up
you'll have to connect the Jumper wires to the board.
In this article the white wire is connected to the pin 4 on the arduino, green wire to the pin 3 and brown wire to the Vin.
Connect the LED to the Arduino, in our case it is connected to the pin 13 of the arduino.
Now plug the USB cable to upload the program.
Step 3: Programming Your Arduino
I'm using the most simplest code.
and here's the code :
int h = 4; //high indication
int l = 3; //low indication
int up = 0;//up value
int down = 0; //down value
int blin = 13;
void setup() {
pinMode(h, INPUT);
pinMode(l, INPUT);
pinMode(blin, OUTPUT);
}
void loop() {
up = digitalRead(h); //initialization
down = digitalRead(l);
if(down == LOW && up == LOW){
digitalWrite(blin, HIGH);
}
else if(down == LOW){
digitalWrite(blin, LOW);
}
else if(up == HIGH && down == HIGH){
digitalWrite(blin, LOW);
}
}
Step 4: Arranging the Sensors
Upload the program to the Board.
The brown wire is what carries a supply of 5V.
It should always be in the least position.
Now the green wire should be in the low level portion and white wire should be in the high level position.
The green wire and the white wire's terminal in the mug acts as the sensors.
And hence it should work according to our code.
Step 5: Output
Enable the Arduino with a 5V supply.
After arranging the wire terminals in the Mug.
Pour some water into it.
The LED will glow untill the water reaches the higher wire terminal, when the water reaches the higher level it turns off.
The LED will again turn on when the water is removed from the mug, only if the water reaches below the green wire terminal.
Please watch the video for better explanation.
And that's how it works.
Step 6: Extra
In case you want to integrate with the Water Pump.
You have to add an Electrical Relay.
And for the circuit diagram refer to the Picture.