Garduino: Gardening + Arduino

 by liseman
Featured
Garduino is a gardening Arduino. So far, Garduino:
-Waters my plants whenever their soil moisture level drops below a predefined value.
-Turns on grow lights, but only when it's dark out and only long enough to make the plants get 15 hours of total light (sunlight + supplemental light) daily.
-Alerts me if the temperature around the plants drops below 50 degrees.

This is the first grow-light and auto-water setup i know of that takes into account natural sunlight received and soil moisture level before turning on water / light.

This and other projects I've built are available as kits / products at my website.

I heavily relied on knowledge / inspiration / encouragement from:
-Mikey Sklarand his many green-tech projects
-Selwyn Pollit's permaculture knowledge
-Mitch Altman, for giving me a long-overdue lesson on how to properly solder

Future expansions might include:
-Teaching my Garduino to brew his own compost tea from greywater.
-Using pulsed, red-and-blue LED grow lights (like Mikey Sklar's setup) to significantly increase efficiency.
-Adding a solar panel and batteries to remove any need for a power grid.
-Testing for soil ph level and air CO2 content.
 
Remove these adsRemove these ads by Signing Up

Step 1: Obtain Your Materials

parts.jpg
I built this using recycled / free materials wherever I could think to. It cost significantly less than $100 in total. Here's what I used:

The relays:
2 http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?jameco_page=42&langId=-1&productId=187151&catalogId=10001&freeText=omron+g5le-1&storeId=10001&search_type=all&ddkey=http:StoreCatalogDrillDownView
Omron G5LE-1 relays]
2 http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=1537918&
1N4004 diodes]
1 A.C. extension cord
1 A.c. power cord
1 A. C. outlet

The watering system:
1 Tiny clean-water pump
1 Plastic milk jug
~2 Old road bike tubes
1 Milk crate
String

The lighting system:
1 4' fluorescent light fixture
1 "plant type" fluorescent bulb (I used the Ott-Lite, but any bulb marketed as for plants should be fine)

The soil moisture sensor:
2 galvanized nails, 1-4" in length

The light sensor:
1 photocell

The temperature sensor / alert:
1 LED (any you'd use with an Arduino will do)
1 10k-ohm thermistor

The plants and holders:
A variety of seeds, preferably that'll grow into things you'd like to eat. Everywhere, I hear people recommend swiss chard as an easy starter plant...

Planting containers:
As many plastic milk jugs as you'd like. I used ~30.
28-gallon clear plastic storage containers. You'll need one for every 6 milk jugs.
~5 red bricks for each storage container, or anything else that will allow the milk jugs to stand at least an inch off the bottom of the container.

Soil mixture:
I used Mel's Mix, the mixture recommended in "The Square Foot Gardener." It consists of 1/3 peat moss, 1/3 coarse vermiculite, and 1/3 mixed compost, with the mixed compost coming from at least 6 different sources. I've heard lots of people bash peat moss and vermiculite's sustainability (not to mention vermiculite's obscenely-high price), so definitely explore your options here. As I understand it, you want something w/:
-lots of plant nutrients (the mixed compost)
-water retention (peat moss / vermiculite)
-'fluffiness:' soil should be light so plants can easily grow their roots through and you can easily remove plants from it (vermiculite / peat moss)

