Professional Documents
Culture Documents
Raspberry Impianto Irrigazione
Raspberry Impianto Irrigazione
Raspberry Impianto Irrigazione
MakerSpace
Water your plants with a Raspberry Pi
Watering Pi
With a Pi Zero and a few components, you can build an
inexpensive and reliable automatic watering system for
your plants in next to no time. By Swen Hopfe
W
hether in an apartment, on Design
a balcony, in a green- Automatic irrigation is nothing new.
house, or in a garden, if These systems not only exist on a large
you are not at home and scale in agriculture and horticulture but
want to water your plants remotely, an have also been available for many years
automated system is your only option. for domestic use. Some providers attach
In this article, I show you how to har- their systems directly to the water sup-
ness the power of a Raspberry Pi Zero ply. In this project, I’ll instead draw
as a reliable helper to manage the wa- water from a 200-liter tank reservoir
tering system. with a supply that will last for a couple
of dry days (Figure 1). The advantage of
a tank is that you do not have to deal
with a pressure line and you do not lose
an uncontrolled amount of water in the
event of an accident. The aim is to create
a robust solution that you can tailor en-
tirely to your own needs, thanks to the
flexibility of the Raspberry Pi and your
own hardware and software.
The storage tank for just a room can
be much smaller; in fact, a water bucket
is all you need, with a submersible
pump and a riser to deliver the irrigation
water. Two pipes supply water to plants
through a branch distributor. The whole
thing can be controlled on demand by
Lead Image © agor2012, 123RF.com
Getting Started
Figure 1: The control unit and supply line assembled on the 200-liter To get the Raspberry Pi up and running,
storage tank. it’s a good idea to download a new Pi
Structure
The main electronics of the control sys-
tem will live in a ready-made housing
with a rubber seal in the lid and a ter-
minal strip, on which all the external
wires will be patched (Figure 2). Two
small support plates are bolted on in- Figure 2: Installing the hardware in the waterproof housing of the
side to fasten all the modules securely. control unit.
The housing for the control unit holds
the Raspberry Pi, an analog-to-digital
converter (ADC) module, and three re-
lays. The external power supply, con-
nections for two soil moisture sensors,
two solenoid valves, and the pump are
routed in from below with three four-
core lines. At the top, where I sealed
the unused screw hole with transparent
material, an LED indicates operational
readiness.
The Raspberry Pi needs a total of
four GPIO pins for the control PINs on
the relay boards and the signal LED;
the ADC is connected over the I2C bus.
The internal terminal strip routes the
converter’s analog inputs with the hu-
midity sensors and the switching out-
puts of the relays for the pump and so-
lenoid valves to the outside. The sche-
matic (Figure 3) and associated Figure 3: Project schematic.
Control
If you look at commercial irrigation sys-
tems, they often seem relatively compli-
cated to operate. In contrast, I want this
system to be as simple as possible, so
the DIY system remains manageable and
works safely during periods of absence
from home. That said, the automatic wa-
tering system does have one special trick
up its sleeve: It can extend the watering
time to achieve a certain level of mois-
ture in the soil with the use of sensors
that provide appropriate feedback from
two different plant locations.
Capacitive sensors were chosen be-
cause they are less susceptible to corro-
Figure 4: Shorter paths: the simple connection layout for the water supply. sion than resistive sensors. Although I
am talking about models with analog
condition. Distribution downstream can output, they can be connected quite eas-
be done with a smaller hose diameter; T- ily to the Raspberry Pi in the control cen-
pieces are used for more branches. Small ter through the ADC. To determine the
regulators ensure that water reaches all various limits up front, I immersed the
the plant locations evenly; setting them sensors in water in a test (Figure 5) and
up requires some trial and error. For an then put them in moist soil. The ADC in
initial test, I first extended the connec- this setup is an ADS1115, which is ad-
tion on the centrifugal pump to allow dressed in Python 3 with a library by
immersion. Adafruit. The easiest way to install it is
If everything works satisfactorily, you to use the command:
can then proceed to trim hoses and ca-
bles to the required lengths, route them pip3 install Adafruit_ADS1x15
Table 1: Web Interface Functions secure the remote control website with
Name Function a login.
Activate Enable watering timer (default: on).
Off Disable timer. System remains switched on.
Conclusions
Water
The plant watering system does exactly
Immediate water delivery for 10 seconds through both lines.
what it’s supposed to do, in a positive
Restart Reboots the system. The web interface is active again after restarting
way. I ran it at home in sunny weather
the Raspberry Pi.
during the last few days of summer, and
Shutdown Shut down the Raspberry Pi. A manual off-on cycle is then required.
checking it for functionality was no
problem (Figure 7).
designed a web interface that also works The system will star as my vacation
on cell phones. Without the benefit of a stand-in next year. Trying to supply the
vendor-operated cloud, the Raspberry Pi, whole garden would probably be over-
including the HTTP server, needs to be shooting the mark, but if you are looking
accessible over a static IP address on the to rescue your most important plants in
Internet. a limited area (e.g., a greenhouse, con-
However, I went for a simpler variant servatory, or living room), this controller
and located the user interface (Figure 6) can be a real helper. � � �
in a PHP file in my own web space. After
calling the URL, the interface sends pre- Info
defined commands to the watering sys- [1] Project on GitHub:
tem at the push of a button. Currently, https://github.com/swenae/watering
the five actions in Table 1 are imple- [2] English version of code and image
mented. The Raspberry Pi queries the files: https://linuxnewmedia.thegood.
corresponding commands in the control cloud/s/5Rzx9tQW2FJ6N3Z
script at short intervals and triggers the [3] Electronics projects by Christian Grieger:
matching actions if needed. https://elektro.turanis.de (in German)
The basis for the implementation is a
development by Christian Grieger [3]. Author
The advantage of his method is that it Swen Hopfe works for a medium-sized
does not require elaborate arrange- company with a focus on smart cards and
ments such as dynamic DNS. The dis- near-field communication (NFC). When he
advantage is that feedback arrives with is not taking photos, in the great outdoors,
a bit of a delay; however, this delay is or in his garden, he focuses on topics such
not likely to be of much importance, al- as the Raspberry Pi, Internet of Things,
though you will definitely want to and home automation.
Figure 7: The water outlet and the sensor spike in the plant bed.