Introduction: Arduino Sprinkler System + Web Control

A smart sprinkler system for the rest of us... No soldering involved ! Just pile up a couple of shields on top of an arduino and control your sprinkler system from anywhere.

A couple of friends wanted to replicate the sprinkler system presented in this instructable but were scared by the complexity of it.

Well, it truly isn't complicated and it does not even require to solder anything if you pick the right parts... Since I long wanted to make the system more compact, I took the opportunity to make this solder-free arduino instructable. The system is very similar to (exactly the same as?) the previous instructable and just as open (supports scheduling, twitter etc...).

Connecting this arduino to your sprinkler system will allow you to remotely turn your garden watering on and off from any web-enabled device. From there you can make it as fancy or as simple as you wish.

Enjoy !

Step 1: Collect Parts

For this instructable you will need:
- 1 x arduino board
- 1 x ethernet shield (e.g. Ethernet Shield V1.0 for Arduino from )
- 1 x relay shield (
- 1 x 10vDC adaptor (a recycled phone charger)
- 1 x momentary push button

You will not need:
- a soldering iron.

Step 2: Put It Together

To put everything together, just follow the pictures, it should be fairly self-explanatory...

The push button is optionnal, it allows you to cycle manually through the sprinklers. Otherwise your only mean of control is the web interface... which is good too !

Step 3: Arduino Sketch

The sketch is very close to the one posted in my original instructable (here)

Quick comments:

- The following code turns on the pull-up resistor of the analog input. A good thing to know.

pinMode(analogInPin, INPUT);
digitalWrite(analogInPin, HIGH); // turn on pull-up resistor

- I added a check on the size of the buffer that holds the page, so you have an indication that bad things happened if the buffer was too small.

- The manual button cycles through the valves (and uses A0,A1,A2 for convenience reasons).

- The web interface can turn on/off any combination of valves.

- The valves are turned off automagically after 60 minutes (can be modified, time in seconds, 0 disables the functionality).

- Up to 4 valves can be controlled.

- Startup logic as been added to prevent spurious turn on.

Step 4: Voila ?

Everything else is covered in my previous instructable (here).

- connect the valves.
- use the web interface.
- make the system wireless.
- (optional) scripting.



snoopy007 made it!(author)2015-11-16

How could we add to this system a water level sensor, so if use water from a bucket it checks if the level of water is to low and than notifies me trough let say pushbullet.

Woodclaver made it!(author)2017-02-17


I have used the barometrically operated micro switches from Washing machines to indicate if a tank of water is full. It does require a minimum of approx ten inches of water column to act, but the switch offers both NO and NC positions to operate. (Normally Open, and Normally Closed. Closed means On.)

rohank26 made it!(author)2016-06-16

sir,in my project of smart sprinkler ,the sprinkler should automatically get on for a set duration(for ex- if i set the timer on for 5-6 am everyday the sprinkler should get on automatically on the assigned days.)So, can it be done using a RTC(real time clock module for arduino.)??It wil keep a good eye on the activities of the user

ftron made it!(author)2016-04-08

where is the HTML code's please tell me i could not find the HTML code

MarkB103 made it!(author)2015-09-08

Would it be possible to make it so it can control 8 valves?

FrancisXM made it!(author)2016-01-25

Did you ever find out if this could be modified to 8? I need a system that can handle 12 zones.

SpiritD made it!(author)2015-09-12

I am very interested in this project could you email me the details to

irinak1 made it!(author)2015-08-05


I’m irinakim and I’m work in the Wiznet.

Thank you for using our product.

I want to upload the previous post together.

Can I post your product on our Web site?

the_qdog87 made it!(author)2015-07-18

tavjas made it!(author)2013-01-15

I still cant find the _arp code on the zip file is it possible to clip it out from somewhere else?

withers.stuart made it!(author)2015-01-10

Did you come right with tracking down the piece of code in the end as I have unzipped the correct into the library directory and still nothing. When you open the ethershield.h you can see its missing these :

void ES_make_arp_answer_from_request(uint8_t *buf); // Added by Stuart

uint8_t ES_eth_type_is_ip_and_my_ip(uint8_t *buf,uint16_t len); // Added by Stuart

void ES_make_tcp_ack_from_any(uint8_t *buf,uint16_t len);

but i still get a compiling issue with Arduino IDE on line [es.ES_make_tcp_ack_from_any(buf);] saying:no matching funciton for call 'EtherShield::ES_make_tcp_ack_from_any(uint8_t[1001])'

I may be setting this up incorrectly :/

yasintha.dinuk made it!(author)2014-08-28

Nice job, I'm curious has the momentary button method changed in any way?
gd job.....

kini1985 made it!(author)2012-09-17


its pretty good idea, so i thought to apply for my lawn, but i am getting error which says that "Timer1 was not declared in the scope".....just for your reference, i already include the TimerOne.h file in my library.

nicoo made it!(author)2012-09-20

Make sure your TimerOne.h file contains:
extern TimerOne Timer1;

and that your TimerOne.cpp file contains:
TimerOne Timer1;

If they don't, use the version of I have added to this instructable (extract into hardware\libraries)

Good luck !


kini1985 made it!(author)2012-09-22

Hey thanks for replying so fast, however i used your eterShild library for my eternet shield, it is still give me below errors, what should i do?

Web.cpp: In function 'void loop()':
Web:183: error: 'class EtherShield' has no member named 'ES_make_arp_answer_from_request'
Web:187: error: 'class EtherShield' has no member named 'ES_eth_type_is_ip_and_my_ip'
Web:205: error: 'class EtherShield' has no member named 'ES_make_tcp_ack_from_any'
Web:242: error: 'class EtherShield' has no member named 'ES_make_tcp_ack_from_any'
Web:243: error: 'class EtherShield' has no member named 'ES_make_tcp_ack_with_data

nicoo made it!(author)2012-09-23

Make sure the file hardware/libraries/etherShield/etherShield.h contains:

class EtherShield
void ES_make_arp_answer_from_request(uint8_t *buf);
uint8_t ES_eth_type_is_ip_and_my_ip(uint8_t *buf,uint16_t len);

If it does, then your script is not including it, given the errors you have.

If it doesn't, then replace the whole hardware/libraries/etherShield by the zipped file I attached to this instructable.


elliott.hayes.712 made it!(author)2014-08-09

Hi could you please tell me if you have continued with this project??? I am receiving these same errors and have spent ages trying to sort them out with no result. I have even used Arduino IDE 0022 and still the same issues. Have you got a more up to date script?? many thanks

josh429 made it!(author)2014-07-18

Would there be any way to run the sprinklers on a timer, i.e. you type in a turn-on and turn-off time in the web application and the Arduino would turn on and off at these times?

crackopl made it!(author)2014-07-06

i like it :)

did similar but requirements were slightly different. now we're working on Ardu Yun platform as hope it to be more efficient in web/remote management

see here:

fmarky made it!(author)2012-09-11

Hi, I have tried to find the ehershield.h library and I think you might be using an older version of the library. I have checktout the latest with SVN from : Can you please give a link, or just upload the ehershield you have been using? Some of the class members are not there like:
ES_make_tcp_ack_with_data Thanks,

nicoo made it!(author)2012-09-11

I just added the library (

I hope this helps.


JROdden made it!(author)2014-05-06

The etherShield.h included in still doesn't include the declarations of the functions mentioned above. Can you please recheck this?

fmarky made it!(author)2012-09-13


kevinmarkmadz made it!(author)2014-02-08

How much does that valve costs??

espdp2 made it!(author)2013-12-21

I thought this was for a FIRE sprinkler, and I did a double take! Hahaha.

tintino made it!(author)2013-12-12

I think you could've done this without the ethernet shield, by using the serial port header on the router to communicate with the Arduino. Of course you would have had to write code to run on the router under dd_wrt, open_wrt ..etc

knota made it!(author)2013-06-08

Seeing that this relay shield only has 4 relays, couldn't you use this 16 relay one?

sfkhooper made it!(author)2013-04-09

This looks pretty promising for me. Just wondering, would it be possible to extend this circuit to ALSO come on briefly upon a motion sensor being triggered? I'd like this for animal/pest control. I'm somewhat experienced with Arduino programming.

ajoneill made it!(author)2013-02-26

You may have uploaded but it doesn't fix the problem!

nicoo made it!(author)2013-02-27

I have tried and compiled my code and... it compiles.
For the avoidance of doubt I am using the arduino ide 0022.
What ide are you using ?

bpike1 made it!(author)2012-09-04

Nice job, I'm curious has the momentary button method changed in any way?

I found I had to disconnect mine because I ran it in cat5 to the solenoids which caused false triggers with brown outs all the time.


nicoo made it!(author)2012-09-04

Hmm, if you are having problems like this, it is probably because your cat5 acts as a big antenna. Instead of using the internal pull up, you could consider using a resistor at the end of your cat5, so that no wire is open-ended.

Use a twisted pair for the permanent connection (Vcc and A0 if you are using my code) and connect it to a resistor (pull-up) at the far end of your cable.

Pressing the button will connect A0 to ground (when this happens, the resistor is between ground and vcc, right?).

It turns out that the only difference (not on purpose though) between version 1 and version 2 of my system is this very point: I use the pull-down resistor of the momentary button's shield instead of the arduino's internal one.

I hope this helps,



epierce made it!(author)2012-08-31

What is the voltage of your solenoid valves? 24?

nicoo made it!(author)2012-09-02

yep, 24v AC (from Gardena)

amandaghassaei made it!(author)2012-08-31

cool! what are you using each of the three zones for? can you automate each of them separately?

nicoo made it!(author)2012-08-31


The 3 zones is because I don't have enough pressure at the tap to water the entire garden at once. So I turn on one zone at a time.

I automate watering with a script in the crontab of my linux box (detailed in my other 'ible):

# m h dom mon dow command
01 19 * * 0-6 /bin/bash -on 1
21 19 * * 0-6 /bin/bash -on 2
41 19 * * 0-6 /bin/bash -on 3
51 19 * * 0-6 /bin/bash # everything off