Tools / Miscellaneous
Multimeter
Wire stripper
Solder
Electrical tape
3 ~10k-ohm resistors
1 ~210-ohm resistor (for the LED)
several feet 22-gauge wire
1 Arduino (in my case a Duemanilove, but any should work)
1 Protoshield (Ladyada's model)
1 mini circuit board
Hot glue gun, with glue
1-40 of 98Next »
durgenflabbit says: Dec 14, 2011. 5:09 PM
hey liseman,

From what I can tell, excellent tutorial. I am kind of new to arduino but I really want to try this one out, I figure Im a fast learner.

But the 2nd link on your materials list is broken, or at least doesn't link me to a product that still exists. Just wanted to make sure I got the right diodes. If you could point me in the right direction I'd appreciate it. But then again, I dont even see where you used them, unless I missed something. Thanks again.
daley045 in reply to durgenflabbitFeb 12, 2012. 7:34 PM
I am working on replicating a similar project and have spent most of the day getting the water pump figured out. This is where you need the diodes. I am setting up a drip hydroponic system that turns the pump on and off with a set time interval. What I understand is that when the motor turns off it sends a high voltage shock through the system. I have unfortunaly / naively been using only a 50v diode which was not enough to protect the system from the voltage generated by the 120 volt water pump. I am new to electrical systems. Does anyone know what diode I should be using.
cgosh in reply to daley045Jan 3, 2013. 12:09 AM
When you put DC on the wire coil in a relay, solenoid, motor, etc., it creates a magnetic field that pulls the armature or plunger, spins the motor, etc. When your control circuit switches the DC off, the magnetic field that's still in the coil collapses into the coil, turns its energy back into electricity and sends a very brief, reverse-biased, high-voltage pulse back down the wire (reverse EMF, or Electro-Magnetic Field).

The diode must be reverse-biased (positive lead on the negative supply wire, negative lead/band on the positive wire) to short this pulse out. If you don't do this, the reverse EMF can blow up the low-voltage semiconductor that's controlling the solenoid or motor. If you connect the diode "the way you'd expect" it simply shorts the control voltage (very bad). The diode should be as close to the coil as possible for maximum effectiveness. 1N4004 (400 Volts @ 1 amp) diodes are cheap and plentiful, motor controllers are not.

If you're ordering a relay, you may find that you can get one with a built-in diode on the coil. If you're powering your motor or other coil with a mechanical switch (like metal relay contacts) instead of a semiconductor device, you don't need the diode.
daley045 in reply to daley045Feb 14, 2012. 10:30 AM
Never mind. A 1N4004 diode should be good for 400v.
forsey says: Sep 20, 2012. 4:09 PM
Here's my effort - it only does the watering side of things, but includes code to provide live monitoring via a web based graph.

http://theon.github.com/plant-watering-with-arduino.html
ben.chapman says: Jun 11, 2012. 4:41 PM
You should post this on Farmhack.com, It's a community of DIY farming and gardening technologies!
diy_bloke in reply to ben.chapmanSep 7, 2012. 9:35 AM
Farmhack.com is a domain for sale at godaddy. would you mean Farmhack.net?
ben.chapman in reply to diy_blokeSep 15, 2012. 2:47 PM
LeskoIam says: Jul 23, 2012. 9:25 PM
Hey!
I was wandering if someone already tried to calibrate moisture sensors like you proposed? Yes, and did someone use similar system for hydroponics?
I'm just starting to build my own system and but I will probably switch to hydroponics. Really cool idea and implementation!
marcuantonio says: Jun 29, 2012. 7:45 AM
Hello.

Im bringing garduino back to life, I want to play with the ethernet shield.

However, Im getting an error, saying 'DateTime' was not declared in this scope.

Would you know how to fix this?

Thanks
ReagenWard says: Oct 25, 2009. 5:49 PM
How's it working over time?  Almost everyone tries nails first, then moves to gypsum or the like, and if they want accuracy, they end up with a tensiometer.

Also, DC is known to be a problem for moisture sensors over time - have you considered AC or are you just replacing your probes often?
diy_bloke in reply to ReagenWardMay 6, 2012. 12:23 PM
As a matter of fact, I tried gypsum first and then went to bare spikes. Gypsum is a bother and the sensors actually fall apart quite soon. Also they are slow in reacting.

With regard to the DC. I have not seen any problems yet with my spikes that have been in the ground for a year., but what you could do is provide the positive feed to yr spikes from an arduino pin and only switch that on right before you measure and then off again ofcourse
liseman (author) in reply to ReagenWardNov 10, 2009. 10:00 AM
Hi ReagenWard,

I'd recommend checking all components of the system every ~month, or if you notice anything odd.  Using galvanized nails seems to help things and, if you really want to play it safer, you can modify the code to only set the pin to the moisture sensors high when you're reading the moisture value.

Hope this helps,
Luke
typomaniac in reply to lisemanMay 17, 2011. 1:22 AM
sounds like a good idea. Do you have an idea how to modify the code to achieve this? I am not very experience with arduino yet..

thank you so much!
tm
diy_bloke in reply to typomaniacMay 6, 2012. 12:26 PM
Have a look here on how to write such a code: http://arduinodiy.wordpress.com/2012/04/29/garduino-an-arduino-sort-of-for-your-garden/ if you haven't already found out how to do that
ReagenWard in reply to lisemanNov 10, 2009. 10:29 AM
Good advice.  Thanks!
deqwer says: Mar 10, 2012. 6:42 PM
i built the whole thing up but when i run some test and found out that my moisture sensor seem to be receiving an unstable read .the read runs between 707 and 560 i check the connection is ok,and the soil is basically wet
diy_bloke says: Nov 29, 2011. 1:02 AM
I have used galvanized nails for some time now and they do well. In order to combat oxydation one could feed them with AC (=getting the voltages from two digital pins that you alternately switch from high to low), but I found it easier to just switch off the voltage to the pins and only switch it on when I am doing a reading.

I have these pins in the ground for a year now and they still look fine. Since winter is coming, I took them out, gave them a quick clean with a brillo. They will go back in the soil in the spring.

If they really look bad, I will just replace them
marcuantonio says: Nov 22, 2011. 1:58 PM
I get these values, Im concerned that the seconds lit is not changing and hence the achieved is not changing either.

The lights are on however.

Is this normal?


moisture sensor reads 614
light sensor reads 107
temp sensor reads 489
seconds elapsed total = 0.00
seconds lit = 0.00
proportion desired = 0.58
proportion achieved = 0.00
moisture sensor reads 627
light sensor reads 118
temp sensor reads 490
seconds elapsed total = 27.00
seconds lit = 0.00
proportion desired = 0.58
proportion achieved = 0.00
liseman (author) in reply to marcuantonioNov 22, 2011. 5:27 PM
hi marcuantonio,

do you have a light connected, and is it turning on?
marcuantonio in reply to lisemanNov 22, 2011. 6:10 PM
Yes, I do have a light connected. I lowered this value and that gave seems to have helped doing the seconds of light desired and achieved.


//update time, and increment seconds_light if the lights are on
seconds_for_this_cycle = DateTime.now() - seconds_elapsed_total;
seconds_elapsed_total = DateTime.now() - start_time;
if (light_val > 120)
marcuantonio says: Nov 11, 2011. 2:54 PM
Hi, I got the kit, and have assembled it. I get some info on the serial monitor, but have not got the lights to turn on. Is there anything you might suspect I am doing wrong?

Thanks!

liseman (author) in reply to marcuantonioNov 11, 2011. 7:43 AM
hi marcuantoio,

try connecting a different light or other electrical device, and see if that works. if so, the problem's your light. if not, check connections and verify with the serial log that the lights are actually being triggered. have you run the test code? if so, what happens when it says 'turning light on?'
marcuantonio in reply to lisemanNov 11, 2011. 7:58 AM
I have one light attached to the light board, and a light to the water board. Neither is doing anything. I tried them on, on an oulet, connectting the two lead that would go into the board, and they worked fine.

At some point, the board for the light was giving me tiny electroschocks

I changed them and now they are fine

marcuantonio in reply to lisemanNov 11, 2011. 7:56 AM
Hi,
Where is the test code?
marcuantonio in reply to marcuantonioNov 11, 2011. 8:13 AM
I found the test code, sorry about that. I think there is a problem with the pcb, it doesnt fit snuggly on top of the ARduino. When I sandwch them together the red LED turns on.
thekatr2 says: Sep 13, 2011. 7:23 AM
cool project
dotdash says: Aug 29, 2011. 2:06 AM
Hi Luke,

Thanks for this fantastic instructable, I'm currently using it as the basis for a system as part of an art installation. It's my first foray into using Arduino, and as you say, it's ambitious but I'm getting there, slowly but surely!

You can see my progress here: http://iwilltakeyoueverywherebianca.tumblr.com

if you're interested.

Pip
rmullins says: Jul 21, 2011. 8:37 AM
I've never done anything with Arduino, what would you recommend in getting started?
liseman (author) in reply to rmullinsJul 27, 2011. 6:20 AM
this is my favorite beginner's guide: http://www.ladyada.net/learn/arduino/index.html . good luck!
FredicvsMaximvs says: May 1, 2010. 10:21 PM
Just curious, why galvanized? Why not stainless steel? Is there something in the chemistry that makes this work better?
Glider-diver in reply to FredicvsMaximvsJul 26, 2011. 3:36 PM
Ever try soldering to stainless steel? :-)
Super_Nerd in reply to FredicvsMaximvsApr 26, 2011. 9:38 AM
galvonized is coated with zinc so the metal doesnt oxidize

