Simplify the irrigation of plants and gardens (part 1)

7 minutes of reading
  • Domotise an (elementary) irrigation system
  • Difficulty level: medium
  • Cost: did
  • Software configuration
  • Hardware changes
  • Riprofirmware grammation (optional)
  • Use of proMQTT tocollo (optional)
  • Software use Node-RED (Optional)

All environments

Notes and disclaimer
  • qualsiasi modifica all'impianto elettrico dev'essere progettata ed effettuata da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.
revision projet: 1.2


Along with the warm season comes the need to irrigate dailynameMarketplace lawns, gardens, plants to ensure their survival and well-being. Especially during well-earned vacation periods, this responsibility can rappresentare a concern not just, especially when there are plants that require particular care in terms of the percentage of humidity in the soil in which they are housed. There are literally solutions on the market Of every kind: passive drips, hyper-technological control units, more or less advanced solenoid valves, not to mention the water distribution systems (pipes, joints, valves, etc.).

Even at this juncture home automation offers us possibilities to perfect the tools we have available.

In fact, we assume that during our absence, days of atmospheric disturbance occur that cause rain. It goes without saying that a simple one prodaily grammage that I irrigate our lawn for half an hour would be useless as well as not eco-sustainable: we would go to waste water vacuuming a lawn already abundantly wet from the rains. We could even get to cause proproblems, perhaps by watering plants that need little water.

Solutions they are basically two: adopt intelligent devices such as prosee for yourself the irrigation administration (for example Eve Water, or even more advanced actuators, such as the Gardena Smart Water Control) or domotize a simple and inexpensive solenoid valve (suitable for irrigation, therefore with pressure reducer and connectable to the water distribution elements) through ordinary instruments.

This projet describes how to adopt the second way described above. In fact, we will succeed to domotize a simple one battery operated irrigation solenoid valve via an actuator Sonoff 4ch PRO (or similar actuators, for example the Sonoff Dual modified with clean contact or two Sonoff Basic modified to clean contact). Alternatively could be used the approdescribed here (common solenoid valve + actuator); the present projet chooses the garden solenoid valve for the advantages induced by the presence of the pressure reducer, the standard connection for flexible pipes, the very nature of an external device, etc.

Il procast articulates:

  • in this one page, if if he decides to use "simply" theapp eWeLink to control irrigation planning / activation;
  • in this page + a specific page for 'HUB of reference (Home Assistant, Homebridge etc.), if you decide to manage activation / deactivation and planning in a much more structured way (through automations that assess environmental, meteorological, presence parameters etc.)

Both approcci present a first part of projoint casting (the physical connection between the actuator Sonoff and the solenoid valve) and then specific parts based on the chosen objective.

Nb A mention to the admirable projet piGarden it is a must: it is a DIY solution that allows you to create a real e profirst irrigation system (much more structured and complex than it is) proplaced in the present procast) starting from a unit Raspberry Pi. Every approelucidation is available here.

It starts


Regardless of the type of road that will be pursued (check via eWeLink or personale HUB), is assumed that the user has:

Logic of projet

The battery solenoid valve chosen for this prodidactic jet is the Claber AQUAUNO Practical, one of the simplest, cheapest but functional available on the market. This element is positioned downstream of a common faucet and, by connecting an irrigation pipe system to it (also with drip system, for vases) it allows to irrigate both automatically (pre-setting the duration) and manual.

The solenoid valve is equipped of two buttons: green, useful to start irrigation, red to interrupt it. We will therefore exploit this simple architecture attesting to the two clean contacts of the selected actuator (In short: two electromechanical switches with connection Wi-Fi) to the contacts of the two buttons in order to activate its functions through home automation (whether it is declined through app eWeLink o personale HUB).

In practice, we will ensure that the chosen actuator (the Sonoff 4Ch PRO) replace our fingers when pressing (ideally) the two solenoid valve buttons - thus activating / deactivating irrigation. Being the Sonoff of a home automation actuator, this will allow us to manage the irrigation in pie modenamehome automation system.

Nb As is obvious, any modification to the original scheme of the solenoid valve will cause the cancellation of the guarantee of the same.

Claber AQUAUNO Practical - Full
The Claver AQUAUNO Pratico manual / automatic irrigation unit.

We open the solenoid valve

Opening the solenoid valve (factory-set for replacing the 9v battery that powers it) is quite simple: just press on both sides and pull the orange body of the front:

Claber AQUAUNO Practical

As can be seen from the diagram, unity it's really simple: two poles of the battery carry the voltage to the electronics (encapsulated inside the orange plastic block), while two output poles from the orange socket carry voltage (when irrigation is activated) to the solenoid valve (pair of left poles) .

On the frontinstead, four screws hide the electronics, which is separated from the external weather by a simple but effective one rubber gasket:

Claver AQUAUNO Practical - disassembled


What you need to do it's acting on the contacts of the two switches usually operated by external buttons (green and red): it will be sufficient to weld two pairs of contacts to the welding of the two buttons on the board and certifying the ends to the NO (normally open) contacts of the selected clean contact actuator, or the Sonoff 4ch PRO.

Contacts to be welded solenoid valve

Nb Obviously it will also be necessary to make a hole on the board (with a drill, in a point where there are no tracks or electronics) to pass the cables on the back, as well as on the rear of the outer shell to let the same come out so as to send them to the Sonoff.
It is advisable to insulate the whole with silicone to avoid moisture contamination towards the electronics.
As for the Sonoffinstead, it is advisable to close it inside of a watertight box.

ITEAD Sonoff 4ch PRO - clean contacts CH1 and CH2

To conclude the change will then be necessary change the default behavior of the channels of the Sonoff on which we have certified the contact pairs. What we want, in fact, is that at the activation of the two channels the poles on them are "closed" for a short period of time (say for a second), exactly as happens with the use of a button. To do this we will directly exploit a specific technical characteristic of the Sonoff 4ch PRO.

Il Sonoff 4ch PRO presents on the back of the propria board (it is necessary to temporarily free it of the profirst shell protive) a series of DIP switch which, based on their position, allow you to adjust upstream the expected behavior of the actuator and its channels:

ITEAD Sonoff 4Ch PRO R2 - DIP Switch

To adjust the actuator so that:

  • the two channels CH1 and CH2 behave exploiting the inching, that is to say they activate the profirst relay then deactivated automatically after a given period of time;
  • to ensure that this time frame corresponds to a second.

According to the scheme probefore Sonoff 4Ch PRO:

ITEAD Sonoff 4Ch PRO R2 - DIP Switch - Scheme

it will therefore be necessary to set the DIP switches as follows:

ITEAD Sonoff 4Ch PRO R2 - DIP Switch - Inching CH1-CH2 - 1 sec

ATTENZIONE: Remember that to use the Sonoff 4ch PRO as a clean contact actuator, it is necessary to supply it with direct current between 5 and 24 volts. Powering the unit with an AC mains supply to 220v will cause the certain break solenoid valve, if not by the Sonoff same. Pay close attention.


Completed the hardware modification to the solenoid valve and completed the wiring, in fact we will have made home automation this simple but versatile garden actuator. Activating the channel 1 (CH1) of the Sonoff, the solenoid valve will react as if we had pressed the green button (which starts irrigation), while activating the 2 channel (CH2), it will react on the basis of the behavior linked to the red button (ie interruption of irrigation).

Let us always remember that, having activated the inching for the two channels, the behavior in relation to the activation ("ON") of a channel will correspond always to its activation for only one second, after which it will automatically return to "OFF" (thus simulating the manual pressure of the corresponding button).

Notice how the change prohowever, the ordinary behavior of the solenoid valve, which can be at the same time, does not vary is controlled by the Sonoff and using the factory-set buttons (green and red). Obviously the activation through physical buttons will not be detected, in terms of "status", by the Sonoff


with eWeLink

In case of Sonoff used was not applicata a firmware change, the use that will be made will be "only" that of activating / deactivating irrigation manually or planned over time.

Once proseen at pairing with the proman applished here eWeLink (you can do it before or after the proconnection to the solenoid valve is not important), theapp rappwill re-establish the actuator with the four keys, riproof the four channels (we will only be interested in the CH1 and CH2) as well as, below, the dedicated "Schedule" item appat the timing:

Sonoff 4Ch PRO - eWeLink

Pressing on CH1 o CH2 si prowill therefore see to irrigation or suspension thereof. As explained, configuring in ap modeproOnce the DIP switches of the unit are pressed, the pressure on one of the two channels will switch on lasting only one second, as appgrease is used to "believe" the electrovalve electronics that it is manual pressure on one of the two buttons (green and red).

By clicking on "Schedule", Instead, you will have access to the menu part that allows you to plan the switching on of the individual channels, and then irrigation. Obviously to plan an irrigation of ten minutes duration it will be necessary to set the CH2 timer to + 10 minutes with respect to the CH1 start-up time:

With HUB personal

While with eWeLink it is possible prosee only when the irrigation is turned on / off in manual and automatic mode (timed), through riprofirmware grammation (for example with firmware Tasmota) the Sonoff can be integrated to proprio personale HUB, opening to a whole series of additional possibilities, for example planning the irrigation not only with respect to a specific time, but also to the humidity of the soil / soil, to the fact that it has rained and much more.

The integration in this sense is explained in the "2 part" of the present projet:

ITEAD Sonoff BasicATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Sonoff (and more generally to devices ESP8266), for any doubt, question, information on the specific merit of these components.

Please comment below