{"id":23170357,"url":"https://github.com/nicodupont/automatic-sprinkler-system","last_synced_at":"2026-05-04T09:31:14.299Z","repository":{"id":268533677,"uuid":"904659335","full_name":"NicoDupont/Automatic-Sprinkler-System","owner":"NicoDupont","description":"The “IRRIPI” project to automate my sprinkler system Based on a raspberry pi and the use of its gpio to operate the solenoid valve relays.","archived":false,"fork":false,"pushed_at":"2024-12-17T20:48:17.000Z","size":8965,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T08:13:14.099Z","etag":null,"topics":["mariadb","php","python","rainbird","raspberry-pi","sprinkler","sprinkler-controller","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NicoDupont.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-17T10:09:47.000Z","updated_at":"2024-12-17T20:48:21.000Z","dependencies_parsed_at":"2024-12-17T11:37:42.535Z","dependency_job_id":null,"html_url":"https://github.com/NicoDupont/Automatic-Sprinkler-System","commit_stats":null,"previous_names":["nicodupont/automatic-sprinkler-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicoDupont%2FAutomatic-Sprinkler-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicoDupont%2FAutomatic-Sprinkler-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicoDupont%2FAutomatic-Sprinkler-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicoDupont%2FAutomatic-Sprinkler-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicoDupont","download_url":"https://codeload.github.com/NicoDupont/Automatic-Sprinkler-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247264424,"owners_count":20910580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mariadb","php","python","rainbird","raspberry-pi","sprinkler","sprinkler-controller","sql"],"created_at":"2024-12-18T04:12:49.751Z","updated_at":"2026-05-04T09:31:14.256Z","avatar_url":"https://github.com/NicoDupont.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arrosage Automatique\n\nA diy project to automate my irrigation system.  \n\nLast Update : 24/08/2025  \nThis is the second working version for summer 2024 and 2025.\n\nFor 2026 I am planning the following changes : \n\n- python scripts improved (remove pandas + update config)\n\n- webapp improved (front + back)\n\n- mqtt improved\n\n- overall improvement of functionality\n\n- rebuild electronics\n\n**Minimum Requirements :**\n\n- A Raspberry pi 2 \u003e= with python 3.8.x\n\n- A webserver for the web app\n\n- A database like mariadb/mysql (not tested with another db)\n\n**Main Goal : replace one or more irrigation controllers and do it by mylself.**    \n\n **Big Concept :**\n\n- Logic is done by python scripts on a raspberry pi\n\n- Data management is done with an sql data base, mqtt is used to monitor and control the systeme from HA\n\n- UI is based on a web application (home assistant can be used too(with mqtt))\n\n- Sensors data comes from home-assistant/esphome\n  \n  **Overall functional descriptions :**\n\n- A WebApp allows me to manage each solenoid valve/zone, global parameters, see the latest events, the watering sequence and some data.\n\n- A collection of python scripts are used to open or close the solenoid valves and compute the watering sequence(s). \n  \n  - There is a winter/stop, test, sequence on demande, automatic and manual mode\n  - The program checks some data to know if it can run watering\n  - Status and events are recorded in the database, sent to an mqtt broker and displayed on an LCD screen\n  - Several zones and/or sequences can run simultaneously (depends on the power supply for the solenoid valve and the watering pump)\n\n- config.py file is used to configure the script in addition with the database.\n\n- I can bypass the programmation to directly power supply and open any solenoid valve I want with 3 positions switch wired for each solenoid valve.\n\n- Mqtt autodiscovery for homeassistant can be used (first test for diagnostics and not finish actualy)\n\n- There are a few built-in automations : max number of active solenoid valve active at the same time, rainfall, test if one sequence is between 2 days,  calculate the coef duration in correlation with the outside temperature...\n\n**Side projects (in progress) :**\n\n- Tank filling  [link](https://github.com/NicoDupont/esp_remplissage_cuve)\n- [in progress] PCB for relays, lcd, rtc module [link](https://github.com/NicoDupont/PCB/tree/main/arrosage)\n- Irrigation circuit monitoring  [link](https://github.com/NicoDupont/Monitoring_Arrosage)\n- [in progress] Tank monitoring  [link](https://github.com/NicoDupont/Monitoring_Cuve_Arrosage)\n\n**Futur improvements :**\n\n- Mqtt : redo/complete mqtt parts with complete autodiscovery in HA (no need to add entities in configuration.yaml and add cmd/state topic)\n- The WebApp will be split into two components: Front + Api Back\n- Possibility to put a zone in more than 1 sequence\n- Clean and redo the watering box (electricity+electronics)\n\n**Current limitations :**\n\n- A sequence/zone cannot be straddled between 2 days due to the very simple operation of the programming\n- All parameters cannot be updated from home assistant\n- Events are visible only from the web interface\n- web app is not complete\n\n**Folder organisation :**\n\n    | IrriPi\n      =\u003e | App ( simple web app )\n         | Docs  \n         | rpi (python logic)\n         readme.md\n\n**Raspberry Pi requirements :** \n\n\u003cb\u003eConfig.txt :\u003c/b\u003e  \nIn the event of an unexpected restart, this will allow not to open a solenoid valve by mistake.  \nI need to add the following to the config.txt file to force gpio output and high state on gpio during the boot sequence :    \n\n\u003e gpio=4-13=op,dh  \n\u003e gpio=16-27=op,dh \n\nGpio 2,3 are used for I2C (rtc and lcd)  \nGpio 14-15 are reserved and cannot be used !   \n\n=\u003e 22 gpio are therefore usable  \n\n#### Start Watering at start\n\n\u003cb\u003eCron :\u003c/b\u003e  \nin contrab -e:\n\n\u003e @reboot sleep 20; sh /home/pi/launcher_arrosage.sh\n\n\u003cb\u003ebest solution by creating services with systemd\u003c/b\u003e\n\nFor each Python file (main.py, automation.py, mqtt_publish.py mqtt_subscribe.py)\n\n- arrosage-main\n- arrosage-automation\n- arrosage-publisher\n- arrosage-subscriber\n\n```bash\nsudo nano /etc/systemd/system/arrosage-main.service\n\n[Unit]\nDescription=Arrosage Main\nAfter=network-online.target sysinit.target\nWants=network-online.target sysinit.target\n\n[Service]\nUser=pi\nWorkingDirectory=/home/pi/arrosage\nExecStart=/usr/bin/python3 /home/pi/arrosage/main.py\nRestart=always\nRestartSec=5\n\n[Install]\nWantedBy=multi-user.target\n\n#update systemed\nsudo systemctl daemon-reload\n#enable service\nsudo systemctl enable arrosage-main.service\n#status\nsudo systemctl status arrosage-main.service\n#start\nsudo systemctl start arrosage-main.service\n#stop\nsudo systemctl stop arrosage-main.service\n#restart\nsudo systemctl restart arrosage-main.service\n```\n\n\u003cb\u003eRaspi-config :\u003c/b\u003e  \n\n- i2c must be activated (rtc + lcd)\n- spi must be deactivated  \n\n\u003cb\u003eMqtt autodiscovery in home assistant :\u003c/b\u003e    \n\n\u003e run : python3 /home/pi/arrosage/mqtt_autodiscovery.py     \n\n**Functional Diagram :**\n\n![Functional_Diagram](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/irripi.png)\n\n**Watering parts**\n\n- I use rainbird dv100 24vac solenoid valve\n\n**Electric Parts**\n\n- 1x Circuit breaker 2A 230v\n- 1x Electrical outlet 230v\n- 1x AC 24v 1,6A output rail din power supply (for solenoid valves) [links](https://www.amazon.fr/gp/product/B00F4QIL06/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8\u0026psc=1)\n- 1x DC 5v 2.5A output power supply (for raspberry, esp8266, relay, electronic...)\n\n![Electronics_Box](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/electric_box.jpg)\n\n**Electronics Parts**\n\n- Raspberry Pi 2b + micro sd \n- 22x relay 5v\n- 22x button 3 positions\n- 1x button 2 positions\n- 23x Screw Fuse Terminal Block rail din [links](https://fr.aliexpress.com/item/32957557760.html?spm=a2g0o.order_list.0.0.21ef5e5bLPmCsD\u0026gatewayAdapt=glo2fra)\n- 22x fuse 20x5 0.5A\n- 1x fuse 20x5 2A\n- 1x lcd 20x4 i2c 5v\n- 1x rtc module DS3231 i2c 3.3v\n\n![Electronics_Box](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/electronics_box.jpg)\n![Electronics_Box](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/electronics_box2.jpg)\n\n**Web App :**\n\nThe web app  :  \n\n![web app irripi](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/webapp1.png)\n\n**Schematic :**\n\n![fritzing irripi rpi](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/irripi_bb.png)\n\n**Integration in [Home-Assistant](https://www.home-assistant.io/)**\n\n![Home-Assistant lovelace](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/lovelace.png)\n![Home-Assistant lovelace](https://github.com/NicoDupont/Automatic-Sprinkler-System/blob/main/doc/mqtt.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicodupont%2Fautomatic-sprinkler-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicodupont%2Fautomatic-sprinkler-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicodupont%2Fautomatic-sprinkler-system/lists"}