Introduction: A Watering Controller That Can Be Home Networked

Picture of A Watering Controller That Can Be Home Networked

A couple of weeks ago, I published a great little controller module that provided 6 relays able to be controlled from a computer via a network.  After I published it, I got to thinking that the same basic design, with a couple of changes could be pressed into service as a garden watering system controller.  So, I got to work, modified the design, and here you have it...  A sprinkler controller that runs by itself, that can be programmed and monitored from your computer via your home network.

This specific version of my sprinkler controller obeys some simple rules that have had to be implemented where I live.  I live in Australia, or more specifically in an inland region called the A.C.T, where our government have implemented an ODDS and EVENS watering regime.  Under the system if you live in an odd numbered house, you may water on an odd day of the month.  Likewise, if you live in an even numbered house, you may water on an even day of the month.  Everybody may water on the 31st.

This system, along with the mandatory replacement of sprinklers for dripper systems has sucesfully reduced the load on the cities limited inland water supply so that more drastic measures were not required.

Unfortunately, this system was unable to be implemented on my commercial water controller, it wanted to water on a Monday, or a Wednesday, so I was breaking the law, and subjecting myself to a potential fine every other week...  So I had to build my own controller.

This instructable shows how I built it - there certainly is enough detail shown so that you can make it yourself if you are enthusiastic, and willing to give it a go. 

Update:  the full source tree for the Kicad project is located here

Step 1: How Do You Drive the Solenoids?

Picture of How Do You Drive the Solenoids?

The sprinkler controller is built on the base of my Adruino Ethernet controller.  The Arduino ethernet controller provided a basic network connected ATMega328 chip, and had a number of spare I/O lines. 

I extended the PCB design to provide 6 solid state outputs, each able to drive +12v at 300mA, which is enough for a watering solenoid.

Each solenoid output is driven from a NPN transistor, as shown by the attached picture.  To turn on the transistor, the port pin is simply driven high.  I decided to use individual transistors, as they cost $0.03 each, and if they are destroyed, they are individually replaceable easily.

There is also a DS1302 RTC chip on the PCB - it is simply driven directly off 3 pins of the Arduino.

The whole board is driven by a 12VDC plug pack transformer.

It is not sensible to describe the full details of the Ethernet controller here, just check out the Arduino Ethernet controller (which is basically an Arduino and a NuElectronics shield) for info.

You will find the full schematic diagram attached as a PDF.

Step 2: Making the Board

Picture of Making the Board

To make the PCB, I used press-n-peel and toner transfer, as I do for all of my projects.

Essentially, I print the PCB layout onto some toner transfer paper.  I use Press-n-peel Blue, which costs a bit of money, but is beautifully reliable.  That is then laminated onto some clean PCB stock the paper is removed, and the layout is touched up using a permanent marker where there are dust spots.

Then I etch the board using a mixture of 120mL Hydrochloric Acid, and 240mL of Hydrogen Peroxide (20%) - The excess copper is dissolved in about 5 minutes, then the board is thoroughly washed to ensure that all acid is removed.

Then I scrub the toner material off the board using steel wool, and protect the board using a solder through spray lacquer.

Finally, I drill the board using my trusty Dremmel (Which has been working great for 20 years)

I have made hundreds of boards using this method, and it works really well.  Just be very careful using acids - wear eye protection, old clothes, and gloves.  And make sure that you protect your stainless steel laundry sink.  I protect mine by filling it with 10Litres of water, that way when a couple of drops of acid end up in it while I am rinsing off a board, it is diluted by lots and doesn't damage anything.    :-)

Step 3: Soldering the Components

Picture of Soldering the Components

Once the board has been made, I solder the parts onto it.

My board needed a few jumpers, because I can't make double sided boards at home, so I soldered them in first.

I used surface mount parts for some of the components.  These were soldered onto the back of the board next.  These components are simple to solder and it is well worth taking the effort to get them soldered - as I do more and more of them, I am finding it easier and easier.

There are many great instructables on how to solder surface mount parts, just have a look at one of them for ideas.

After the surface mount parts are soldered, continue by soldering the rest of the components. 

I have created an assembly manual that shows the steps that I used.  If I decide to make kits, this will be the manual that I will supply.  It is attached.

Step 4: Programming the Micro

After all of the parts have been mounted, load the code into the micro.