I belive there is no difference with stainless steel except it is an alloy not an electro-plating

there probably is no difference but price
jbuchanan6 says: Jul 20, 2011. 9:07 PM
Inspired by your garduino i have implemented my own. You can see my version here http://web.mac.com/sillyfunnypedro/garden/1234.html

Awsome project. Thanks for all the details. I have pointed people back here

Sillyfunnypedro
sweenes says: Jul 18, 2011. 5:45 PM
Great project! I just finished my version of this which is solar powered with a windshield washer pump, no sensors yet but its working great coded with 4 hour delay in waterproof box. Thanks for posting this!
typomaniac says: Jun 15, 2011. 1:28 AM
hey : ) is there a special reason why you chose a 10 k resistor? what would happen if i take a higher or lower resistor?

thank you!

tm
tracyscott says: May 25, 2011. 12:12 AM
You need to install the DateTime library into your Arduino environment.

Download it from here:
http://www.arduino.cc/playground/Code/DateTime

On my Mac, I ended up putting it here:
$ pwd
/Applications/Arduino.app/Contents/Resources/Java/libraries

At the same level as the existing libraries:
$ ls
DateTime DateTimeStrings Ethernet LiquidCrystal SPI SoftwareSerial Stepper
DateTimeBad EEPROM Firmata Matrix Servo Sprite Wire

Restart Arduino and it should show up in the menus under:

Sketch > Import Library

Read more here:
http://www.arduino.cc/en/Main/Libraries
mhkabir says: Dec 21, 2009. 11:33 PM
I would like to run this off a 12v Solar Panel and a small battery bank.What changes are necessary to the system?? I don't want to run it off the mains at all.

Some basic changes would be to get a 12v pump and a 12v light. Also a regulator would be necessary to get 9v power to the Arduino.

Also I don't have a protoshield.Is it absolutely necessary? I will use a Duemanilove.I will order it in a few weeks.

Kabir
liseman (author) in reply to mhkabirDec 24, 2009. 11:03 AM
hi mhkabir,

here's a version i did running off a voltaic solar panel .  the relays i used will work with dc or ac.  if you want to go with a 12volt pump, marine bilge pumps like this appear to be good bets.

and, a protoshield definitely isn't necessary: it just makes wiring the connections to the arduino easier.

best of luck,
luke
mhkabir in reply to lisemanDec 24, 2009. 5:42 PM
 Is it also necessary to have 'plant-style' fluorescents or will normal ones do??
1-40 of 98Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!