I have a solution running since weeks and it works fine for me. I used this:
https://www.pearl.de/a-NX7367-3506.shtml
Since this are solenoid valves they need +power to open and -power to close, you need a H-brigde to drive the valve. Sounds difficult, but when using i.e. a TB6612NL motor driver you can use modules from WEMOS, Adafruit or Sparkfun and you are ready. Just pulsing two GPIO's for 50msec:
Code: Select all
on System#Boot do
GPIO,12,2 // at first set both to input
GPIO,13,2 // to stay save - later it is an output
GPIO,16,0 // STBY on, do nothing
endon
on Bodenfeuchte#Pflanz1>575 do
if [Wasser#FreigabeHahn1]=1 and [Regensensor#Regen]=0
Pulse,16,1,100
Pulse,12,1,50
Pulse,13,0,50 //start watering (open valve)
Publish aussen/state/WM/Garten01/Wasser/Hahn1,1
timerSet,1,300 //timer 1 set for 5 minutes
else
Pulse,16,1,100
Pulse,12,0,50
Pulse,13,1,50 //stop watering (close valve)
Publish aussen/state/WM/Garten01/Wasser/Hahn1,0
endif
endon
on Rules#Timer=1 do
Pulse,16,1,100
Pulse,12,0,50
Pulse,13,1,50 //stop watering (close valve)
Publish aussen/state/WM/Garten01/Wasser/Hahn1,0
endon
Pflanz1 is a cheap Capacitive Soil Moisture sensor, FreigabeHahn1 is a MQTT-input and Regen is a simple water sensor. I also attached a simple water flowmeter YF-S201 to detect flow even when there should be no flow. Gives me the possibility to react when receiving an alert on my phone.
The solenoid valve is working with 3Volts. To achieve reliable results, you better use a 5V/3A Charger Power supply and have a additional 100µF Capacitor at the driver module.