In the past, we have tried more traditional options, with varying levels of success. I attached the PVC pipe to the balcony using zip ties. If you connect a power source and a load in series to these pins, the circuit is complete and the load would get power. ... Now plug in all power sources (and make sure your Raspberry Pi is running some version of an operating system, like this one here). All this while, one thing had me worried: all these electronics in a cheap plastic box could be a recipe for fire. This requires the RPi.GPIO python library which can be installed on your Raspberry Pi as follows: With that installed, you should be able to use the water.py script found. Perhaps a deterrent cause is the time spent on plant care. Not that the device could do much if there was a power outage, but I still wanted it to have backup power at least for the Raspberry Pi. This is how the relay controls the activation of the pump. I have numbered them 1-3 in the image below for easy identification: The symbol denoted by K1 to the right of these pins explains how the internal circuitry is wired up in the relay. There can be innumerable ways to solve a problem. The cooling fan is a typical 12v PC cooling fan running on 5v. The first thing I did was make my 5V power supply from a usb cable. So I decided to hook up a generic extension board to it. In this post, I will show you how to build an automated irrigation system using a Raspberry PI. Make sure you have python v3 installed. The plan was to use the PI’s GPIO pins to drive a relay board which in turn could control the Pump. Notice, that the ground line of the mains supply connects to the relay module before reaching the water pump. (Generic USB plugs set –, A container that can hold enough water. One file controls all the GPIO and circuit logic, and the other runs a local web server. Now plug in all power sources (and make sure your Raspberry Pi is running some version of an operating system, like this one. You will need to install flask, and psutil as follows: $> python3.4 -m pip install flask $> python3.4 -m pip install psutil. Get a free Raspberry Pi … This was mostly driven by my fear of the SD card failing due to repeated reboots. Relay - Plug the positive lead from pin 7 to IN1 on the Relay Board. Now let's start with the code for controlling the GPIO. This article was written by Rob Zwetsloot and first appeared in The MagPi 86. When buying a relay module, make sure to read the description to find if the relay is suitable for direct connection to a logic circuit such as Raspberry PI / Arduino. We have about 10 large potted plants and 5 small ones. I cut the pipes to size using a handsaw and drilled the holes required for drip pipes. You can find the code and more details on how it works in this GitHub repository GardenPI. The circuit between the two pins is completed when the relay is activated, and the pump turns on. This article was written by Rob Zwetsloot and first appeared in The MagPi 86. If you have any questions, let me know in the comments below. Enter your email address to subscribe and receive notifications of new posts. If so, you're off to the races. An automatic plant watering system is a project that's been on my back burner for years. I soldered some sturdier wires to this, and plugged it into a wall adapter. Now, pin 2 and 3 make up an active high circuit. If this post helped you, please share. Note that not all relays follow the same convention, so, before wiring anything up, take a look at its description and the switching diagram. Most relay modules being sold on Amazon / AliExpress nowadays are. You don’t see one in the above diagram because this relay module has one built-in. Finally, I was able to test the complete set up for 2 days before leaving and it worked flawlessly.