0% found this document useful (0 votes)
304 views11 pages

A Watering Controller That Can Be Home Networked

This document describes the creation of a home watering controller that can be programmed and monitored over a home network. It uses an Arduino board with an Ethernet shield to control 6 solenoids for water zones. The author details the circuit design using NPN transistors to drive the solenoids, and describes making the custom PCB using a toner transfer method. Instructions are provided on assembling the components and programming the Arduino to obey the author's local watering regulations.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
304 views11 pages

A Watering Controller That Can Be Home Networked

This document describes the creation of a home watering controller that can be programmed and monitored over a home network. It uses an Arduino board with an Ethernet shield to control 6 solenoids for water zones. The author details the circuit design using NPN transistors to drive the solenoids, and describes making the custom PCB using a toner transfer method. Instructions are provided on assembling the components and programming the Arduino to obey the author's local watering regulations.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Home Sign Up!

Browse Community Submit


All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

A watering controller that can be home networked


by drj113 on September 14, 2010

Table of Contents

License: Attribution Non-commercial Share Alike (by-nc-sa) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Intro: A watering controller that can be home networked . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

step 1: How do you drive the solenoids? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

step 2: Making the board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

step 3: Soldering the components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

step 4: Programming the micro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

step 5: Testing and programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

step 6: Parts List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

step 7: PCB Artwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

step 8: Where to now? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
License: Attribution Non-commercial Share Alike (by-nc-sa)

Intro: 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

Image Notes
1. The old controller - Yep I am replacing it!

Image Notes
1. the old controller supplied 24VAC - which is a bit much for my new board - So I
am temporarily running 12VDC to the board till I can replace the transformer in the
http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
unit. Yep - The solenoids run fine on +12V
2. I have to modify the case - for some unknown reason the original manufacturer
didn't think of ading a socket hole for an ethernet connector!
3. I only have a couple of zones in use at the moment - but that will change
4. Yep - I have to re-tag the dryer... one day

step 1: 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.

File Downloads

Sprinkler-Controller-Schematic-v1.pdf ((595x842) 82 KB)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Sprinkler-Controller-Schematic-v1.pdf']

step 2: 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. :-)

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
step 3: 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.

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
Image Notes
1. The 74HC08 in place!

Image Notes
1. Power Connector
2. Solenoid Common
3. Pump output
4. Output 5,4,3,2 & 1
5. Battery Backup for the clock - 4.5VDC
6. Debugging and programming connector
7. Reset Switch

File Downloads

Sprinkler-Controller-v1-Manual.pdf ((595x842) 800 KB)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Sprinkler-Controller-v1-Manual.pdf']

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
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.

Easy!

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

File Downloads

Sprinkler_controller_ACT_Government_Rules.pde (32 KB)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Sprinkler_controller_ACT_Government_Rules.pde']

step 5: 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 192.168.1.1 (for the default range in the code), open a web browser to 192.168.1.2, 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[]="http://192.168.1.2/";

to

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


static char baseurl[]="http://10.0.0.12/";

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
step 6: Parts List
Capacitors

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

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

Semiconductors
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

Hardware
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
(http://www.sparkfun.com/commerce/product_info.php?products_id=8534)
8 Pin IC Socket x 1
28 Pin IC Socket x 2

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
step 7: PCB Artwork
Here are the PCB files for toner transfer

File Downloads

Sprinkler-Controller-v1-Component.pdf ((595x842) 41 KB)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Sprinkler-Controller-v1-Component.pdf']

Sprinkler-Controller-v1-Copper.pdf ((595x842) 86 KB)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Sprinkler-Controller-v1-Copper.pdf']

Sprinkler-Controller-v1-Jumpers.pdf ((595x842) 27 KB)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'Sprinkler-Controller-v1-Jumpers.pdf']

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 :-)

Related Instructables

Automated How to make a Help! Where are A credit card Rainwater drip
A Remotely Sprinkler Linux powered my Sprinkler sized Ethernet irrigation
Programable System Anyone garden sprinkler Valves Arduino
compatable system by Tree
Relay Controller Can Do! by system. by Located? by
(Christmas controller board Frog
shepnstein bkimmons thb43
Lights or Home by drj113
Automation
Controller) by
drj113

Advertisements

Comments
30 comments Add Comment

manicmonday says: Sep 19, 2010. 9:22 AM REPLY


Anyone have any ideas about building a diy electrically activated on/off water valve? Once you have that you can create as many as you want, and control
them in any number of ways.

Come to think of it I haven't contacted the plumbing supply to see if they sell anything like that at low price. I have checked at Walmart and they sell them for
$30 each as part of a programmable water timer system. I will call the plumbing supply tomorrow and keep you all updated.

drj113 says: Sep 19, 2010. 2:29 PM REPLY


I appreciate the idea of a home made watering valve, but the possibility of a failure occurring in it makes me just be happy to pay the $30.

Water is just to precious to loose through a construction failure.

Our local Bunnings sells buckets of commercial valves at about $30 each.

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
jrawling says: Sep 19, 2010. 6:37 AM REPLY
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?

drj113 says: Sep 19, 2010. 2:18 PM REPLY


