Automatic motor pump shutdown when the tank is full using Arduino.Two iron nails, trigger and feedback, is used as a sensor in the top of the tank. A current is passed to the trigger pin and when the water reaches the pins, the current passes from the trigger pin to the feedback pin. The feedback pin is connected to the Arduino. The relay and the current passing to the trigger pin is turned off, thus turning off the motor pump automatically. I have two tanks with bad and good water. Both motors are controlled this way separately. Green indicates that water is being filled and red indicates that water is filled. DM for code

Refer link for code:

https://drive.google.com/file/d/0B8MocwMjUI4jd3FYdmdZYzZ3eDg/view?usp=sharing

 

Connect the circuit as given. Now, the feedback pin and the trigger pins are just wires connected to two nails. These two nails must be placed on top of the tank. When water touches the pins, current is passed through the water from trigger pin and will be read in the feedback pin. The resistor that you see in the feedback pin is to avoid stray capacitance which can give a false positive. Use a relay with sufficient capacity for the motor that you will be using.