loading

Every spring my wife gets really ambitious and plants a big vegetable garden. As the summer drags on, ambition turns to laziness and unfortunately many of the plants die a slow, withering death from neglect due to lack of weeding and watering (except for the tomato plants, which grow like mutants in our climate even if you neglect them...so every August we wind up with 10,000 tomatoes and no other vegetables).

While I can't automate some maintenance tasks like weeding*, I can certainly automate the watering and I figure that will give our poor plants a better chance at survival. You can buy all sorts of fancy programmable hose, irrigation, and water timers (not sure about the difference between those three terms, but that's how Lowe's has them listed) if you want to automatically water your garden. But, in the true spirit of Instructables...where's the fun in buying one when you could build it yourself? Enter the Raspberry Pi-Controlled Irrigation System. A quick search on Instructables shows that I'm not the first one to do this, but I think my project will take a unique approach. I really didn't want to deal with calibrating or cleaning a soil moisture sensor. I also don't care about being super picky about maintaining an optimal soil moisture level. The bar is set pretty low here - I just want to keep the plants alive. If we're watering the plants by hand, we roughly follow a rule of "Did it rain yesterday? If not, water the plants." So, why not automate that with a Raspberry Pi? Use a weather API to answer "did it rain yesterday?" and then the GPIO pins to control a solenoid valve to water the garden. That's what this Instructable will show you how to do, including the electronics, programming, and plumbing. The advantage of this approach is that it's flexible and easy to expand - for example, if I want to decide how long to water based on how much it rained, water based on the future forecast, or water in multiple short intervals throughout the day, that just requires changing a few lines of code.

Please note that this is not a "how to use a Raspberry Pi" Instructable. If this is your very first time using a Raspberry Pi, there are a TON of getting started with Raspberry Pi projects out there - please check those out first if you need answers to things like "how do I install the OS?" or "what type of power supply do I need?"

Ready to get started? Move on to the next step for a full materials list!

*Consider that a challenge. Someone needs to do a computer vision/robotics project that uses a camera to identify weeds and a robotic arm to remove them.

Note on contest entries:

  • Sensors Contest: "If it’s got an input and an output, it’s fair game." - I hope that means the Weather Underground API counts as a sensor, even though I'm not using my own local rainfall sensor.
  • Urban Farming Contest: OK, so I'm not exactly doing this on the rooftop of an apartment building, but you should be able to do this project regardless of your location (and this project is sort of a DIY version of the grand prize of that contest anyway)
  • Home Hacks Contest: I certainly hope this is making a regular household task faster and easier, so this one seems like a good fit!

Step 1: Materials

I got most of the parts for this project at SparkFun, Jameco, and Lowe's. I'll do my best to link the exact parts I used, but you can make reasonable substitutions and it should still work (e.g. you could use a different model Raspberry Pi, or you could do the whole thing with 1" PVC pipe instead of 3/4", provided you get all the right adapters). Note that the exact quantity of piping and types of adapters you need will depend on things like the size of your garden and whether you also want to have a regular hose connected, so you will need to take some measurements and plan your layout before you make a trip to the hardware store (see next step).

Update: thanks to many people on Reddit, Hackaday, and in the comments here for feedback on the electronics and plumbing. The biggest point seems to be that my original circuit was missing a flyback diode across the relay coil, so I've updated the instructions to include that. I've received other comments about including a current-limiting resistor on the RPi's GPIO pin, a pull-down resistor on the MOSFET gate, an RC snubber in parallel with the solenoid valve, and to use poly tubing instead of PVC, but I'll leave those changes up to the individual. If you have questions or advice on any of those points, please leave a comment.

