My greenhouse project

I'm doing a project very similar to this, including a web interface with charts of all the sensor data and controls to set the various thresholds. I'm still waiting for all the parts. In a few weeks (months?) I'll post complete schematics and code.

I will agree that those moisture sensors cannot be used the way they are sold. They (or the simpler two nails they replace) must be driven with an AC current, in order to minimize galvanic effects.

You can find many discussions online, for example this and this. I think I will build this circuit. If you don't feel like building it yourself and experimenting, you can just buy it from them. Quoting their explanation:

A special circuit is needed to measure electrical resistance through a liquid. An AC voltage is applied between metal electrodes, and the signal is then the amount of ac current that flows per ohms law. DC currents must not be allowed to flow through the wet part of the circuit, or else the metal electrodes will corrode. An oxide layer is formed within a fraction of a second on the metal cathode surface. The resistance of this oxide layer is nonlinear and voltage volttage and history dependent (like a nightmare diode). Also, corrosion products go into solution or form "cat whiskers" out from the electrodes. These spoil the reading and eventually can short circuit the electrodes. AC excitation avoids these problems, by reversing the polarity of the current many times per second, so that no net reaction takes place at either electrode.

1 Like