{"id":18406274,"url":"https://github.com/animalillo/garden-irrigation","last_synced_at":"2026-04-29T00:33:08.083Z","repository":{"id":70367336,"uuid":"68734246","full_name":"animalillo/garden-irrigation","owner":"animalillo","description":"Control irrigation water valves or other electric devices with relays","archived":false,"fork":false,"pushed_at":"2016-09-20T18:29:13.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T20:56:19.651Z","etag":null,"topics":["arduino","ethernet-shield","hardware","humidity-sensor","irrigation-controller","relay-controllers","rtc","sd-card"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/animalillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2016-09-20T17:02:04.000Z","updated_at":"2019-01-11T01:40:25.000Z","dependencies_parsed_at":"2023-02-26T12:31:30.311Z","dependency_job_id":null,"html_url":"https://github.com/animalillo/garden-irrigation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/animalillo/garden-irrigation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animalillo%2Fgarden-irrigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animalillo%2Fgarden-irrigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animalillo%2Fgarden-irrigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animalillo%2Fgarden-irrigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/animalillo","download_url":"https://codeload.github.com/animalillo/garden-irrigation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animalillo%2Fgarden-irrigation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32405901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["arduino","ethernet-shield","hardware","humidity-sensor","irrigation-controller","relay-controllers","rtc","sd-card"],"created_at":"2024-11-06T03:07:53.356Z","updated_at":"2026-04-29T00:33:08.075Z","avatar_url":"https://github.com/animalillo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Garden Irrigation Control\nThis project was created as a fun learning experience for me with PICs (arduino dumilanove) and to solve tiny itch I had about my garden needing to set the analog clock it had to control irrigation times.\n\nI migh or migh not update this project in the future with new features, and I will be creating a side project to control this system from a phone with or without a server web interface to gather the data, that's yet to be seen.\n\nOf course this system  could have many other uses besides irrigation control. Basically any timed electrical switching could be handled with this.\nHacking this code to use the sensor data to perform actions based on the sensor output shoulnd't be too hard. I might do that in the future, or maybe adding an earth humidity sensor and performing actions inresponse to that, i might do that some day.\n\n###Features:\nRight now the hardware consists on an arduino, ethernet shield + micro SD card reader, an RTC module that happens to have both, RTC and EEPROM ICs and an humidity sensor that has built-in thermometer.\n\n- It logs the temperature and humidity to an sd file.\n- Loads the network configuration from a file called net.cfg on the root of the micro SD card.\n- Controls two relays with 4 on-off alarms consisting on an start and end time (HH:MM:SS).\n- Exposes a serie of HTTP APIs to the connected network that allows log download, relay control, date and time configuration and instant sensor and status information access.\n\n#Hardware\n- Arduino UNO or compatible board\n- HanRun Ethernet shield with Micro SD card reader\n- I2C RTC module (Tiny RTC) obtained from [here](http://www.dx.com/p/tiny-rtc-real-time-clock-module-for-arduino-red-161172) which consists on:\n-- DS1307 RTC chip\n-- Atmel AT24C32 EEPROM 32K chip\n- Kyees funduino ver: 2R1B relay module from [here](http://www.dx.com/p/arduino-2-channel-relay-shield-module-red-144140)\n\n###Hardware setup:\nThe ethernet module is simply attached to the arduino board on the standard way.\nAs some of the pins are used by the ethernet shield, I used the next ones to connect the relay inputs to the arduino digital pins 8 and 9 outputs (IN1 -\u003e digital 9, IN2 - digital 8).\nAs for the DHT11 (humidity sensor) I used the pin 7.\nThe I2C RTC clock SDA goes to Arduino analog pin 4 and the SCL goes to arduino analog pin 5 ([if you decide to use another arduino board you should change according to the arduino documentation](https://www.arduino.cc/en/Reference/Wire))\n\n#Configuring network:\nTo configure the network on the device, you must place a file like the provded net.cfg.example file called net.cfg on the root directory of your sd card.\nYou must follow the next rules:\n\n\tMAC ADDRESS  that will use the device\n    IP ADDRESS that will have the device on your network\n    NETMASK of the network\n    GATEWAY of the network\n    DNS SERVER of the network\n    \nThis is an example of a working NET.CFG file:\n\n\tDE:AD:BE:EF:FE:ED\n\t192.168.4.6\n\t255.255.255.0\n\t192.168.4.1\n\t192.168.4.1\n\n#HTTP API\nLast, but not least, the HTTP API:\nAll the date and time API endpoints will use the following format due to hardware limitations and code simplicity:\n\u003e YEAR/MONTH/DAY/DAY_OF_WEEK/HOUR/MINUTE/SECOND\n\n- Date\n\t- **setTime** Configures the RTC clock with the given date and time.\n    \u003e \thttp://ip_address/setTime/YEAR/MONTH/DAY/DAY_OF_WEEK/HOUR/MINUTE/SECOND\n\n\t\u003e Example:\n\t\u003e http://192.168.4.6/setTime/2016/09/20/2/17/29/30 would set the time and date to tuesday 20th of september of the year 2016 and the time to 17:29:30\n\n\t- **getTimes** Prints a plain text dump of the current date and time and the configured alarms.\n\n- Alarms:\n\t- There is a total of 8 defined alarms, 4 for the each relay. Each alarm consists  on two times in between which the relay will be active, so it's important to **set them both!** There is no specific api to disable an alarm, but if you need to the procedure it's simple: set the start and end time to the same and it shouldn't fire.\n\t- All the alarm configurations are saved on the EEPROM and persisted in case of power failure.\n\t- **setAlarm** Configures an alarm.\n\t\t- This endpoint has three parameters, the alarm number, the operation type (start/stop) and the time.\n\t\t- The date part specified on this api will be ignored, but it's requiered.\n\t- \u003e\t\thttp://ip_address/setAlarm/ALARM_NUMBER(1-8)/ALARM_MODE(start/stop)/DATE_AND_TIME_URL_FORMATTED\n\t \u003e Example:\n\t \u003e http://192.168.4.6/setAlarm/1/start/2016/09/20/2/17/29/30 **AND another call to** http://192.168.4.6/setAlarm/1/start/2016/09/20/2/19/00/00 would configure an alarm to start everyday at 17:19:30 and stop at 19:00:00\n\n- Direct relay control\n\t- To control the relays two endpoints are available (sw1 and sw2), both have the same functionality: manually enabling, dissabling and controlling the relays.\n\t- **sw*X*** Access switch ***X***, replace X with 1 or 2.\n\t\t- **on** Turn the relay on.\n\t\t- **off** Turn the relay off.\n\t\t\t- **force** Force the relay to stay in off state even if an alarm would fire. This will be saved even after device restart and until the next call to on or off endpoints is made.\n    - \u003e Example:\n     http://192.168.4.6/sw1/on Would turn the first relay on\n     http://192.168.4.6/sw1/off Would turn the first relay off and let alarms fire\n     http://192.168.4.6/sw1/off/force Would rutn the first relay off and prevent alarms from turning it on.\n\n- Logs\n\t- To gather the logs that the system has generated a simple call to /log is needed. Note that the data log will be deleted once the transfer has finished.\n\t- **log** Get the logs and clear the file\n\t- The log format is a line containing each measurement, each line is confirmed of the current date and time and the sensors data\n\t- Example output:\n\t- \t\u003e \u003c2016-09-20 20:20:10\u003eH:20;T:35;\n\t\t\u003e \u003c2016-09-20 20:21:10\u003eH:21;T:34;\n\t- \u003e\t\thttp://ip_address/log\n\n\t\u003e Example:\n\t\u003e http://192.168.4.6/log\n\n- Sensors\n\t- **getSensors** Prints a simple line containing the sensors information and relay status. The format of the returned text is: sensor:status;other_sensor:status;...\n\t\t- **H** is an integer representing the relative humidity\n\t\t- **T** is an integer representing the temperature\n\t\t- **SW1** and **SW2** is an integer representing the boolean status of the relay 1 and 2\n\n#Case\nI made a simple 3D case, but the cap won't stick to the body unless you use tape, if anybody is willing to make a better design it's welcome, just make a merge request.\n\nThis case will work with the provided hardware specs, but I can't warrant that it will with another kind of module brands that might be perfectly compatible with this code as I designed it to be quiet a tight fit.\nThe case has space for a prototyping board and an extra board on top of this, so you can make a pretty circuit and integrate all the components.\n\nI made the case so it's rain resistant, but that will depend on your 3D printer, material and printer configuration. Check the results that come from your printer!\n\n#License\nThe code is under the [GPL V3](http://www.gnu.org/licenses/gpl.html) license created by Marcos Zuriaga, unless otherwise specified on the files.\n\nThe case model is under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International, also created by Marcos Zuriaga.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimalillo%2Fgarden-irrigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimalillo%2Fgarden-irrigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimalillo%2Fgarden-irrigation/lists"}