A capacitive soil moisture sensor delivers the information of the moisture of a probed soil.
The threshold of the moisture level can be set and thru further percice pumping been hold.
LEDs show the moisture level and pump threshold.
If the sensor gets unplugged, LEDs will blink red until the sensor is connected back to the pump and the system gets restarted, so there is no uncontrolled water flow in case of a removed sensor.
The pump speed can be adjusted.
One thing i wished i did:
-set two thresholds for pump start and pump stop, so the soil gets time to dry out for a while.
i might implement it, but first i am testing this setup for a while.
That's all.
Code below.
Details
The pumps power supply is a 24V 1 Amp max. The 24V get stepped down to 5V for the Arduino nano and LEDs.