I use a FTDI USB-TTL cable for all of my Arduino programming work.  If you don't have a cable, you can use your Arduinoboard.  Simply unplug the micro from your board, plug in the ATMega328.  Program it as per normal, and then move the programmed chip into the sprinkler controller.


Here is the code for the project as a PDE file.

Step 5: Testing and Programming

Picture of Testing and Programming

Now that you have the micro programmed, plug it into the board, and apply power.

The yellow led at the bottom of the board should flash a couple of times.  If it does - YAY IT WORKS - if it doesn't, check for solder shorts and misplaced components.

Connect an ethernet cable between the board and your computer.

Make sure that the IP of your computer is (for the default range in the code), open a web browser to, and you should see the screen below!

If you can see it - you are there.  Set the clock, and define when you want the watering to happen, and create your program.

There you have it - you are there!!!!

If you decide that your home network is on address 10.0.0.x then you can simply modify the line in the PDE file to put the controller on the 10.0.0.x network and re-program the chip.

ie change these lines from this:

static uint8_t myip[4] = {192,168,1,2};      
static char baseurl[]="";


static uint8_t myip[4] = {10,0,0,12};
static char baseurl[]="";

Step 6: Parts List


10uF SM  x 4
18pF SM x  4
0.1uF SM x 3

51R   x 4
270R x 12
470R x 6
2K7 x 1
10K x 3

AtMega168 micro (DIP)   x 1
DS1302 RTC (DIP)  x 1
ENC28J60 Ethernet (DIP) x 1
74HC08 AND Gate (SOIC) x 1
GREEN LED 5mm x 6
YELLOW LED 5mm x 1
RED LED 5mm x 1
BLUE LED 3mm x 2
BC547 Transistor x 6
1N4004 Diode x 7
16Mhz crystal x 1
32768Khz Crystal x1
25 Mhz crystal x 1
78L05 Regulator x 1
78L33 regulator x 1

2 Pin PCB screw connector x 4
3 Pin PCB screw connector  x 1
6 pin 0.1 inch pin array x 1
Small Pushbutton x 2
RJ45 MagJack from Sparkfun x 1
8 Pin IC Socket  x 1
28 Pin IC Socket x  2

Step 7: PCB Artwork

Here are the PCB files for toner transfer

Step 8: Where to Now?

I am glad you asked...

1.  I will be extending the code to be more general - Not everywhere on the world has the ODDS and EVENS system in place, and some people can water whenever they want.  The code changes should be pretty minor.

2.  In an ideal world I would understand how to make the interfaces better.  At the moment, string space on the ATMega328 is sooo limited that it has been a shoe horning exercise getting everything to fit.

3.  Adding recording data would be great - It would be cool to ask the watering controller how much water I used this month.

In all - lots of options to improve the project - but this is the point where I had to say - "That will do Pig, That will do'.

If you don't understand the reference above, you need to hire a copy of 'Babe from 1995' 

PS - There is no security on this device - making it accessible to the whole world via the Big Bad Internet (tm) would be a bad thing.  Would you give the Internet access to your tap out the back of your house???  I didn't think so :-)

Step 9: DC Vs AC Solenoids.

There have been many comments on this Instructable regarding DC vs AC solenoids.

I am using Rainwater 24V AC Solenoids - and they operate well using 12V DC.

Essentially, when operating a solenoid outside it's design specification, you have to understand that your experience may vary, depending on the manufacturer.

As one posted indicated, the inductance of the coil is what limits the current flowing through the solenoid to a safe value when driven in an AC circuit.  In a DC circuit, there is no inductance, just the resistance of the coil.  I would never recommend operating a 24V AC coil at 24V DC, that will certainly overheat the wiring, leading to premature failure.

One commenter did mention that using a coil with DC will increase the amount of heat that it had to dissipate - This is correct, as long as you don't reduce the supply voltage.  Depending on the DC resistance of the coil, you may find that your specific coils run just fine.

My advice, use a 12V battery, and a multimeter measuring current, and see whether (a) the coil is pulled in enough to run, and (b) how much current is flowing when the coil is energized.  As long as there is less than about half an amp, then you are likely to have no problems.

I am working on a 24V AC version of this design, so that peoples concerns are alleviated - but that won't run using a solar cell as it needs an AC supply to operate.


srisawats (author)2016-03-28

It is great project. It work for me. I used Arduino UNO with enc28j60 shield.

