Τhis simple circuit detects soil moisture and provides a visual alert when moisture levels are below a certain threshold. Soil moisture is detected through two electrodes placed at the soil at a short distance from each other (typically, 2 to 5 cm).
As the soil becomes drier (dry) its conductivity decreases and this is detected by the circuit. In order to avoid corrosion due to electrolysis in the electrodes, we apply AC voltage to them. The AC voltage is produced from an oscillator.
The circuit is made with a single integrated circuit, the 74HC132 which contains internally 4 Schmitt trigger NAND gates. We use the U1A gate to make an oscillator at 10 KHz. The oscillator is a classic unstable multi-vibrator. Its frequency is determined by the resistor R1 and the capacitor C1. We have chosen a relatively large value for R1 in order to achieve a small current. The same applies to all the other resistors of the circuit. All resistors values are relatively high in order to ensure small currents and therefore minimal consumption in the circuit.
The oscillator produces a square wavw that is not purely AC in the sense that its mean level is non-zero. It contains a DC component and this is to be expected since the circuit operates with a single supply voltage. In order to reject the DC component, we use some blocking capacitors. C6 rejects any DC component in the oscillator signal while C5 rejects any DC offset coming from inputs 4 and 5 of U1B gate. Thus on the electrodes placed on the ground, there is only AC to ensure that there will be no oxidation problems due to electrolysis.
If there is a sufficient amount of moisture in the soil, the AC voltage passes through the soil at the inputs of U1B gate. U1B amplifies and inverts the signal. D1 rectifies the signal and charges capacitor C4. Once the C4 is sufficiently charged, both inputs in the U1C gate get at high potential. Therefore, the output of U1C, goes at logic 0. In turn, the output of gate U1D goes high. This way the D3 LED does not light up when there is sufficient soil moisture.
The U1D has also been connected as an oscillator. The oscillator is activated by logic 1 in terminal 12 during times when the soil is quite dry and the voltage at the inputs of gate U1B is very low. The right level of activation (between drought and humidity) can be adjusted with the trimmer R8. The settings depend on the soil type, the distance between the electrodes and on our preferences regarding the level of humidity that is sufficient for our plants.
The oscillation frequency of the U1D is about 1.5Hz and makes LED D3 flashing when the soil moisture falls below the level we have set through R8.
The D2 diode with the R5 resistor adjust the duty cyrcle and ensure that the LED stays on and off for the 20% and the 80% of each cycle, respectively. This ensures lower power consumption and the circuit will be able to operate for a long time, powered exclusively by two standard 1.5V batteries.
The current consumption of the circuit is about 1.4mA when the LED is on and about 0.4mA when the LED is off. With two classic 1.5V batteries (with a typical total battery capacity of around 3,000mAh) the circuit can operate for about 300 days.