Electronics

  • Raspberry Pi 3. Used because it has built-in WiFi, but you could do this with an earlier model.
  • 5.25V, 2.4A micro-USB power supply. Recommended for the RPi3, older models do not require as much current.
  • Micro SD card with adapter. 8GB recommended, newer versions of Raspbian Jessie don't seem to fit on 4GB cards (unless you plan to install the lite version and only run headless).
  • Relay. I debated using a solid-state AC relay, but this mechanical relay is rated for 100,000 operations at max electrical load - we are well below that limit if you're only watering a couple times a day.
  • N-channel MOSFET. Required because the RPi's GPIO pins cannot drive the relay coil directly.
  • 2-pin screw terminals (2)
  • Protoboard or breadboard of your choice
  • Green LED (3), used as status indicators
  • Rectifier diode
  • Male/female jumper wires, for connecting to Raspberry Pi GPIO pins
  • 22 AWG solid hookup wire, for making connections on protoboard
  • Female header pins
  • 220 ohm resistor (3)
  • 20 AWG stranded hookup wire, for connecting solenoid valve (note that you may need thicker wire if you need to run the wires really far, consult a chart like this to determine what you need)
  • 24 VAC 1500mA AC to AC wall adapter. Important: make sure the rating of this adapter matches the requirements of the solenoid valve you purchase! (some valves are DC)
  • Optional: monitor for Raspberry Pi. I found a monitor useful for setup and debugging, but once it's working you should be able to run the RPi headless (without a monitor). See instructions for connecting to the RPi remotely via VNC or SSH if you do not have a monitor.
  • Project box (small cardboard box or plastic container)

Plumbing (note: NPT = National Pipe Thread, MHT/FHT = Male/Female Hose Thread)