I discovered that my solenoids were happy with 12VDC just by trying it out - If they turn on and off with 12VDC, then they are ok.

leadpencil says: Sep 19, 2010. 8:58 AM REPLY


You can get a 9volt dc magnetic latching solenoid for the big three (toro, rain bird, hunter)

databoy says: Sep 19, 2010. 8:46 AM REPLY


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

databoy says: Sep 19, 2010. 8:53 AM REPLY


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 says: Sep 19, 2010. 2:22 PM REPLY


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?

BlueFusion says: Sep 19, 2010. 7:51 AM REPLY


Short answer - yes.
Long answer - yes, but they don't like it much. They will work, but you may end up magnetising them from the DC - which means they could get stuck on
or off.
Basically, it works, but you reduce the lifetime of the solenoid.

rvbcrs says: Sep 19, 2010. 9:10 AM REPLY


Wow drj113 what a good project really nice!! I just hope on thing, do you think you will ever make this same project but then just out of smd components? I
would really love that!

jamwaffles says: Sep 19, 2010. 6:12 AM REPLY


Nice PCB!

Can I ask what software you use? Eagle is so very nice but the board size is so very limiting! :(

evildeece says: Sep 17, 2010. 6:38 PM REPLY


You're in the ACT? Awesome! We're building a hackerspace and have maker meetings every alternate Tuesday. You're welcome to join - Make Hack Void

drj113 says: Sep 18, 2010. 4:10 AM REPLY


Wow - That would be awesome - I will have a look at when I can drop over - Thank you!

diamantmatch says: Sep 17, 2010. 4:09 PM REPLY


hello

i dont understand how you keep power on the RTC chip when it loses power.
in the skematic it says that there is a cap between it's backup pin and gnd but it is called capapol and i dont know wich one that is?
somewhere in the parts pdf i found that it only charges it's battery when it is told to ?

thank you
diamantmatch

drj113 says: Sep 18, 2010. 3:34 AM REPLY

I use a set of 3 AAA cells, providing 4.5v to the right controller connection - that is where the supply to the RTC chip directly.

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
diamantmatch says: Sep 18, 2010. 2:44 AM REPLY
hello again :)

can you upload the librarys to?


i dont have the lib for ds1302 and etherlib and stuff
thank you
diamantmatch

diamantmatch says: Sep 17, 2010. 6:53 AM REPLY


wow your'e featured on hackaday! congratulations!
thank you for the pcb files it is really usefull!

falafle says: Sep 15, 2010. 10:03 AM REPLY


that looks almost identical to your relay board:] but still great work!

drj113 says: Sep 15, 2010. 2:22 PM REPLY


Hi,

You are pretty well right - My focus was kind of having built an enabling technology (The Arduino Ethernet Board), there were many things I could do.
And my wonderful wife did suggest that instead of working on the awesome arduino music project I have working in the back of my brain, I could finish
the job I started a couple of years ago when I said I would replace the sprinkler controller :-P

falafle says: Sep 16, 2010. 10:55 AM REPLY


now if you made it have the ability to change the polarity on the outputs, it would be perfect for robotics

robertanne says: Sep 16, 2010. 10:34 AM REPLY


hey! guy is it possible to work with your project with a wireless implementation?

diamantmatch says: Sep 15, 2010. 11:02 PM REPLY


hello

can you upload the schematic files from eagle cad please?
it would certeanly help because i wouldnt have to do everything by hand :)

thank you
diamantmatch

drj113 says: Sep 15, 2010. 11:17 PM REPLY


Hi, I am very sorry, but I don't use Eagle because it is not open.

Eagle is severely restricted in the size of PCB that it can make in the freely accessible version in that it can't be used for projects greater than 4" x 3.2".

Given that my Workclock project was 6" x 6" I couldn't use Eagle. So I searched for an open source alternative.

I use KiCad, which has no restrictions, and is fully open.

I am very happy to provide Kicad schematic and PCB files if you like.

diamantmatch says: Sep 16, 2010. 4:11 AM REPLY


Hey, oh sorry i thought you where using eagle.
But if you can provide me with pcb files , that will be great.

thank you
diamantmatch

drj113 says: Sep 16, 2010. 5:25 AM REPLY


Not a problem at all - Send me your email to [email protected] - and I will respond tomorrow morning.

Doug

djairjr says: Sep 15, 2010. 9:37 AM REPLY


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

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/
drj113 says: Sep 15, 2010. 2:26 PM REPLY

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 :-)

acksheep13 says: Sep 16, 2010. 3:52 AM REPLY


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.

diamantmatch says: Sep 15, 2010. 12:36 PM REPLY


hello
i can not seem to find the ENC38J60 but i have found the ENC28J60 on ebay but it is rather expensive.. (well expensive.. XD 5 dollar but still) is it okay to
use a ENC28J60 in my circuit instead of the ENC38J60?
what is the difference in them?

thank you very much i really adore your projects i truly think they are wonderfully build and designed

thank you
diamantmatch

drj113 says: Sep 15, 2010. 1:43 PM REPLY


Whoops - it was suposed to say ENC28J60 anyway --- I have fixed the instructable.

Doug

http://www.instructables.com/id/A-watering-controller-that-can-be-home-networked/

You might also like