Earlier, I wrote some posts on a Capacitive Soil Humidity sensor, Two years down the line this still functions well.
However, a recent video of Andreas Spiess, presented a rather interesting capacitive soil sensor that works according to a somewhat different principle
My earlier sensor was an oscillator in which the soil sensor formed the capacitor determining the frequency of the oscillator. This frequency was subsequently measured with PulseIn
The sensor that Andreas touched upon does it different: There is a fixed frequency oscillator, built with a 555. The square wave generated is then fed to the sensor that -as we know- is in fact a capacitor. To a square wave signal that capacitor however has a certain reactance, or for arguments sake a resistance that forms a voltage divider with a pure ohm type resistor (the 10k one on pin 3). The wetter the soil, the higher the capacitance of the sensor, the smaller the reactance to the square wave, the lower the voltage on the signal line.
The voltage on the signal pin -that can be measured by an analog pin on the Arduino‐ is thus a representation of the humidity in the soil.
Sadly some of the sensors sold come with some problems.
- Some have an NE555 (4.5-16V) rather than the TLC555 (needs 2-15V) you will need to remove the voltage regulator. If you have a board with an NE555, you will not be able to use it with an ESP8266 or ESP32. Version V1.2 should have the voltage regulator and a TLC555. It runs at 1.5MHz with a 34%duty cycle.
- The 1 M resistor (R4 picture below) is not connected to ground. Easiest solution here is to add a 1M resistor over Aout and ground pins
There is some technical info on calibrating this sensor.
It is possible to modify these sensors to get a frequency output. Basically it involves picking up the signal from pin3 of the 555. This guy explains how.
There is an open hardware wireless add on for this sensor.