Project · · 2 min read

Smart watering for a community garden

How the ESDN helped a Greenville community garden meter its water and water itself on a schedule.

Type
Hardware

The ECU Water Resources Center is involved in a community garden project in Greenville, run together with the people of the neighborhood. Through the ESDN, we supported it with a way to meter water consumption and to turn the watering on and off every day at fixed hours. You can see it at 1:40 in the video:

Both the water meter and the valve are wired to a single Milesight valve controller. We also built a custom 2 m extension cable so the Milesight box could sit on a post, properly exposed to the sun.

Solar-powered Milesight valve controller on a wooden post The Milesight valve controller, solar powered, on its post in the garden.

We used an off-the-shelf Orbit valve and replaced the existing valve with a latching solenoid valve. Finding the right parts was actually the hard part: we had to work around three different types of fittings.

Orbit irrigation valve with its solenoid wired up inside the valve box The valve and its latching solenoid, inside the valve box.

The rule chain

The controller talks LoRaWAN through The Things Network, and the logic lives in a ThingsBoard rule chain:

  • From the dashboard, you can open or close the valve, open it for a set time, or open it for a set amount of water. Gallons are converted into flow meter pulses, and the controller closes the valve by itself once it has counted them.
  • Before sending anything, the chain checks the last state the valve reported, so it doesn’t try to open a valve that is already open.
  • Each command is turned into a Milesight hex payload, converted to base64 and sent as a downlink through the TTN integration.
  • When the valve opens, the controller is told to report every 15 seconds so you can follow the watering live. When it closes, it goes back to every 5 minutes.
  • A watering status (“Watering”, “Not Watering”, “Requested 10 minutes”…) is saved on the garden asset for the dashboard.

The ThingsBoard rule chain for the watering system: script, switch, delay and attribute nodes wired together. The “Milesight Solenoid Valve - Watering System” rule chain in ThingsBoard.

Parts list

QtyPartPrice
1Irrigation valve box$27
1Valve (Orbit 3/4 in. electric inline)$17
1Solenoid (Orbit replacement)$11
190° adapter, pack of 2$23
1Splitter$11
1FHT to FIP fitting$10
1Custom 2 m extension cable, so the Milesight box sits on a post in the sunhome-made

It was a fun project, and I can’t wait to have a garden of my own and automate the watering. We have soil sensors in that garden too, but we did not automate the watering based on their data.