Irrigation control over the internet with Arduino

Hello, I'd like to introduce you to the project that I realized this year. I created a web-based system for horticulture that specializes in the sale and cultivation of various plant species, trees, flowers and other exotic crops.


Web-based system has been designed to meet the following requirements:

  • Record temperature, measure rain level (raining or not)
  • Heating / cooling control based on temperature
  • Irrigation control at set times or on demand with weather condition counting
  • statistics
  • Remote restart boards
  • Logs
  • Login system

As Arduino Mega was used as the control microcontroller, because Arduino Uno was on the edge with memory and greatly jammed, the watchdog rebooted almost every minute. Arduino Mega was a great choice thanks to a sufficient number of pins and especially great memory for a program with a larger RAM memory.
Arduino sends temperature and rain data to the Web via the Wiznet W5100 Ethernet Shield. The temperature is read out digitally from the DS18B20 sensor and the rain reading through an analogue value. After sending datas, Arduino will run PHP script with logic of system, it will update all outputs, and then Arduino will download ON/OFF for each pin in system.


There is no operation on the microcontroller side to load the board. Total system response is within 6 seconds. The temperature sensor is in the glass where it is necessary to keep the temperature. During hot summer days, it is cooled to the set temperature with an optional hysteresis, during the winter months it is scorched with a set temperature and hysteresis. The heating / cooling selection must be done manually in the system. It is also possible to manually cool / heat (ON / OFF) for an indefinite period of time.

Circuit Management consists of four physical circuits that are governed by the time of selecting the days of the week when to pay these times. If this mode is not selected, the output is still off and switched on to request the user from the site for a set time in minutes. If it rains during the call, the system shuts down and will not turn on. However, if the automatic mode is set to time and during this time it starts to rain, the circuit switches off and, if it stops running before the end of the built-in interval, switches itself on again.

A watchdog was implemented in Arduino for trouble-free operation, when Arduino is restarted if he gets stuck. In the event of an internet dropout or site unavailability, for example due to maintenance, the heating and cooling relay circuits are automatically switched off after two minutes to establish a connection to the web. After rebooting Arduina, all outputs are off. The logs fail to log on to the interface (bad name or password) with the IP address of the client who attempted the connection. The logs also record data about invalid data from sensor DS18B20 85.00 or -127.00, which are typical sensor faults due to poor wiring, CRC errors.


The system also includes graphs where it is possible to view the temperature development in 24 hours from the moment of chart loading and 7 days back, as well as circuit activity and cooling / heating activity. Activities are recorded every minute and temperature once every 5 minutes into the database (not related to working with real-time data). All the inputs / outputs with which the system operates can be called by themselves for clarity where the irrigation circuit is used. As relay outputs it is possible to use solenoids, pumps with a total power of 2.3kW per relay, i. 230V 10A.
The whole system is hidden behind login, which can also be changed from the web interface.
The system is practical, functional and helps gardening in regular irrigation.
If you are interested in more info about the project: https://arduino.php5.sk/ovladanie-zavlahy.php

Really cool project. I've just graduated from my horticulture studies and now I'm looking into Arduino and greenhouse automation possibilities. This is really inspiring!

Great :slight_smile: Try it and then you can admire yourself there hehe
I wish u a lot of success