Water Tank Overflow Detector using Soil Moisture Sensor

 Soil Moisture Sensor sense moisture level of a soil and used for automatic plant watering application which was illustrated in the tutorial Soil Moisture Sensor for Plant with Arduino. But such moisture sensor can also be used for the detection of water level or water overflow in a tank as illustrated here. This is because the soil moisture sensor actually measure the level of conductivity in soil, that is, water content level in soil. The resistivity is the reciprocal of conductivity so we can also say that the soil moisture sensor measure the resistivity in the soil. In this tutorial we will use soil moisture sensor for automatic water pump cut-off controller when the water tank is filled.

The following shows the circuit diagram of water overflow controller in created in Proteus electronics design software with the soil moisture sensor.

water tank overflow controller circuit diagram

In the above diagram we have illustrated the water pump as a simple DC motor. This DC motor is controlled using Arduino from pin 8 and N7000 MOSFET transistor. The N7000 mosfet is used as a digitally controlled switch. A protection diode is also used across the motor. The motor used here is powered using 12V supply. This can also from home power socket.

Another push button is connected at the pin 2 of Arduino. This push button is used to turn on and off the dc motor pump manually.

The dc motor water pump actually does two things. First it fills up the tank when the push button is pressed. Then when the water reaches the top and the sensor informs the Arduino that there is water at the top, the motor pump is stopped automatically.  

Shown in the diagram above is the YL-69(HL-69) soil moisture sensor module which is used to sense the water at the top.

soil moisture sensor YL-69

The above picture shows readily available YL-69(HL-69) soil moisture sensor module . The module consist of the prong sensor(the two electrodes) and the electronic controller board. The electronic controller board has four pins, the AO (analog out), DO (digital out), GND, and VCC pins. It also has a potentiometer on the board which can be rotated to change the sensitivity of the sensor. The AO and DO pins are sensor output pins which are used to read the sensor output data. These sensor output pins are connected to a microcontroller or microcontroller board like Arduino, Raspberry Pi etc. When a preset threshold of resistivity(conductivity) is reached, the sensor output HIGH signal on the digital output pin DO. The DO is connected to any digital pin on Arduino or microcontroller. The analog output pin can be used to read the level of conductivity continuously. The analog output pin AO is connected to the analog pin of Arduino or microcontroller. The sensor outputs level of conductivity in the range 0 to 5V. The Arduino converts this voltage level to digital representation in the range 0 to 1023. Here we do not need the analog output signal because we just want to turn off the motor pump if the water level reaches the top of the tank. So here we will be using the digital output pin DO only. 

The digital output pin DO of the soil moisture sensor is connected to pin 9 of Arduino. The sensor module is powered using +5V from Arduino.

The next part of this tutorial are below:

> Water Overflow Controller Proteus Simulation

Post a Comment

Previous Post Next Post