Sonoff or NodeMCU to control watering

Hey there everyone,

Just trying to reinvent the wheel I think as I devise a means to water the garden when I’m away on holidays.

So I have all the necessary equipment in the actual garden for watering, drip lines and all that stuff, and up til now I was using a two line battery operated system to do the watering. But I’d love to have HA do this for me and control the watering dependent on weather. No worries about that side of things in HA but my main questions are as follows.

Which of the following do I use more efficiently:

  1. two separate Sonoff switches that power 12v supply to solenoids or…
  2. use a 2 channel relay with an ESP8266

any advice?

I would go with (and am currently building) an ESP8266 setup. You can then also run moisture sensors and flow switches if you wanted. I am using flow switches so I can know if:
a) there is flow when I expect it
b) there is flow when I don’t want it, therefore a stuck solenoid

I’m not too worried about moisture sensors, it’s a vegie bed but the sensor to ensure the solenoid is closed is good but aren’t they designed to close on fail? as in if the power is cut they close?

They do close on loss of power, but that’s why I said ‘stuck’. By that I mean physically, since I wouldnt expect the power to stay on when it shouldn’t since the relays are extremely unlikely to fail closed

Good point although not too sure what I’ll be able to do if they fail as I’m not planning on being around when this is in use. It’s for holidays. But as I said, point taken and understood.

I guess that given an alert to a water issue you could possibly ask a relative, friend or neighbour to go and sort it out for you

true and yet another good point. Thanks

It may be a tyranny of distance for me too. Where the solenoids are going is a bit of a distance from where the esp8266 and relays will be. Trying to run additional wiring to the flow switch might not be viable

the flow switch can be directly after the solenoid so you could just run 4 wires out there from the ESP & relays. or put the ESP & relays closer? (in a IP56 or better box if need be).

The plan is to run just some 12v wire out to the solenoid. The ESP is inside the house with the relays, right at the limit of wifi connectivity. So the distance from esp and relay to solenoid is about 3 metres. 12v should not deteriorate too badly over that distance I’m assuming. Mind you it is another metre or two to where the 12v originates so lets be safe and say 5 metres all up. That might be an issue, although outdoor Christmas lights seem to have that kind of length to them. Can wires from the esp run 3 metres without an issue?

Regardless, I’m also trying to do it with dual solenoids off a tap splitter as I have two zones to cover. They just need to run independently due to the water pressure not being enough for all of it to run at once. So I’d be running 4 wires out to the two solenoids already, 4 more can’t hurt.

I’m probably way over engineering what I need to accomplish but it’s almost a case of seeing if I can do it just for the sake of doing it.

Do you know what kind of protection the solenoids need if any? it’s only 12v power and they’re under an eave so they shouldn’t need IP protections should they? Sorry, first time playing with solenoids on a project.

It’s not an expensive project at least. Famous last words

1 Like

That distance is nothing in the scheme of things. I’ve run 12VDC much much further before. Just make sure the wire isn’t overly small.

Running two solenoids on separate ESP outputs is easy. Just use to MQTT topics.
eg:
retic\station1
retic\station2

The solenoids (usual retic ones) are sealed and will have no worries being underwater so under the eave will be fine!

Thanks for all that. Understood.

Quick question on the flow switch. I was thinking I had to have two of these, one for each solenoid but in fact I could simply place the flow switch right up on the tap (before I split the line to each solenoid) because it isn’t a matter of the switch having water in it, it’s only reading when there is water moving through it, correct? So it can be closer to the actual outside tap then the solenoid.

Or do I just try to put a flow switch on the incoming water mains line and that way I’ll know if water is flowing anywhere in my house when I am not expecting it to. Of course I won’t know where but I will know there is a leak or running tap somewhere. A completely separate setup perhaps with solar power encased in an IP rated enclosure.

I’d like to power down the ESP and relay most of the time and just bring it to life to do the daily watering. In my back room I have a sonoff already coming from the wall socket that keeps the power off in the kids activity room (TV, Xbox and PC) as there is no need to power any of those items throughout a normal school/work day when we are not there.

Automation for watering would turn on the sonoff, delay a few seconds to ensure the ESP was awake and functioning, then send the command to activate first one solenoid and after the watering time was up, the second solenoid would be turned on for it’s watering cycle. After it is all done, I would power it all back down. However if I had the flow switch out back I guess I could leave it for a few minutes and see if anything is still running then shut down. Quite an elaborate automation but I’m cool with that side of things.

Solenoids can stick right, but won’t open when they already closed unless power is supplied? So just ensuring the water flow has stopped should be enough?

I’m thinking this is all getting to complicated but now I’m committed to making it work regardless of how crazy my family thinks I am.

yep, you can just use a flow switch before you split to the multiple stations (although you dont HAVE to have the flow switch, that was just something I wanted to add since they are dirt cheap). Everything else you said sounds good. for me, the ESP draws such low power that I’m not bothered about it being on all the time

Thanks.

Agreed that the ESP draws little power, it is just where I want the power to come from is where I switch off all the other stuff normally so will adapt to that.

Once everything arrives and I get it built, I will report back on my success (or lack thereof). Thanks so much for the assistance so far.

no worries. I hope to have mine built soon (now that everyone has given me motivation to get it done) so I will create a “share your project” once it is done

I’m sure I’ll perfect mine just in time for the aussie winter when it will not be required for 6 months but as I said previously it is all about making it work not its practicality anymore

I’m the same. Curerntly my garden is happily watered by a cheap controller I got from Bunnings… but why use that when I can complicate things with HA :joy:

exactly my situation too, but you know…it’s got to be done. That or I could simply replace the batteries in the timer I already have