Close
0%
0%

Sprinkler Switch

A web-enabled extension to your home lawn irrigation controller that intelligently enables or disables your sprinkler system.

Similar projects worth following
A service to manage your home lawn irrigation controller and intelligently enable or disable your sprinkler system.

Currently includes a Node.JS app that can be run as a cron entry in order to set a GPIO pin to high/low if there was rain in the recent past or rain coming up soon. It is assumed that you have already wired a GPIO pin to a relay or a MOSFET so you can switch on or off your irrigation system.

There are three parts of this project:

  1. Finding a way to wire a "rain sensor" to your irrigation controller. The sensor should just respond to an open/closed circuit - it shouldn't be using fancy serial or I2C communication.
  2. Building a relay that can be open/closed using a GPIO pin on a Raspberry Pi. I just wire up a MOSFET that open/closes the gate based on a pin's high/low status.
  3. Install the SprinklerSwitch software to check yesterday's weather conditions and today's forecast conditions, then toggle the GPIO pin high/low based on the results.

If all goes well, your home irrigation system will only turn on if there is very little or no rain in your weather forecast, and will stay off if you recently have had rain or are expecting some.

  • More Advanced Rules for Soil Conditions

    DeckerEgo09/21/2024 at 20:45 0 comments

    Reading up on evaporation in suburban soils versus transpiration rates in turf grass made me realize - this ain't as simple as checking a rain meter!

    I've updated SprinklerSwitch to take in a huge number of additional values from NOAA, from which we now calculate two different "facts" for consideration when determining if we should irrigate the lawn or not:

    1. If rain is likely to occur tomorrow, or

    2. If the soil evaporation rate is likely to be lower than the amount of rain precipitated

    Possible future precipitation is based on threshold values for precipitable water and cloud water, while evaporation is calculated based on specific humidity, ground temperature, and wind speed. A "turf nerf" percentage is applied to the evaporation rate to determine how quickly moisture would leave the lawn given complete turf grass coverage.

    So far things are working! In my tests I'm seeing the irrigation system being correctly shut down when rains arrive. More testing is needed, but I've pushed these changes out as the latest release.

  • New Version Released!

    DeckerEgo08/16/2024 at 23:42 0 comments

    The latest version of the SprinklerSwitch is out - this is installable on the most recent Raspian images and automatically enables/disables irrigation based on rain forecasts.

    Bear in mind there is no UI at the moment - this is all done using background tasks with a simple Node.JS script. Additional integrations for remote management are coming...

  • Currently in Rebuild Mode - Beta Released

    DeckerEgo08/02/2024 at 00:15 0 comments

    It has been a while since this project has been updated, so I've started a rewrite in Node.JS and provided a simpler installation path. The goal is to not build a web interface this time - but instead make this much more of an IoT sensor with potential API integration using SQSGateway.

    An early version is posted in GitHub, with installation scripts and additional tweaks coming soon.

  • Updated for Raspian Jessie!

    DeckerEgo07/29/2016 at 01:50 0 comments

    The SprinklerSwitch project has FINALLY been updated to support the latest version of Raspian. The biggest hiccup was switching to the WiringPi2 library - which is now the defacto library for addressing GPIO pins. The good thing is pin addressing is now entirely in userspace (no sudo required!), however there were significant changes that required refactoring.

    Things are up & tested with the latest version of Raspian however - so have at it!

View all 4 project logs

  • 1
    Step 1

    First, construct a switch for your Raspberry Pi GPIO pins. I generally use MOSFETs for these low-voltage operations, with the gate to a GPIO pin.

  • 2
    Step 2

    Some sprinkler systems have a moisture / rain sensor that open or close a circuit to disable or enable the next scheduled irrigation. Usually if a sensor is not installed, there's a jumper wire to keep the circuit open. Replace the jumper or sensor wires with the open & ground wires on the relay or MOSTFET wired to the Pi. --> DO NOT WIRE THE GPIO PIN TO YOUR SPRINKLER SYSTEM <--. You'll likely frizzle-fry the whole thing. You want to close the circuit, not send any amperage to it. Seriously. Don't move on unless you understand your irrigation system. SERIOUSLY.

  • 3
    Step 3

    If necessary, enable the sensor or disable the sensor bypass on the irrigation controller.

View all 4 instructions

Enjoy this project?

Share

Discussions

gareth wrote 08/05/2024 at 20:36 point

Nice project!

I hacked together a simpler version last summer - with an ESP12 driving a relay which set the RAIN_SENSE terminal on my RainBird controller to inhibit watering.

Tasmota running on the ESP gets an MQTT event to enable or disable the relay and a simple bash script checks the date/weather to generate the mqtt events.

Planning to improve it for this coming summer so looking forward to see what your Beta version looks like :-)

Gareth

  Are you sure? yes | no

DeckerEgo wrote 08/05/2024 at 21:12 point

We think alike! I'm working on SQS support for this as well. Right now it has done well in enabling/disabling based on rainfall, next step is finishing the README and getting this together as a dpkg.

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates