Folks, I am new to Arduino. Need help to automate water tank (water quantity)

somairm:
Thanks, but is this the full code ? Can the following be alter..... I can place a switch or can place two wires in the tank at low level. When this wries gets open (when there is no water) send the sms.

a problem which can occure when using electrodes in water to detect level is electrolysis, e.g.
https://waterlevelcircuit.blogspot.co.uk/2014/03/electrolysis-free-water-level.html

in several projects where water levels in tanks was required a 0 to 5volt 1KHz square wave was generated (using timer interrupts) which via a suitable circuit applied an AC signal to an electrode. When the generated signal was high (5V output) the state of the other electrode was read to determine level.