I have a small yard with a very odd shape, well... L-shaped really and not enough pressure at the tap to be able to water it in one go. So I had to create 3 sprinkler sub systems that can only be turned on one at a time.
I sourced 3 Gardena valves but refused to cough up the extra cash for their dull 'computer' (not sure why they call it a computer btw). Besides, controlling the valves from a browser was the bear minimum I would expect and Gardena does not offer this functionality. (My friend) dd-wrt even allowed me to re-use an old router of mine and made the whole thing wireless...
Arduino time, I say...
As a bonus, I inserted at the end of this instructable my scripts that automagically turn the sprinklers on and off, check the weather forecast (so I don't water the lawn if it is going to rain soon) and log their activity on twitter.
Enjoy !
Here are the parts I used for this project:
- various pipes / hose adapters (from Gardena)
- 3 x 24v Irrigation Valve (from Gardena)
- 1 x arduino board
- 1 x ethernet shield (www.nuelectoronics.com )
- 1 x relay board (which I had lying around, a smaller board / a relay shield - with at least 3 relays - would have been sufficient)
- 1 x 220v -> 24vAC transformer (from ebay)
- 1 x 10vDC adaptor (a recycled phone charger)
- 1 x router (Buffalo WHR-G125) with dd-wrt (http://www.dd-wrt.com )
- 2 x momentary push button
- 1 x power switch
- a couple of meters of ethernet cable.
Remove these ads by
Signing UpStep 1The water part.
I found this transformer on ebay for not very much. 230v AC -> 24v AC (did I mention I am in Europe ?), that will do.
| « Previous Step | Download PDFView All Steps | Next Step » |






















































1. a relay has 3 output pins: no,nc,common. You should (must) use common and no, so that when your relay board / arduino is not powered, your circuit is open.
2. I found that my arduino powered from the USB port was not able to switch the relays. I had to have the external power connected at all time so that I could test while connected to the computer.
3. vcc and ground on your relay board must be connected to the arduino vcc and ground. It is possible (although unexpected) that your board expects a 5v on each input pin in order to remain in its normal state (i.e. same state as un-powered) and a 0v to switch state. Change the sketch accordingly if this is the case (swap LOW for HIGH everywhere onoff is used/tested).
4. pin 0 and 1 are special on the arduino as they are used for communicating with the IDE. If you are not prepared to deal with the added complexity, avoid them.
5. the ethershield also uses some of the (digital) pins of the arduino. Look at your documentation to see which pins are unused and therefore available for your program. For example, if you need 4 relays and if you use the same shield as me, use pins 4,5,6,7 for your relays. Instead of using pin 4 for ground (which was just a convenient trick for me), just remove all code related to this pin and use the 'ground' pin on the arduino board instead.
6. I only use one button in my sketch. I intented to have different ways of cycling through which proved useless once I had the http interface in place.
7. If you want two buttons for your application, bear in mind that for 2Kohm, one can use two 1Kohm resistors in series. Alternatively, if this part is causing more confusion than help, use one analog entry per button (e.g. A0 and A1).
8. If your switch box is behaving weirdly, un-comment out the line '#define WATER_DBG', you will get some debug information on your console and understand what is going wrong with your switch.
9. Led indicators: simply add a led (and the corresponding resistor) to pins 4,5,6,7 to get a feedback on your pins' states.
I hope this helps,
N.
- Web scheduling interface
- Web viewable logging
- Skip watering if soil moisture levels above a certain reading
- Email event notification
- Failure detection and handling (power interruptions etc)
I'm thinking the interface would be best implemented as a MySQL / PHP application. Is this something you would have interest in collaborating with me on?
Talking of which... maybe you can have a look at http://domus.link.co.pt
I run this frontend to control my X10 devices and I think it would be very easy (if not built-in already) to have commands run wget or curl (to control the arduino web interface) instead of heyu (the X10 control).
With scheduling + logging already there, it is probably a good base for your project.
N.
I have added details about the relays on the 4th step. Hopefully this will shed some light. Let me know if you have more questions.
I will post an update when I have retrofitted my project with it.
I tried to be more precise but then the diagram became messy and missed the point, I thought.
The 'A0' connection is one that I can never find documented when I need it (the 2KOhm resistor especially) so here it is for your (my) reference. I have added up to 5 push buttons (on one analog pin) this way in other projects, it works great.
Done.