Tools

  • Hacksaw or miter saw to cut PVC pipe
  • Shovel, hoe, or trenching spade etc. to dig trenches for pipe
  • Wire strippers
  • Soldering iron

    Step 2: System Diagram and Planning

    Confused about how all those parts fit together after reading the materials list? Here's an exploded diagram of the entire plumbing system (more details on the electronics in a later step). The exact dimensions and orientations will depend on the layout of your garden and relative location of the hose faucet. You should definitely plan your layout in advance and do a "dry run" (cut straight pieces to length, lay out all the pieces of piping in their approximate locations to make sure they'll fit). Mistakes in this project can be hard to undo - you don't want to start haphazardly digging holes in your yard and cementing pieces of pipe together only to find out halfway through that things don't fit together right.

    A couple important notes:

    • Pay attention to the difference between NPT (national pipe thread) and MHT (male hose thread) adapters. They look similar at first glance, but the threads aren't compatible. NPT adapters are used to connect to the solenoid valve and PVC union. MHT adapters are used to connect to the hose faucet and soaker hoses.
    • The entire section in the dotted red box (between the faucet and the PVC union) can be disconnected and brought inside during the winter. This prevents any damage to the solenoid valve if leftover water inside it freezes. I believe the standard approach is just to bury the valve below the frost line, but I wanted easy access to the valve in case something went wrong (this being my first attempt at a DIY irrigation system) or I wanted to make changes to the future. If you just want the valve permanently installed, you can get away without the union and quick connector.
    • Make sure you install a drain valve at the lowest point in the system! Again, this is so you can drain out all the water and prevent damage from water freezing in the pipes over the winter. I forgot to do this at first so had to dig up and cut a section of pipe to add a T-connector for the drain.
    • "Call before you dig" - you might have seen this phrase on little flags or utility boxes around your neighborhood. If there are any underground utility lines (gas, electric, water etc.) in your yard, make sure you know where they are and avoid them. If in doubt, call the utility company to be safe and they will mark the lines for you.
    • I recommend using an indoor outlet for the 24VAC adapter, as it is not rated for outdoor use. I ran the wires through a window. If you must use an outdoor outlet, make sure to use an appropriate weather-rated adapter.

    Step 3: Dig Trenches

    Dig trenches where you'll need sections of underground pipe. Note that there is probably some rule of thumb about how deep these trenches should be, and I didn't follow it. My trenches are only a few inches deep, just enough to bury the pipes and cover them with some soil. If that's a terrible idea, please let me know in the comments and I'll update this step.

    Update: someone already pointed out that you risk cracking the pipes when you step on them if they're not buried deep enough. So, bury your pipes deeper than pictured here.

    Step 4: Lay Pipe

    Follow the instructions on the PVC primer/cement to lay out the sections of pipe and various slip connectors. These sections should be terminated with slip-MHT adapters and quick connectors for the soaker hoses (refer back to diagram in step 2). Don't forget the drain valve!

    Step 5: Put Solenoid Valve in Plastic Box

    • Screw NPT-slip adapters into both ends of the solenoid valve.
    • Drill two 1" holes opposite each other in the sides of your plastic box (note that 3/4" PVC pipe refers to the inner diameter, the outer diameter is 1").
    • Push straight segments of PVC pipe through the holes and connect them to the slip adapters inside the box. Remember to use PVC primer/cement to seal the joints.
    • Use silicone adhesive to seal around the perimeter of the holes you drilled.
    • Important: drill a few small drain holes in the bottom of the box. I found out this was necessary when I realized I had a few small leaks because I didn't tighten the adapters enough.

    Step 6: Connect Solenoid Valve to Rest of System

    This is the most complicated plumbing step in terms of adapters and valves. Each part is labeled in the photo above (I disconnected the valve from the rest of the system so I could get a clear photo), but you can also refer back to the diagram in step 2. It might be easier to assemble this segment inside or on a workbench, then take it outside to connect it.

    Important: Make sure you get the flow direction of the check valve correct! The valve has an arrow on it that indicates flow direction. This arrow should point towards the solenoid valve (to the right in the photo above). A check-valve is a one-way valve that will prevent dirty water from flowing backwards into your house, if for some reason the pipes in your house lose pressure. I'm not 100% sure if this is necessary (I've never seen a check valve installed on a regular garden hose, which can have dirty water sitting in it), but after some Googling about sprinkler systems, I figured better safe than sorry.

    Step 7: Attach Solenoid Valve Wires

    • Cut two segments of stranded 20 AWG hookup wire (length depends on how far you need to run the wires into your house).
    • Drill small holes in the sides of the plastic box and thread the wires through.
    • Connect them to the solenoid valve wires with waterproof wire connectors.
    • Use silicone to seal around the holes.
    • Run the wires into your house to wherever you plan on having the Raspberry Pi set up. I poked a tiny hole in a screen and threaded them in through a window. You will connect these wires to your circuit in the next step.

    Step 8: Check for Leaks!

    Before you go any farther, you probably want to check your plumbing for leaks. Luckily you can do this before you even make the circuit or hook up the Raspberry Pi. Take the two solenoid valve wires you just ran inside, and twist them directly to the two wires from the 24VAC adapter (note: if your adapter ends in a barrel plug, cut it off then separate and strip the wires). This will open the valve and water should flow through your pipes. If you can't hear water flowing, check that you've opened any other necessary valves, like the hose faucet and internal shutoff for the pipe.

    Hopefully you don't have any leaks at your cemented joints, or you might have to cut the pipe and re-do the joints. I had a few leaks at threaded joints, particularly the union, that required tightening. Note that you can tolerate slow leaks downstream of the solenoid valve, because those areas will only be pressurized when the valve is open. However, you really do not want leaks upstream of the solenoid valve (between the hose faucet and solenoid valve), because those will be pressurized all the time and will leak continuously.

    Finally: I'm not sure if I'm violating some rule about mixing plastic and metal threads, and if that could contribute to leaks. I didn't have much of a choice because I had to get from a metal hose faucet to plastic PVC somehow. If you have any input on that point, please leave a comment.

    Step 9: Circuit

    The images above show a breadboard diagram and schematic of the circuit. This should be clear to assemble based on the diagrams, but leave a comment if you have questions. I recommend testing everything on a solderless breadboard (see next step) before you finalize the circuit on protoboard.

    Here's how it works:

    • A relay controls the 24VAC power to the solenoid valve.
    • The relay coil requires 5V and the Raspberry Pi's GPIO pins are only 3.3V. So, the Raspberry Pi drives a MOSFET which turns the relay coil on and off, which then turns the solenoid valve on and off. By default, when the GPIO pin is low, the relay is open so the valve is closed (water does not flow). When the GPIO pin goes high, the relay closes, and the valve will open (water will flow).
    • I added a couple status LEDs to use as indicators. One is connected directly to the RPi's 3.3V supply, so you know your circuit is getting power. Another will be turned on when the solenoid valve is open, and the third is in there just in case I think of something else to use it for.

    Note that Fritzing did not have a relay that matches the pinout of this SparkFun part. I was too lazy to make a new Fritzing part so I just edited the breadboard diagram in Inkscape, which is why the relay and wires connected to it look a little different. If you feel like making a new Fritzing part (which SparkFun has a tutorial on), let me know and I can update the Fritzing file.

    Also note that I forgot to include a flyback diode across the relay coil initially, so it isn't shown in the picture (but I did update the Fritzing diagrams).

    Finally, not a bad idea to put everything in a project box once you've finished the circuit board. A SparkFun box with some holes poked in the sides for the wires works nicely.

    Step 10: Testing Circuit

    Before you go for full-blown automation, it's a good idea to test the circuit manually. You can do this by using the command line in Python. Please remember that I am assuming you have basic knowledge of how to use a Raspberry Pi at this point. If you find yourself asking questions like "how do I install the operating system?" or "how do I launch Python?", you should check out the many Instructables on getting started with Raspberry Pi or the Raspberry Pi Foundation's official learning resources before you continue.

    To test your circuit, power up your Raspberry Pi (the top LED on your circuit board should light up since it is connected directly to the 3.3V supply), then open Python and enter the following commands:

    import RPi.GPIO as GPIO
    GPIO.setmode(GPOI.BCM)
    GPIO.setup(17,out)
    GPIO.setup(27,out)
    GPIO.setup(22,out)
    

    This initializes the GPIO pin controls and sets pins 17, 27, and 22 as outputs. Now type

    GPIO.output(27,GPIO.HIGH) 
    GPIO.output(22,GPIO.HIGH)

    This should turn on the other two status LEDs. You know things are working so far. Now for the big test (drumroll). Type

    GPIO.output(17,GPIO.HIGH)

    You should hear a "click" as the relay switches position. Go outside and check your solenoid valve. It should be open and water should be flowing. Assuming you checked for and fixed any leaks previously, this means everything is working! Now, go back inside and type

    GPIO.output(17,GPIO.LOW)

    You should hear another "click" from the relay. This turns the valve off. Go back outside and check that the water has stopped.

    Great so far...but you don't want to have to type a bunch of commands every time you want to water your plants. Now it's time to automate the whole thing!

    Warning: do not use GPIO.cleanup(). Through a few hours of irritating troubleshooting, I found that this command (for reasons I still don't fully understand) causes the relay to turn on again, opening the valve. The best explanation I can find came from this Stackexchange thread where a comment states that "The cleanup method sets all the gpios you have used to be inputs and disables the internal pull-ups/downs for those gpios." You need the pin to stay as an output with a low voltage to keep the relay off, so that could cause the problem. I tried adding a 10K pull-down resistor to the MOSFET gate but that didn't work. So, even though it's generally recommended as good practice, I'd avoid using GPIO.cleanup() for this project. Please leave a comment if you have a solution here.

    Step 11: Code

    Now that you have a working circuit and plumbing system, you will install code on your Raspberry Pi that automatically checks the past 24 hours' rainfall and decides whether or not to open the solenoid valve. Then you'll have a hands-free watering experience!

    Credit for the code for this project goes to my friend Mark Veillette. The files and installation instructions are available on his github page: https://github.com/markveillette/rpi_sprinkler. The code is pretty well-commented but here's a general explanation of how it works:

    • run_sprinkler.py is the main file that checks a weather API for the past 24 hours' rainfall, decides whether or not to open the solenoid valve based on the rainfall amount, controls the GPIO pins, and writes the resulting actions to a log file.
    • config is a configuration file where you enter your Weather Underground API key, your city/state, the GPIO pins used by the circuit, and the rain threshold (in inches) for running the irrigation system.
    • run.crontab is a scheduling file where you set when run_sprinkler.py will run, using Cron, a Linux job scheduler. This has the advantage of only running the Python code briefly at certain times of day, rather than leaving a Python script running in an infinite loop 24 hours a day and constantly checking the time (like I did in my Christmast light timer project...whoops). By default it is set to run twice a day at 6am and 6pm, but this is highly customizable. For example, you could set it to only run every Tuesday and Thursday, or only on odd days of the month.

    To get it running, follow the download and installation instructions on Mark's Github page. Be sure to go through the recommended testing commands to make sure everything is working smoothly. Then, let it run for 24 hours, come back to check the log file, and make sure the results are consistent with weather you actually observed (in other words, if it didn't rain, it should have turned on the sprinkler and the log file will say that). If you have any trouble getting the code to run, please post a comment along with any error messages you received and I'll do my best to help out.

    (Note that Mark decided to call it a "sprinkler" - that's more compact than "irrigation system," so whatever. They refer to the same thing.)

    Step 12: Grow!

    Make sure you monitor the entire system for a few days to confirm that it's running smoothly. Check the plumbing for leaks and check the log file to make sure the program's actions are consistent with the weather you observe. Most importantly, check the health of your plants! You don't want to over or under-water, so adjust the timing and duration of the watering in the run.crontab and config files as needed (see the Github page for instructions on making changes to the files). This is where some actual gardening know-how would come in handy, because I'm doing the timing by trial and error - any suggestions for typical watering times using soaker hoses for a vegetable garden in the Northeast would be appreciated.

    Any other questions or suggestions? Don't hesitate to leave a comment - thanks for reading!

    Hi man! Thanks for the DIY! I guess the cost will be cheaper than a dedicated irrigation controller system. The raspberry $40 + the components let's say +$30. An industrial 4 sectors controller can easily cost more than $100 (just the controller). And with this you have... 25 gpio pins or so... Thanks again man! About the benefits of controll the water system with your phone... We can control Raspi with our phone or, I guess we still can add another parallel control, internet switches, humidity sensors, light switches. I bought 6 cheap watering timers a year ago... today only 1 is still giving the fight the rest... six feet under.
    <p>Hello! thanks for the amazing project. I think I'm having an issue with code because I'm living in Canada. I feel like the API call is not calling to my city because when I look on WU, in the web address, it adds a /ca prefix, then province/state and then city. Would you point me to where/what I need to add to make it read my local weather?</p>
    <p>Hi - I had to check with Mark (the guy who wrote the code) on this one. Here's his response:</p><p>------------</p><div><br><div><br><div>So I did some digging in the api docs and I discovered that you can use a zip code in the URL instead of city/state. Modify lines 28 and 69 in rpi_sprinkler.py by replacing &quot;{state}/{town}&quot; with his zip code. For example, If his zip was <br></div><div>H3R1K2 (Montreal), lines 28 and 69 would become<br><br>Line 28: API_URL='<a href="http://api.wunderground.com/api/">http://api.wunderground.com/api/</a>{key}/conditions/q/H3R1K2.json'<br>Line 69: API_URL='<a href="http://api.wunderground.com/api/">http://api.wunderground.com/api/</a>{key}/history_{day}/q/H3R1K2.json'<br><div><br><div>If that still doesn't work tell him to post on my github.</div></div></div></div></div><div>(then he sent a follow-up email:)</div><div>Actually, a better answer I think is to set the &quot;town&quot; to be his zip code and set &quot;state&quot; to &quot;/&quot;. So the config file would read</div><div>town = H3R1K2</div><div>state = /</div><div>(or whatever his zipcode is) </div><div>Again I haven't tested this so tell him to post on github if it doesn't work.<br></div><div>------------</div>
    <p>Hi - I had to check with Mark (the guy who wrote the code) on this one. Here's his response:</p><p>------------</p><div><br><div><br><div>So I did some digging in the api docs and I discovered that you can use a zip code in the URL instead of city/state. Modify lines 28 and 69 in rpi_sprinkler.py by replacing &quot;{state}/{town}&quot; with his zip code. For example, If his zip was <br></div><div>H3R1K2 (Montreal), lines 28 and 69 would become<br><br>Line 28: API_URL='<a href="http://api.wunderground.com/api/">http://api.wunderground.com/api/</a>{key}/conditions/q/H3R1K2.json'<br>Line 69: API_URL='<a href="http://api.wunderground.com/api/">http://api.wunderground.com/api/</a>{key}/history_{day}/q/H3R1K2.json'<br><div><br><div>If that still doesn't work tell him to post on my github.</div></div></div></div></div><div>(then he sent a follow-up email:)</div><div>Actually, a better answer I think is to set the &quot;town&quot; to be his zip code and set &quot;state&quot; to &quot;/&quot;. So the config file would read</div><div>town = H3R1K2</div><div>state = /</div><div>(or whatever his zipcode is) </div><div>Again I haven't tested this so tell him to post on github if it doesn't work.<br></div><div>------------</div>
    umm, you guys do realize that poly will eventually leak, right? mainly from not being winterized properly, it will split and crack, but time alone will also have the same effect. a sprinkler system made out of either schedule 40 or 80 pvc is, hands down, the best way to go....more expensive than poly and installation is more time consuming, but it will be done right. <br>i'm not really sure what some of the comments are referring to....yes, if pvc is exposed to uv rays it will no doubt become brittle but this is a sprinkler system, the pipe doesn't stay above ground lol
    <p>you can use SIGFOX chip to do same directly in the cloud without raspberry without internet connectivity with small AA battery</p>
    <p><a href="http://www.weenat.com/offres/" rel="nofollow">http://www.weenat.com/offres/</a></p><p>some great ideas there</p>
    <p>Nice write-up! This is the sort of thing I'd like to try out in the future.</p><p>One note: White PVC tends to degrade when exposed to UV (it takes a couple of years to get real brittle). It may be a good idea to spray paint exposed plastic black to protect it.</p>
    Thanks - I've already been told that I should have used poly tubing instead and that the PVC isn't buried deep enough so that it might crack when I step on it. I thought PVC was the default choice for stuff like this but apparently I was wrong. I guess I'll see how long the PVC lasts, then maybe wind up saying &quot;screw it&quot; and just doing the whole thing with above-ground hoses and splitters. Time will tell...
    <p>Ben, this is an excellent Instructable, this will be very useful to me as I embark on a similar project. Thank you!</p>
    Thanks! There have been a lot of good suggestions in some of the comments, so definitely read through those before you start.
    <p>Yes that is exactly what I am referring to. As you mentioned in your inst if you don't bury the PVC deep enough it can be broken when walked on as in mowing the lawn or whatever. It is very flexible, tough and inexpensive. The method of joining the pipe is very straight forward. The fitting you reference and the other styles make assembling your system almost foolproof. I know since I have set up two systems in different locations!</p>
    <p>The underground piping and all of the fittings can be accomplished easier and be made more durable by using poly tubing from Lowes, Home Depot or drip irrigation supply companies like dripdepot.com or digcorp.com. Very well organized and informative instructable! </p>
    Are you referring to this stuff?<br><br>http://www.homedepot.com/p/DIG-1-2-in-0-700-O-D-x-100-ft-Poly-Drip-Tubing-B36/202306118<br><br>I'm curious since I'm not familiar with it - what's the main advantage over PVC? The description says &quot;Use with DIG 0.700 compression fittings&quot; - so is that easier than dealing with cementing all the PVC joints?
    <p><em><strong>Now you have done all of that</strong></em> --- However you plant! Hills or rows Make your weeding a thing of the past and better utilize water. In fact, you might even &quot;collect&quot; neighbors grass clippings and save a stack of newspapers (lots of them&quot;)</p><p>1. plant seeds, after germination and a little height start in one corner, spread four or more sheets of newspaper close to plant stems. DON'T TRY TO DO WHOLE GARDEN AT ONCE </p><p>2. Place four or five inches grass week clippings-- (don't worry about weeds in the mix after using lawnmower) -- on top ov news covering. </p><p>3. Place soaker-hose on top! [Of course giving whole area in late evening after you loose hot daytime sun sprinkle everything well one time!</p><p>4. OBJECT: Cover entire ground of garden.</p><p>5. This serves 3 or more purposes:</p><p>a. Every time you water it soaks through this mulch-- Every time you mow, all summer long added more clippings. Holds more water in ground.</p><p>b. Good use for clippings --- dump in garden---</p><p>c. Good walking surface when clippings get 4 or more inches thick. Like walking on plush carpeting.</p><p>d. helps fertilize too and easy to spade or tiller in next year. Looses dirt over a period of years.</p><p>e. NEVER WEED AGAIN: Easier to harvest also. Newspapers take care of growing weed -- they never see the light of day and paper is bio-degradable. <strong>DO not use colored or glossy parts of paper</strong>.</p><p>f. Water once a week [whether or not needed] as depth of clippings build up.</p><p>g. You will have fewer nasty bugs, but if you do, take a garden sprayer, fill to the water line, pour 1/4 cup liquid soap, any kind, spray down the plants This is especially great on aphids. Most of the bugs crawl under the mass on ground. </p>
    <p>Nice DIY irrigation system. I have something similar - the OpenSprinkler.</p>
    <p>Ah, I've seen that before - your version is definitely a little more polished.</p>
    <p>By using cron you are losing some of the main benefits of using the raspberry pi. 1. to be able to turn on/off a given valve using your phone while your standing next to the sprinklers. 2. To be able to program your valves easily via your phone.</p><p>If your willing to learn about Sift Registers OpenSprinkler is probably the easiest to setup -- <a href="https://github.com/OpenSprinkler/OpenSprinkler-Firmware" rel="nofollow">https://github.com/OpenSprinkler/OpenSprinkler-Fir...</a> -- Just run &quot;sudo ./build.sh ospi&quot; and everything is setup. Look in defines.h for which pins to use for the shift register. </p><p>If you would rather work with direct pinouts this software works well - <a href="https://github.com/Dan-in-CA/SIP" rel="nofollow">https://github.com/Dan-in-CA/SIP </a> , Though I am not a fan of how you program it to run at certain times.</p><p>One I haven't tried but supposedly has a similar interface to OpenSprinkler is sprinklers_pi -- <a href="https://github.com/rszimm/sprinklers_pi/wiki" rel="nofollow">https://github.com/rszimm/sprinklers_pi/wiki </a> It also uses direct pinouts.</p>
    <p>I've seen various Raspberry Pi home-automation type projects that can be controlled from a phone. Honestly my goal here was more of a &quot;set it and forget it&quot; project. I set the timers once and if I need to log on to the Pi a couple times a growing season to change the times, that isn't a huge deal. I don't need day-to-day easy manual control from a phone, as that defeats the purpose of having it fully automated so I don't have to think about it. The GUI for sprinklers_pi looks really nice but it looks way more advanced than what I need - I don't have multiple zones or anything. Just watering the whole garden at once and aiming for &quot;don't kill the plants.&quot;</p>
    <p>neat , i'm working on an indoor closed system loop , still trying to figure out sparkfun sens-21 (soil humidity sensor ) to trig the watering </p>
    How much money do you have invested in electronics here? I considered doing all this but I found a 4 port timer for my garden for $60.00 last spring that works great for my garden. <br><br>Also a plumbing tip use a fitting known as a union to easily remove your solinoid valve. they do fail more often than you would expect. Unions allow you to easily take apart sections of pipe without needing thread tape or gluing new couplers.<br><br>Great ible
    <p>- I didn't keep track of the total cost, but I definitely didn't do this to save money. I really wanted something fully programmable &amp; customizable based on the weather. If I didn't care about that, I definitely would have gone for one of the timers from Lowe's for less time/effort/money overall. If you want to figure out the total cost you can follow all the links in the materials section and add it up. </p><p>- Look at the plumbing steps closely and you'll see that I did include a union :-)</p>
    <p>whats the cost ?</p>
    <p>I didn't keep track of the total cost because I did this project over the span of a few months. I provided links to all the materials so you should be able to follow those and add up the cost.</p>
    <p>whats the cost ?</p>
    <p>Great DIY irrigation system. Just need to make sure your water pressure is lower than your soaker hose max spec (normally is 40-60psi). Otherwise you will repair your soaker hose often than you thought. </p>
    I hadn't even thought of that and I threw the packaging for the soaker hoses away, so I don't know the rating. Guess I'll be finding that out the hard way...
    <p>You've done a decent job here. I once dug lots of pipes in my garden with self-lifting sprinklers. It sort of works, but there are always places where the sprinklers don't reach. And correcting is not that easy once the pipes are underground.</p><p>Anyhow, since 3 years a mole (grand family, I guess) has taken over my garden. So I actually don't care much any more...</p>

    About This Instructable

    38,151views

    376favorites

    License:

    Bio: For my day job I write K-12 STEM projects for www.sciencebuddies.org. In my spare time I write Instructables.
    More by Ben Finio:Rudolf the Red-Nosed Christmas Tree Water Level Indicator Raspberry Pi Controlled Irrigation System Jam Jar Wedding Favors 
    Add instructable to: