0.0.1-alpha.1 • Published 8 months ago

irrigationsystem v0.0.1-alpha.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

HomeKit Irrigation System

version

Parts

Built with readily available 'off the shelf' parts, housed in a sealed ABS enclosure. As the system is housed externally to the house and exposed to yhe weather, 240v wiring to the 24v AC transformer has also been house in a seperate sealed ABS enclosure for extra protection

  • Raspberry Pi Zero W
  • 24v AC transformer (Hunter irrigation one)
  • LM2596HV AC/DC stepdown buck converter (DC output adjusted to 5v)
  • JSN-SR04T ultrasonic sensor
  • 8 channel solid-state relay board (highlevel trigger)
  • Water flow sensor - pulsed output
  • Waterproof push-on/push-off LED lit switch
  • Mains power cable
  • Irrigation wire

Water Tank Configuration

The following options are available in IrrigationSystem_config.json tanks object, which is a array of defined watertanks.

eg:

    "tanks": [
        {
            "name": "Test Tank",
            "enabled": true,
            "capacity": 5000,
            "sensorTrigPin": 20,
            "sensorEchoPin": 21,
            "sensorHeight": 1970,
            "minimumLevel": 200
        }
    ],
NameDescriptionDefault
nameName of this water tank
enabledIs the tank enabled when runningfalse
capacityLitre(s) capacity of this tank
minimumLevelMinimum reading distance (in mm) for ultrasonic sensor
sensorEchoPinRPi GPIO pin to which ultrasonic sensor echo is attached
sensorHeightHeight (in mm) above tank base where ultrasonic sensor is mounted
sensorTrigPinRPi GPIO pin to which ultrasonic sensor trigger is attached
uuidThis is automatically generated. DO NOT CHANGE once populated

Irrigation Zone Configuration

The following options are available in IrrigationSystem_config.json zones object, which is a array of defined irrigation zones.

eg:

    "zones": [
        {
            "name": "Zone 1",
            "enabled": false,
            "runtime": 300,
            "relayPin": 14
        },
        {
            "name": "Zone 2",
            "enabled": true,
            "relayPin": 15,
            "runtime": 300
        },
    ]
NameDescriptionDefault
nameName of this irrigation zone
enabledIs the zone enabledfalse
replayPinRPi GPIO pin to which relay is attached to operate the irrigation valve
runtimeRuntime (in seconds) for this irrigation zone300
uuidThis is automatically generated. DO NOT CHANGE once populated

Configuration Options

The following options are available in IrrigationSystem_config.json options object.

NameDescriptionDefault
debugDetailed debuggingfalse
elevationHeight above sea level for the weather station0
eveHistoryProvide history in EveHome application where applicabletrue
flowRateWater sensor pulse flow rate in Litres Per Minute (LPM) at 1Hz
latitudeLatitude for current location0.0
leakSensorCreate a leak sensor for irrigation system. Requires flowRate and sensorFlowPin to be definedfalse
longitudeLongitude for current location0.0
powerSwitchCreate a switch to 'virtually' power on/off the irrigation systemfalse
maxRuntimeMaxmium runtime (in seconds) for any defined irrigation zone7200
sensorFlowPinRPi GPIO pin to which a water flow sensor is attached
waterLeakAlertTrigger an alert in HomeKit when a water leak is detectedfalse

Ultrasonic Waterlevel Measuring

I've included 'C' source code (usonic_measure.c) for a program which reads distances via an ultrasonic sensor. I used a JSN-SR04T waterproof ultrasonic sensor in my progect. The particular model has a minimum reading distance of 200mm and a maximum distance of 4500mm. This is mounted ontop of my watertank at 200mm above the maximum waterlevel for the tank.

This program requires the wiringPI library to be installed before compiliation of the program

  • sudo apt install wiringPI

It can be compiled with:

  • gcc -o dist/usonic_measure -lwiringPi usonic_measure.c

Disclaimer

This is a personal hobby project, provided "as-is," with no warranty whatsoever, express or implied, including but not limited to warranties of merchantability or fitness for a particular purpose. Building and running this project is done entirely at your own risk.

As this project involves wiring from a mains power source, it is strongly recommended that you seek the assistance of a licensed electrician. While I’ve been running this project successfully at my home, your experience may vary.

Please note that I am not affiliated with any companies, including but not limited to Apple, or any other entities. The author of this project shall not be held liable for any damages or issues arising from its use. If you do encounter any problems with the source code, feel free to reach out, and we can discuss possible solutions

0.0.1-alpha.1

8 months ago