But sometime it can not connected to the network until reset.

I tried to used Arduino Mega2560 for more buffer size ,it could installed the code but not work.

So many thank for your projects.

ElegantAndrogyne (author)2015-09-24


you can use ULN2003 or ULN2803 chips for driving the solenoids. They have inputs perfectly suitable for 3V3 or 5V drive (with current-limiting resistors), and open collector outputs with integrated flyback diodes. Makes the electronics even simpler... and I made a device (lead type casting machine controller, actually) that uses four of these chips for controlling 31 compact solenoid valves for compressed air. The PCB fits on a Raspberry Pi (and is a "proper" HAT). It would be possible, but very impractical with discrete transistors :).

Nice PCB design, and clean execution too :).

will173882 (author)2015-05-26

This project is awsome. thanks for putting it out there. I re designed your idea and made it networked with security. No flaws sofar. I set it up to my phone and i can control the sprinklers before i get home or just to show off...

diy_bloke (author)2014-05-04

Your project is great, was and still is, but by now, selfbuilding it is just not wise anymore. the chip will cost me 4 euro, the magjack 5 (al locally sourced) but for an entire ready made board from china I now pay abt 4 euro.
Dont get me wrong, it is a great thing you did and at the time the best solution, but u have been overtaken by cheap foreign labour :-)

andregiovanni (author)2013-07-06

Hello, congratulations for the project, very good!!
Can you help me?
I want to do this project with atmega8, would pass me the HEX file? is it possible?

thank you

drj113 (author)andregiovanni2013-07-07


Unfortunately, the project is designed for the Arduino platform, so I do not have any hex files.

gentry (author)drj1132014-04-20

Also, you really do need all 32K of memory on the Atmega 328. An Atmega8 wouldn't even have room for the ethernet library. Atmega328s are cheaper than Atmega8s (at Newark, Mouser, and Digi-Key in the US), and they're pin compatible, so just use an Atmega328.

dcms4 (author)2013-04-03

I was interested to see if this project could be done without connecting it to the net. I'd much rather just have the sketch control the system. Additionally i was trying to isolate the sprinkler control portion to make a shield instead of an all in one board. Would anyone care to be awesome and isolate the part of the schematic that would be used to make such a shield.

jrogers42 (author)2012-08-13

Newbie question:

Why does the part list say ATMega168 but the instruction mentions ATMega328 several times? Are these interchangeable?

drj113 (author)jrogers422012-08-13

The 328 is an upgraded 168 chip - more memory - cheaper :-)

ozdenmir (author)2012-08-07

Great instructable very well documented. I build the controller but I need help with the program. Is it possible to modify the pde to make the controller able to water every day? and how? Thanks.

zhenry1 (author)2012-06-14

Awesome! I've been planning a project like this for a while. I've got an old (20 years, maybe?) rainbird controller with 12 zones that looks to be expandable to 16. The zone switching and programming logic are on different boards, so I'm thinking I could connect the switch board to a computer or device like you have to run my own programmin. The whole zone switch board is connected to the scheduling logic with what looks to be a regular 24 pin ATX connector, with each zone going to a different pin. I'm needing some help figuring out how to connect the 24 pin ATX to a usb or serial interface so I can program the sprinklers with a computer, and eventually with a setup like you have.

zhenry1 (author)zhenry12012-06-14

Here are some pics

diy_bloke (author)2012-05-25

Just out of general interest for the watering code in ACT. Is there just a code for using sprinklers or a hose on odd or even days or is it even forbidden to go around with a can to give thirstuy plants some relief.

As I am sure everybody is still allowed to take a bath everyday, would it be allowed ot water your garden with bathwater, even if it is not 'your day'?

I know it ha slittle to do with this project, I was just interested

drj113 (author)diy_bloke2012-05-28

Thats a briliant question.

The focus of the law was to reduce water consumption from a tap. You could bath every day, and use a watering can every day - it just affected fixed sprinklers.

It worked beautifully, changing peoples habits - we are now off water restrictions, but the usage is still low :-)

diy_bloke (author)drj1132012-05-28

great. by just using some common sense i reduced my water consumption with 75%. Not that it makes much difference in my bill as the actual price of water is nothing comapred to the levy's rights and taxes i have to pay on it :-).

with regard to the use of bath water, i was just wondering if you'd be fined if police would see yr sprinklers working on an 'off day' even if you'd be doing it with bath water :-)

sprinklers are a very wasteful way of watering plants anyway

Anyway, that is purely academic now, as yr off water restrictions.

diy_bloke (author)2012-04-19

Great idea. I see you did not include the dipswitch that you have in your other arduino ethernet designs.

drj113 (author)diy_bloke2012-04-19

I decided that it wasn't needed for configuring this board, and that if I needed to, I could use the EEProm in the AtMega chip instead for config data.


diy_bloke (author)drj1132012-04-19

Thanks Doug, but darn, I found all the parts I need locally, so I have no excuse not to build it anymore :-)

rupin.chheda (author)2011-07-22

If I wanted to replicate the PCB, is there are kind of scaling I need to apply or just print the Copper layer without scaling?

pgenns24 (author)2011-05-23

This is a very good Instructable.
I am new at all this and i have been searching for the ENC26J60 library with all the members you are using, and i just can not find one. May be i am just missing a part of the project. Could you please help me to find de Library?
Thanks in Advance!

falk3n (author)2011-03-21

hi brother the problem is that in my country that connector Sparkfun not get so I drew a rj45 jack pc the problem is not if you have the same distribution that Sparkfun connector that is why for me is to record I was using a rj45 but the arrangement of transformers and that did not enter the address is there any way to connect directly to a connector enc28j60 RJ45 transformer arrangement? thanks in advance

terys2 (author)2011-03-21

