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 http://www.nuelectronics.com )
- 1 x relay shield (http://seeedstudio.com/wiki/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.

Voila.

Comments

author
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.

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

Hi:

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

author
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

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

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

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

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

author
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.

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

I am very interested in this project could you email me the details to muzjanny@gmail.com

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

Hi,

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?

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

author
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?

author
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 etherShield_1.1.zip 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 :/

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

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

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

Hey,

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.

author
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 TimerOne.zip I have added to this instructable (extract into hardware\libraries)

Good luck !

N.

author
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

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

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

[...]
class EtherShield
{
public:
[...]
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);
etc...
[...]

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.

N.

author
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

author
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?

author
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: https://www.instructables.com/id/Watering-Garden-with-GARD-A-WATER-Arduino-Project/

author
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 : http://ethershield.googlecode.com/svn/trunk/ 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_arp_answer_from_request
ES_eth_type_is_ip_and_my_ip
ES_make_tcp_ack_from_any
ES_make_tcp_ack_with_data Thanks,
MarKo

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

I just added the library (etherShield_1.1.zip).

I hope this helps.

Regards,
N.

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

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

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

Thanks

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

How much does that valve costs??

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

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

author
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

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

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

http://www.amazon.com/gp/product/B0057OC66U/ref=ox_sc_act_title_2?ie=UTF8&psc=1&smid=A10EAPE4CAYC9P

author
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.

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

You may have uploaded etherShield_1.1.zip but it doesn't fix the problem!

author
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 ?
N.

author
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.

Thanks

author
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,

Regards,

N.

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

What is the voltage of your solenoid valves? 24?

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

yep, 24v AC (from Gardena)

author
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?

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

Thanks.

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 sprinkler.sh -on 1
21 19 * * 0-6 /bin/bash sprinkler.sh -on 2
41 19 * * 0-6 /bin/bash sprinkler.sh -on 3
51 19 * * 0-6 /bin/bash sprinkler.sh # everything off

Regards,
N.