Irrigation Hardware – Electrical and IT
Software – OpenSprinkler
As noted elsewhere, we used the OpenSprinkler software on one of our home servers. This was configured to send HTTP requests to the hardware, as noted below.
For the solenoids, we chose the Holman Industries VHF5125T from Bunnings. This was the cheapest solenoid they sold. These devices run on 24V AC, which is an issue, but it seems that most units run on 24V AC. I am guessing this minimises electrolysis with the electrical connections, and also magnetisation of the solenoid. You can get four solenoid units mounted together, but this project to be honest just grew. These were powered through relays via a 24V AC plugpack from Jaycar.
Solenoid Control – Sonoff 4CH Pro R2 Relay
To control the relays, we used Sonoff 4CH Relays. These could be powered direct from 240V, but for safety, we powered them from 12V. They also needed to be powered by 24V AC for the solenoids of course. The nice thing about this device is that there is a manual toggle button for each output. The 4CH Pro R2 was really cheap, at under $50 delivered.
The stock firmware on these devices is not great, but does work. For this reason I have updated the firmware, installing the Tasmota Firmware onto the devices. This gives improved capabilities, including MQTT, HTTP, basic scripting and more. In fact, I loaded this firmware onto a basic ESP8266 relay from AliExpress, and was able to control it via HTTP. The Tasmota Firmware only works on ESP8266 devices, and I have worked out that they are more reliable if MQTT is not used. They have pushed about everything into the chip that you could imagine, and I cannot imagine there is much space left.
Once again, one of the cute things is that it has a manual control. With the 4CH Pro Module, essentially no configuration is needed. I did need to configure the device slightly. I needed to type the following so that the device would turn all relays off if it cold booted. On a warm boot it would remember the last relay state, but cold boot will turn the relays off
This sets a 950 second timeout on the on command on the relay (100 second offset). If there is no further command (on or off) after 950 seconds, the relay turns off. This needs to be a different value for fire and also for pump.
The devices sit on the network, and just work. And work well.
The relay can be controlled in the following ways:
http://192.168.0.68:cm?cmnd=power1%201 http://192.168.0.68:cm?cmnd=power4%201 http://192.168.0.68:cm?cmnd=power4%200
As an example, the first two lines turn on relays 1 and 4 respectively. The third line turns off the fourth relay. Whilst the relay will permit the %20 space on the URL, OpenSprinkler will not. Therefore I needed to configure each of the outputs in turn in OpenSprinkler as shown in the image below.
Also… ‘Special Station Auto Refresh’ should be switched on. This will (apparently) refresh each station zone once a second when programs are running. Since there are about 200 station zones allocated, it could take up to 400 seconds to refresh. Therefore, we could set a ‘pulsetime’ of about 240 seconds to be safe for most cases, which equates to a ‘pulsetime’ value of 340, with the 100 offset. This only seems to operate when a program is running. What this means is that if the ‘OFF’ HTTP fails, the sprinkler will only remain on for up to another four minutes, assuming that the relay controller is still operating.
IoT Wireless Network
One thing that I found when I moved to setting up a special IoT Wireless Network was that the Tasmota Firmware decided that it wanted to lock onto the backup WiFi network, even if the IoT network was present. This was a pain. Thankfully with the Ubiquiti UniFi system I was able to see what was going on. The image below shows them connected to the IoT network, which is correct. Earlier they were connected to the backup WiFi network.
Below shows the WiFi configuration. I needed to remove the details for Access Point AP2, and things started working again.