Irrighino is a complete watering system, based on Arduino Yun.
The main features are:
- a configurable number of solenoid valves
- an AJAX web interface
- a weekly schedule
- manual activation / deactivation
Here’s a short video that describes the project:
How it works
An Arduino Yun – the “brain” of irrighino – is connected to the switch panel (with phsical switches and status leds), the rain sensor and the relay board that controls the solenoid valves. Yun is also connected to the home wifi network: a device (PC, smartphone…) connected to the same network can open the irrighino webinterface and configure and control it.
If you have an Internet connection, with the correct NAT (Network Address Translation) settings you can also manage your watering system from a remote location!
The irrighino web interface is available at the following URL: http://<yun-ip-address>/sd/irrighino
The interface is divided in 3 tabs:
- runtime, where you can manually control the system
- setup, where you can configure the scheduling
- events, where you can read the event log (activation, configuration changes…)
Runtime tab, you can manually control each valve
Setup tab, you can define the weekly schedule
Events tab, you can read all the events
I connected the different elements (switches, leds, relays…) to Arduino using a prototype shield:
I used 3 position switches (on / off / auto) and I read the switch status using an analog PIN as explained in this my tutorial.
LEDs are connected to digital PINs through 1k ohm resistors, while the relay board (that I got from this store) can be connected directly to the PINs because it carries all the required components (transistors…) to drive the relays.
I drilled holes in the front panel for all the LEDs and the switches and connected them to the shield:
I put the Yun in a plastic enclosure for DIN rails (6 units). When closed, I noticed that the wifi signal strength was very poor… I therefore decided to add an USB wifi adapter with an external antenna, as explained in this my tutorial. I mounted the antenna outside the enclosure and connected it to the adapter with an RP SMA male to female cable brought on eBay:
The relay module has been mounted on a dedicated box:
The power is supplied by two transformers, one with a voltage of 5V (for the electronic circuitry) and one with a voltage of 24V (for the solenoid valves). The two trasformers and the main switch are located in a different DIN rail enclosure. Here’s also a shot about the final installation:
The watering system is divided into zones, each one connected to a solenoid valve.
I put the valves in cockpits. Each valve is connected to a relay, that supplies the correct power (24v) when activated:
The rain sensor is no more than a switch controlled by a spongy material. When this material absorbs the rain, it begins to expand up and triggers the switch. So you can read its status connecting it to an Arduino digital PIN (in my sketch I used the internal pullup resistor):
#define RAIN_SENSOR 8 [...] pinMode(RAIN_SENSOR, INPUT_PULLUP);
The software that runs irrighino is divided in 3 elements:
- the backend subsystem, based on PHP and SQLite
- the sketch, running on the ATMega that controls valves and LEDs and read the status of sensors and switches
Thanks to a configuration file (include.php) you can customize the number of outputs, their name and color…: