If anybody is still interested in this topic I have to say that this sort of moisture sensing has some drawbacks which makes it useless in the scale of months, the sensor is sensing resistance of soil by sending voltage and current over sensor and comparing it by means of LM393 comparator, this makes inherent electrolysis of moist soil, if sensors has made of copper then the sensor itself will be corroded upon the time and even in worst scenario it will make unwanted ions in the soil which are hazardous to the plants in concentrated situation, another drawback is sensor drift which is another pain because of electrolysis of soil again.

also using delay() is not handy in the program since it would make the device slow for using in indoor situation, if device's hanged or stop functioning then you will face with a dried plant, there is no control over that. also screen will use many power and because of working 24/7 its lifespan will decrease dramatically and so many things I cannot remember though.



Here I reprogram it to be faster and more reliable to use in serious application. I have to emphasis it that pins may was changed and new function and pins are added so please check them in the code and don't blame me. also DO NOT FORGET to change sensors with pen graphite, graphite is chemically inactive in comparison with copper and never corrode, so never makes unwanted ions.



what are new in this code:

1- Fast detection with no delay interrupt

2- Screen turn off automatically and turn on with push button (pin 2)

3- Pump wont work in case of empty tank

4- PWM (250kHz) VCC with subtracting and averaging method for sensing moisture to reduce electrolysis, drift and fluctuation, also because of using pins 9 and 10 for sensor VCC it is possible to turn off sensors to sense periodically instead of 24/7

5- watchdog function, device never hang

6- eeprom write and read function, so you will find how many times device restarted

if you have any question never hesitate to ask.you can download below download _code download _Libraries