The same here led blinks and when i put default ip i can`t get in the web browser. The lan is light btw. If anyone can help.Thnx in advance

drj113 (author)terys22011-03-21


Thats not great - did you use the Sparkfun jack? Does the link light light up when you insert the cable? Does it go out when you remove it?


falk3n (author)2011-03-20

brother do you know that installing the sprinkler system and I'm great the problem is that when I try to access the default ip and nothing comes out and measures to see if I had any problems in the lines of the board and nothing in fact to turn the LEDs twinkle rj45 port and the yellow LED blinks then I do not understand clearly what is happening only in so I'm not equal to your system is that it got the magjack Sparkfun rj45 rj45 if not normal, you consider that I appreciate your response is that a hug

drj113 (author)falk3n2011-03-21

What RJ45 jack did you use? If you didn't use the one from Sparkfun, then what wiring did you use. The sparkfun jack has magnetic transformers in it, which was why I chose it - without the transformers, then there is a high likelihood that the project will not work.

termm (author)2011-03-20

Awesome project.
I love web controlled thingies.

terys2 (author)2011-03-08

Hi with what program i compile the .pde file .Thnx in advance

drj113 (author)terys22011-03-10

The .pde file is an Arduino sketch. It is designed to be loaded with the Arduino IDE.

falk3n (author)2011-03-02

I hope you are good friends very well I think it's great your project but you could be q up the libraries that the program gives me error e downloaded these libraries appear and persist errors by

drj113 (author)falk3n2011-03-02

No problems - Which libraries do you need?

CODIY (author)2010-11-15

Wonderful Instructable Doug! I am in the planning stages for a similar controller for my garden irrigation, though I plan to use zigbee to interface with the computer.

I was wondering on the odd/even day of the week determination whether you had considered using the modulo function. By dividing by 2, the modulo would always be either 1 or zero, so to determine whether to water or not, you would just have to determine if the modulo of the date results in a 1 or zero.

Wire54321 (author)2010-11-14

having alot of problems with the come "Time time;"

and do i need to download anything if so where?

Wire54321 (author)2010-11-14

Please Can you make one with 6-Zones. And possible with a port for bluetooth or can i use programming port?

A++ for pump mode

agis68 (author)2010-10-23

Excellent Job, well made and projected....5/5

inventgeek (author)2010-10-13

I have a strange problem with my setup. The web examples don’t work but the link lights come on. and the leds flash appropriately for the loading of the enc chip and if i load the ping sketch it will respond but destination as unavailable. the leds blink with traffic but it seems like part of this are not working right. anyone run into this type of issue?

drj113 (author)inventgeek2010-10-14


The standard reason that people have problems wit hthis project is that they don't use a magjack - or that they have a transposition error between the TX and RX lines on the Ethernet side, or that the computer is on a diferent network number range to the project.

If the LEDs flash on boot, then the communications between the micro and the Ethernet controller are correct. just check the use of a Magjack, and make sure you are either (1) plugged into a hub, or (2) using a crossover ethernet cable from your computer.

Also, double check your network settings - it is important that you are on the same network as the project, as it has no routing capability. Also double check the address you set up in the code.

Take care,


kyle brinkerhoff (author)2010-10-06

how much if i asked you to make me one ?

gentry (author)2010-09-27

Awesome. This is exactly the project I wanted to do for our home irrigation system, since the commercial watering controllers have horrible UIs.

You mention that you protect your boards with a solder-through spray lacquer -- do you have a brand name or a supplier?

drj113 (author)gentry2010-09-27

It is an Australian Brand called Servisol.

It can be purchased from Jaycar.

nicolaudosbrinquedos (author)2010-09-15

Amazing instructables!
It is possible do the same with wireless conection?

That is an awesome idea - I am sure that it could be done, using some of those inexpensive rf data link modules.  I am not aware of a way that I could get 802.11 actual wireless networking into the design.

With an rf data link module, I suspect that the architecture would change completely - we wouldn't have to implement a web server in the box, because we could simply implement a simple remote control protocol.

I don't think I would go to the extent of having wireless solenoid controllers.  The current drain when they are operating would destroy batteries very quickly :-)

sdgenxr (author)drj1132010-09-20

Wireless option would be awesome! Then you could easily feed data to a computer that runs 24/7 and create graphs and such from there.

(Patiently waiting for the WiFi version)

acksheep13 (author)drj1132010-09-16

Actually if you have an open plug near where you are you could use a Wireless Network Bridge WNB. This lets you plug it into the computer for your info then you plug it ino the ethernet port on your system after programmed and it should latch onto any wireless network it is programmed to.

jrawling (author)2010-09-19

Regular solenoids (in North America) prefer 24 Volts AC. Since I have 12 Volt DC draught (remote property, solar) I would like to use that to run my irrigation solenoids. Can I feed 12VDC to a 24VAC solenoid and make it function?

databoy (author)jrawling2010-09-19

Simple answer is NO. AC and DC are different power systems. DC will burn out AC coils.

databoy (author)databoy2010-09-19

I will add to the above comment. I am a qualified electrician, I live in Australia. The local 24 volt coils will not work on DC; if they do work, the local heat 40 degrees C in the summer will overheat the coils.

drj113 (author)databoy2010-09-19

Thats interesting - Thanks for your thoughts.

I never water during the heat of the day - it is really bad for the plants - and the local council only allows watering between 7pm and 10pm in any case.

Do you know what is different between an AC and a DC coil?  What manufacturing difference is there?

Gooru (author)drj1132010-09-19

The difference between an AC and a DC coil can be substantial or none at all. Years ago I toured a Siemens plant where one line was manufacturing relays for a third party vendor (name never mentioned). We watched the automation wind and solder coils, assemble the contacts and armature, then snap on colored caps. The caps were preprinted with the pin outs and specs; yellow caps for DC, green for AC. It was the same component under the cap. The engineer leading the tour explained the design parameters allowed the relay to function under a wide range of voltage, AC or DC.

On the other hand, a design can be very specific. This is especially true where size, efficiency, response time or environment is paramount. In this case a variation of voltage of as little as 10% can fail a component, or at least shorten its life significantly.

Someone mentioned that DC could magnetize an AC relay or solenoid, causing it to stick. Some DC “latching” relays are designed to do just that. The AC version requires a mechanical latch. Magnetic stiction might be a problem for coils with a ferrite core, but ferrite costs more and requires special handling. Most relays and solenoids use laminated steel which resists both residual magnetism and hysteresis currents. The latter contribute to heating when the coil is left energized.

So while running an AC coil on DC might not work, it often does usually at a somewhat lower voltage. You could spend a lot of time researching whether one specific device will function or not, and someone will always tell you it won’t. The only way to tell for sure is to plug it in and try it. Measure the current, monitor the temperature, and if it doesn’t catch fire you are good to go.

drj113 (author)Gooru2010-09-19

Yep! --- There is nothing wrong with giving it a go!

About This Instructable




Bio: I have a background in digital electronics, and am very interested in computers. I love things that blink, and am in awe of the physics ... More »
More by drj113:A Grey HatA Programming Jig for our DeskClock BoardsThe Wordclock Grew Up!
Add instructable to: