Thursday, December 4, 2014

AUTOMATIC WATER LEVEL CONTROLLER USING ARDUINO

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 




circuit diagram shown in the above fritzing, where it uses only two components, one is HC-SR 04 ultrasonic sensor and relay controller, relay controller is connected to the motor. 

Components required

Arduino
HC-SR 04
Relay

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);
 }
}
  
-----------------------------------------------------------------------------------------------------------------------------


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.



If you want to add an LCD to this device to indicate water level check this link here
    

Related Posts:

  • Course on MATLAB Simulink and Arduino. Have you ever thought of programming arduino from a powerful tool like Matlab Simulink, do you know why Simulink so powerful, many big industries and corporates are using Matlab Simulink for testing and implementing their p… Read More
  • Esp8266 Control Electrical Devices From your browser. WiFi web server: This program connected to the wifi home server that is specified by the user, Once it connected to the homeserver, you can check the IP address assigned to the esp8266 by logging into your WIFI modem and che… Read More
  • Course on Interfacing Arduino and LabVIEW Its been a long time I have made a video course on How to use arduino with LabVIEW , This video tutorial is more sufficient for anyone to get started with arduino and LabVIEW and start building their own projects using Ardu… Read More
  • Course On Arduino and Android I have made many tutorials for creating apps using MIT app inventor and connected the app with arduino to make things work, I often get email stating something went missing when they follow my tutorial, Here's a step by ste… Read More
  • Blink an LED using Arduino and Matlab Simulink If you are looking to make your arduino talk wiith Matlab, usually this is done by serial communication between Matlab and arduino, where we separately write program for Matlab and arduino, we pass data from and process in … Read More

16 comments :

  1. can you please tell me What is the power supply voltage for this project ?? 9v or 5 v?

    ReplyDelete
  2. Really nice, keep up the good work.....Ebonygeek45

    ReplyDelete
  3. Hi, Can you pls advise the supplier for the Labview Ardiuno. Also pls provide your contact details.
    Thanks/Paul
    Cell:9312687277
    er.anup.p@gmail.com

    ReplyDelete
  4. Hi! i am doing a similar project but stuck at coding part...could you help me. Thanks in advance

    ReplyDelete
  5. im unable to connect the relay could please help me connecting the relay to the circuit and that to the pump. mail: g6.pola@gmail.com
    kind of Relay used www.sparkfun.com/products/100
    Kind of pump used is DC pump 12 volts http://www.amazon.com/Magicfly-DC30A-1230-Brushless-Waterproof-Submersible/dp/B009X6ADCM
    mail: g6.pola@gmail.com

    ReplyDelete
  6. Hi sir
    I am Basil from sweden.
    Kindly the KOD not working. What is the use of Pin 13 ?
    Regs.
    basilnamak@yahoo.com
    0046 767138345

    ReplyDelete
  7. Hi sir
    I am Basil from sweden.
    Kindly the KOD not working. What is the use of Pin 13 ?
    Regs.
    basilnamak@yahoo.com
    0046 767138345

    ReplyDelete
  8. Can this be applied using Ethernet Shield. The way that you can manually set the distance in a web page?

    ReplyDelete
  9. I would like to buy this project. How much will this cost?

    ReplyDelete
  10. Which type of motor did you use?

    ReplyDelete
  11. I work in this industry (for example, our products are http://www.dataonline.com/tank-level-monitoring/) and this information is helpful

    ReplyDelete
  12. can i get the circuit diagram for this project??

    ReplyDelete