For tests I use a Arduino Mega board, alpahanumerical 1602 LCD with i2c interface, soil moisture module, but for real use must use relay module for control a wattering pump.
I use sketch named lcd1602_i2c_soilhumidity_ver1.ino who can find at my Github channel.
My soil moisture sensor is not permanent powered with 5V because in timp probe sensor will be distroyed by electrocorrosion effects, so, I powered the sensor just few seconds at 5 seconds when pump is on for avoid flooding and at 5 minutes (in test I use 20 seconds) when soil is wet.
I made a few years ago some tests with CMOS 4093 gates (see original article from http://www.arduinotehniq.com/old/udare_automata/udare_automata_flori.htm) when I use this schematic whit permanent power of soil probe:
and after 3 months my stainess steel probe was corroded:
So, I put a threshold value at 25% and I have 2 cases:
- when soil is wet, pump is off, measurements are made at long periods:
- when soil is dry, pump is on, measurement are made at 5 seconds for avoid floods:
You can see these cases in a movie named soil moisture control system using Arduino