Step 2: Arduino + Ethernet shield

I used an arduino (atmega328) with an ethernet shield from www.nuelectronics.com.
3 digital pins are controlling 3 relays that let the 24v AC through.
A 4th digital pin is used for the ground for convenience sake, really (the connector that came with the relay board conveniently had 3 relays + ground on 4 adjacent pins... if that makes sense...).

An old cell phone charger gives me 10v DC which I get to the arduino through the Vin + GND pins.

Finally, I added a couple of push buttons for manual control. I use the Analog input trick (different resistor values give different analog reads for each button). In the end I only used one of them.

<p>Hi,</p><p>I&rsquo;m irinakim and I&rsquo;m work in the Wiznet.</p><p>Thank you for using our product.</p><p>We are collecting so much data using our product.</p><p>And I will post the this project on our Web site.( <a href="http://wiznetmuseum.com/" rel="nofollow">http://wiznetmuseum.com</a>)</p><p>Can I post your product on our Web site?</p>
Ah ha! Your transistors are on their own board... Got it!
Yep, I used my 'proto relay shield' for this project. I had in mind to eventually build a dedicated pcb / protoboard. Although I since have found an arduino relay shield (at www.seeedstudio.com) which is going to be just fine.<br>I will post an update when I have retrofitted my project with it.
Finally got around and did it... It's here: http://www.instructables.com/id/Arduino-Sprinkler-System-Web-control/?ALLSTEPS <br> <br>I hope this will make the project simpler to tackle for those who were put away by the apparent mess... <br> <br>N.
This is really cool. I've been wanting to do something like this for a while, and this gave me a ton of good ideas. I have an old 12 zone (expandable to 16) rainbird clock that I'm thinking of converting using your plan. The programming logic and the valve switching are on two separate boards, so I'm thinking I can use your idea just replacing the relay board with the rainbird switching board. I'll let you know how I do.
Thanks ! Please keep us posted.
Will do! My first stumbling block seems to be selecting the hardware... I'd wanted an all-in-one ethernet Arduino because of its low price, but it's look like that won't give me near the outputs I need. I've got 12 zones connected now and an ever evolving drip system, so I want something with plenty of outputs. The rainbird board has what looks like a 24-pin harddrive connection on it. I'm thinking I'll bite the bullet and pay for the new Mega and an ethernet shield. Decent plan?
I never used the all-in-one ethernet arduino but make sure your ethernet board / shield is built around the W5100 chip and has an integrated SD card. It will save you a lot of hassle.<br><br>A Mega seems overkill for your project. In a similar situation I was able to chain up 4 shift registers (SN54HC595J) for a total of 32 digital outputs, only using 3 pins of the 'regular' arduino. Digital outputs are the one type of I/O really easy to extend.<br><br>N.
I got the UNO and some shift registers as you recommended. Thanks for saving me some dough! <br> <br>I'm running into trouble now connecting to the existing rainbird board. My original idea was just to use the existing 24 pin plug on it, but figuring out the existing logic has been complicated. It also appears to be getting 24V off of the logic board. My electronics knowledge is limited and I think converting 5V logic to 24 is more hassle than its worth. <br> <br>I ordered today a sainsmart 16 relay board for $29, that's built to use with Arduino, and am going to try and attack from that angle. Thanks for the advice, and I'll let you know how I do.
Thank you so much for this contribution! <br> <br>After I got my Nest Thermostat, I got totally fed up with not understanding our sprinkler system, and have been really wanting something like this. Our system is a bit more complex, but I'm sure I could get it to work just fine. <br> <br>Also, I'm thinking about the possibility of a touch-screen interface next to the controller in the garage (for our landscape people), and doing a web interface for our own use. <br> <br>This might be the first step I take towards smartifying our house (aside from seeing if I can retrofit solar/rechargeable into our electric blinds). <br> <br>Thanks again!
Thank you for the kind comment ! <br> <br>I think the trick is to make the (sprinkler) controls as low-tech (aka robust) as possible and connect to them through ethernet / wifi. Once you are on a computer you can make your interface as fancy as you want (e.g. connect to your system through a web interface on a dedicated tablet, automate tasks with scripts, send data to an internet-of-things web server etc...) <br> <br>Btw, my sprinkler system is still in use and has been upgraded to 6 valves... <br> <br>Have fun ! <br> <br>N.
Here are a few helpers that might be useful to others (originally by PM):<br><br>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.<br><br>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.<br><br>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).<br><br>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.<br><br>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.<br><br>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.<br><br>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).<br><br>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.<br><br>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.<br><br>I hope this helps,<br><br>N.
Thank you for such a brilliant contribution. I have ordered the parts for this project and waiting for their arrival.&nbsp; I participate on a community farm and intend to use this to remotely control some irrigation.&nbsp; I am particularly interested in extending the web interface for this, with specific interests introduce and extend features of time.&nbsp; My ideas so far;<br> - Web scheduling interface<br> - Web viewable logging<br> - Skip watering if soil moisture levels above a certain reading<br> - Email event notification<br> - Failure detection and handling (power interruptions etc)<br> <br> I'm thinking the interface would be best implemented as a MySQL / PHP application.&nbsp; Is this something you would have interest in collaborating with me on?<br>
Sure, I would be happy to help (although my time is usually fairly tight so don't expect much more than ideas and pointers from me).<br><br>Talking of which... maybe you can have a look at http://domus.link.co.pt<br>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).<br><br>With scheduling + logging already there, it is probably a good base for your project.<br><br>N.<br><br>
I've been DYING for someone to do something like this! Bravo! However I agree, a bit more detail and sources for the relay board, etc. Spoon feed me!
Thank you ! <br><br>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.
Are you running the relays directly off the output pins? No transistors? No Darlington driver?
Well, this diagram is really there to give an overview of the connections of the arduino + shield to the rest of the components. The relays can not / should not be driven directly off the output pins.<br><br>I tried to be more precise but then the diagram became messy and missed the point, I thought.<br><br>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.
I would like to do this but no ethernet shield so I will just follow my instructable
...and I will follow mine ! ;-)
i think a parts list would be really helpful here. you get 3 or 4 steps in and then all of a sudden start talking about a relay board. it's a little confusing
Good point. <br>Done.<br>

About This Instructable


215 favorites


More by nicoo: Hacked roomba + arduino snowballs into a Eurobot 2013 entry... Flashing bootloader into Arduino UNO R3 Arduino Sprinkler System + Web control
Add instructable to: