Introduction: Automated Garden

Picture of Automated Garden

The last garden I planted next to my desk at work did not go so well. It suffered from a lack of sunlight as well as my hectic work schedule (i.e. lack of watering). It never managed to get quite enough sun or water. After a long mourning period had passed, I decided that the best way to improve the situation was to put the past behind me and start over with an automated garden.

For this project I decided to use an Intel Galileo board because it has a built in Real Time Clock, an easy Arduino-compatible interface, and a mini PCI slot for natively connecting any Intel wifi card. In this project the Galileo is keeping track of the time in order to control a grow light system. It is also monitors soil moisture and, when appropriate, engages a mini 3D printed sprinkler system that rises up of the grow bed and sprays the plants. The garden is alse equipped for easy remote monitoring and control via wifi.

For all of these reasons, I am hoping that this new office garden fares a much better fate than the last. It is my sincere hope that this garden has a long illustrious life.

Step 1: Materials

Picture of Materials

You will need:

(x1) Intel Galileo Board
(x1) Intel 6235AN Centrino wifi card
(x2) Dual band antenna
(x1) Half to full height PCI adapter
(x1) Solid state AC relay
(x3) SPST mechanical relay
(x3) 12V peristaltic pumps
(x2) Grow light fixtures with bulbs
(x1) Soil moisture sensor
(x1) PCB
(x1) 7" x 5" x 3" project enclosure
(x1) 6" x 3" x 2" project enclosure
(x2) 1/8" mono jacks
(x1) 1/8" male-to-male mono cable
(x1) 12V / 2.5A wall wart
(x1) M-type power socket
(x1) 40' - 1/4" vinyl tubing
(x1) 25' grounded 10A extension cord
(x1) 3D printer (or online 3D printing service)
(x1) 4' x 8' plywood sheet
(x2) 3' x 3/4 galvanized pipe
(x2) 18" x 3/4 galvinized pipe
(x1) 10" x 3/4 galvinized pipe
(x2) 5" x 3/4 galvanized pipe
(x2) 3" x 3/4 galvinized pipe
(x6) 3/4 galvanized pipe T-joints
(x2) 3/4 galvanized pipe L-joints
(x2) 3/4 galvanized pipe floor mounting flanges
(x1) 6' thin steel chain
(x1) Assorted wires nuts
(x1) Assorted zip ties
(x1) Assorted wire
(x1) Miscellaneous nuts and bolts
(x1) 2 mil plastic drop cloth
(x1) Large water bucket
(x1) Plants
(x1) Bag of charcoal
(x1) Bag of lava rocks
(x1) Bag of planting soil

Step 2: Cut the Plywood

Picture of Cut the Plywood

Cut the 3/4" plywood into the following pieces using a tablesaw and/or chop saw:

(x1) 70.5" x 10.5"
(x2) 72" x 12"
(x2) 10.5" x 12"
(x5) 10.5" x 3"

Step 3: Planter Base

Picture of Planter Base

Space the five 10.5" x 3" pieces of wood evenly along the legnth of the 71.5" x 3" board.

Glue them in place along these measurements at a right angle and then tack them in place with a brad nailer. Barring a brad nailer, you can also glue and clamp them.

Step 4: Build a Planter Box

Picture of Build a Planter Box

Place the base board such that all of the attached cross-sections are facing down.

Arrange the four remaining boards around the perimeter to form a box and then mark their intersections with a pencil.

Glue and nail together both of the 12" x 72" boards using the marks that you have just made as guides.

Finally, glue and nail the two end boards to complete the box.

Step 5: Grow Light Fixture Mounts

Picture of Grow Light Fixture Mounts

Gather two of the galvanized T-joints and one of the 18" galvanized pipes.

Pass the 6' chain up through the base of one of the T-joints and out the side. Next pass it through the 18" pipe. Finally pass the chain through the side of the remaining T-joint and finally out the base.

Thread together the T-joints and the galvanized pipe such that both of the bases of the T-joints are pointing in the same direction. Cut the 6' chain such that 3" of chain is sticking out of each end of the T-joints.

Finally, make a second fixture mount to match the first.

Step 6: Cut the Plug

Picture of Cut the Plug

Cut the plug off of the end of each of the grow light fixtures.

Step 7: Pass the Wire

Picture of Pass the Wire

Pass the grow light fixture wire through the base of a T-joint in the light fixture mount, then through a 5" galvanized pipe and finally all the way through an L-joint.

Thread them all together once done.

Step 8: Pipe Frame

Picture of Pipe Frame

Connect the two completed grow light fixture mounts together with a 10" galvanized pipe.

Step 9: Light Mount Legs

Picture of Light Mount Legs

Pass the grow light fixture cord through one of the 3" galvanized pipes and thread it onto the respective L-joint.

Repeat on the other side.

Step 10: Drill

Picture of Drill

Drill 3/4" holes in the center of each of the 3" tall boards on the underside of assembly.

Drill another 3/4" hole in line with all of the other holes in one of the outer 12" x 10.5" boards.

Step 11: Line the Box

Picture of Line the Box

Line the inside of the box with 2mil plastic sheeting and staple it neatly into place.

Step 12: Mounting Base

Picture of Mounting Base

Pass a grow light fixture wire in series through the T-joints, 3" galvanized pipe and 3/4" floor mounting flange. Thread these firmly in place to the 3' galvanized pipe.

Repeat on the other side.

The bases of each of the new T-joints should be pointing towards each other.

Step 13: Mark, Drill and Mount

Picture of Mark, Drill and Mount

Raise the galvanized pipe assembly and position it centered upon the inside of the grow bed.

Mark the mounting holes for each flange on the bottom of the bed.

In the center of each set of mounting holes, drill a 3/4" hole.

Pass the grow light fixture wires through each respective hole, and then securely attach the flange with 3/4" wood screws.

Step 14: Thread a Wire

Picture of Thread a Wire

Cut the socket end off of a 25' grounded extension cord.

Pass this wire through the outer hole of the box, and then through each respective hole in the base supports until it reaches the lamp fixture wire on the other end.

Step 15: Connect

Picture of Connect

Connect together the lamp fixture wire and the end of the extension cord using wire nuts.

Step 16: Tubing

Picture of Tubing

Pass three 1/4" vinyl tubes through the base of the lower T-joint closest to the hole on the outside of the planter.

Finally, pass it through the outer hole.

Step 17: Soil Sensor

Picture of Soil Sensor

Like the vinyle tubing, pass the wire from the soil sensor into the T-joint and out the planter.

Step 18: Mini Sprinklers

Picture of Mini Sprinklers

3D print the attached sprinkler files, while keeping in mind that SprinklerTop.stl and SprinklerTopSpray.stl are an assembly and need to be printed as one piece. This will require a 3D printing process that can print nested/moving parts. The 123D Design files have also been included so that they could be modified for other printing processes.

After the prints are completed and cleaned off, twist the top assembly and the bottom part firmly together.

Step 19: Drill Some More

Picture of Drill Some More

Take the 6" x 2" x 3" project enclosure and drill a 3/4" centered upon one of the smaller side and a 1/4" hole centered upon the other.

Step 20: Mono Jack

Picture of Mono Jack

Solder a 150 ohm resistor and a black wire in series to the barrel lug of the mono jack.

Solder a red wire to the signal tab.

Step 21: Relay Box

Picture of Relay Box

Mount the relay into the drilled project enclosure.

Pull some slack from the extension cable into the first compartment under the planter where the unconnected lighting fixture is and cut the slack in half.

Insert both ends of the extension cable and the light fixture cord into the 3/4" hole in the project enclosure.

Connect the black wire from the plug end of the extension cable to one of the AC terminals on the relay.

Connect another loose black wire to the other AC terminal.

Twist the other end of the loose black wire together with all of the other unconnected black wires using a wire nut.

Twist together all of the unconnected green wires with a wire nut.

Twist together all of the unconnected white wires with a wire nut.

Connect the red wire from the mono socket to the positive DC terminal on the relays and the black wire the negative DC terminal.

Finally, mount the jack to the enclosure using its mounting nut.

Step 22: Mount

Picture of Mount

Affix the relay enclosure to the underside of the planter box in the first compartment using wood screws.

Step 23: Soil

Picture of Soil

Spread a layrer of soil and lava rocks on the bottom of the planter to account for the lack of drainage.

Next fill it with the soil of your choice.

Step 24: Sprinklers

Picture of Sprinklers

Spread the sprinklers evenly apart and connect the vinyl tubing to their valve.

Bury the sprinklers and vinyl tubing such that just the sprinkler caps are sticking out of the soil.

Step 25: Arrange Plants

Picture of Arrange Plants

Arrange your plants however you see fit.

Step 26: Plant the Plants

Picture of Plant the Plants

Plant the plants into the soil.

Step 27: Wire the Motors

Picture of Wire the Motors

Attach a red wire to the + terminal of one of the peristaltic pump motors.

Attach a black wire to the other terminal.

Repeat this process for all of the motors.

Step 28: Motor Panel

Cut out the motor panel out of 1/8" acrylic using the attached template.

Step 29: Mount the Motors

Picture of Mount the Motors

Insert the motors into the holes in the motor panel and bolt them securely into place.

Step 30: Wire the Motors and Relays

Picture of Wire the Motors and Relays

Solder the three SPST relays to the circuit board.

Wire them to the motors as specified in the schematic.

Step 31: Drill the Enclosure

Picture of Drill the Enclosure

Drill a 3/4" hole at the bottom of one of the smallest faces of the larger project enclosure.

Then drill two 1/4" holes spaced 2" apart centered upon the same face of the enclosure.

Drill two more 1/4" holes 2" apart centered upon the 3" x 7" face.

Place the Galileo and relay board inside of the enclosure and make marks on the bottom for each of their respective mounting holes.

Finally, drill each of these holes with a 1/8" drill bit.

Step 32: Program

Picture of Program
Upload the following code to your Galileo board:

// Code for a Self-Regulating Garden using an Intel Galileo board
// More info can be found at: https://www.instructables.com/id/Smart+Garden

// Include Sensirion library
//http://playground.arduino.cc/Code/Sensirion
#include <Sensirion.h>

// Sensor pins
const uint8_t dataPin = 6;
const uint8_t clockPin = 7;

// Variables for the temperature & humidity sensor
float humidity;

//buffer for reading the time
char buf[9];

//threshold to compare water moisture to
//change this number fit your setup
float threshold = 50.0;

//Define the pins for the lights and motors
int growlights = 4;
int motor1 = 9;
int motor2 = 10;
int motor3 = 11;

void setup() {                
 
  Serial.begin(115200);
  
   //sets the date & time to 12:00 15th Sept 2014
   //change accordingly
  system("date 091512002014");
 
  // initialize the digital pins as an outputs.
  pinMode(growlights, OUTPUT); 
  pinMode(motor1, OUTPUT);     
  pinMode(motor2, OUTPUT);     
  pinMode(motor3, OUTPUT);     

}

// the loop routine runs over and over again forever:
void loop() {
  
  //get current time in the format- hours:minutes:secs
  //and save in text file time.txt located in /home/root
  system("date '+%H:%M:%S' > /home/root/time.txt");  
  
  //opens the time.txt file and buffers the last time recorded                                               
  FILE *fp;
  fp = fopen("/home/root/time.txt", "r");
  fgets(buf, 9, fp);
  fclose(fp);

 
  //checks to see if it is 7:30 in the morning
  //and if so turns light on
  //also checks soil moisture 
  //and turns on sprinklers for 20 seconds if dry
  if (strcmp(buf, "7:30:00")  == 0){ 
     Serial.println("hi");
     LightOn();

     // Make a moisture measurement every morning
     soilSensor.measure(&humidity;);
     if(humidity > threshold){
         EngageSprinklers();
         delay(20000);               
         DisengageSprinklers();
     }
   }
    
   //Turns off the lights at 7:30 at night
   if (strcmp(buf, "19:30:00")  == 0){ 
     Serial.println("hi");
     LightOff();
   }
}


//function for turning grow lights on
void LightOn(){
  digitalWrite(growlights, HIGH); 
}

//function for turning grow lights off
void LightOff(){
  digitalWrite(growlights, LOW);
}


//function for turning sprinklers on
void EngageSprinklers(){
  digitalWrite(motor1, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(motor2, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(motor3, HIGH);   // turn the LED on (HIGH is the voltage level)
}

//function for turning sprinklers off
void DisengageSprinklers(){
  digitalWrite(motor1, LOW);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(motor2, LOW);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(motor3, LOW);   // turn the LED on (HIGH is the voltage level)
}

Step 33: Mount the Galileo

Picture of Mount the Galileo

Attach the wifi card and antennae to the Galileo board if you have not done so already

Mount the Galileo in the enclosure using nuts and bolts.

Insert the threaded antenna connectors into the two holes in the larger side of the case and fasten them in place with mounting nuts.

Attach an antenna to each of the connectors.

Step 34: Prepare the Mono Jack

Picture of Prepare the Mono Jack

Solder a black wire to the barrel terminal of a mono jack.

Solder a red wire to the signal terminal of the mono jack.

Step 35: Mount the Rest

Picture of Mount the Rest

Affix the relay board to the inside of the case using mounting hardware.

Now would also be a good time to mount the mono jack to the inside of the case using its mounting nut and also the M-type power jack using its mounting nut as well.

Step 36: Extend the Sensor Cable

Picture of Extend the Sensor Cable

Extend the sensor cable using a 4-wire insulated cable (if necessary).

Step 37: Wire It Up

Picture of Wire It Up

Attach the relays and the sensor to the Galileo board as follows:

AC Relay --> Digital Pin 4**
DC Relay 1 --> Digital Pin 9
DC Relay 2 --> Digital Pin 10
DC Relay 3 --> Digital Pin 11

Sensor data (blue wire) --> Digital Pin 6
Sensor clock (yellow wire) --> Digital Pin 7
Sensor ground --> Ground
Sensor power --> +5V

**The AC relay is actually the signal wire on the mono jack.

Step 38: Close the Case

Picture of Close the Case

Fasten the case shut using the appropriate hardware.

Step 39: Tubing Connectors

Picture of Tubing Connectors

3D print six tubing connectors using the attached files.

Step 40: Insert the Connector

Picture of Insert the Connector

Insert the small end of each of the tubing connectors into the tubes coming out of the peristaltic pumps.

Step 41: Light Bulb

Picture of Light Bulb

Insert the light bulbs into the socket.

Step 42: Mono Cable

Picture of Mono Cable

Plug the mono cable into the relay board mounted beneath the planter.

Step 43: Bury the Sensor

Picture of Bury the Sensor

Bury the moisture sensor just below the surface of the soil.

Step 44: Connect the Tubing

Picture of Connect the Tubing

Connect the 1/4" tubing from the sprinklers to the output of the peristaltic pumps.

Connect more 1/4" tubing between the peristaltic pumps and the water reservoir.

Step 45: Plug Everything In

Picture of Plug Everything In

Plug in the 12V supply for the motors, the 5V supply for the Galileo circuit and the grounded AC plug for the grow lights.

Step 46: Automated Gardening

Picture of Automated Gardening

Care for your plants in style with your new automated garden.

Comments

teknohawk (author)2016-12-07

Do you find a standard 12v peristaltic dosing pump has adequate speed, power and pressure?

randofo (author)teknohawk2016-12-07

The ones I was using seemed to work fine.

teknohawk (author)randofo2016-12-12

Okay good to hear, thanks

Leathaldose (author)2016-01-24

I loves this instructable!~ It has more then 3 or 4 steps, kept me interested till the end.

nhienly93 (author)2015-11-14

thanks this project :) can you tell me how much is this?

whitefeatherhunter (author)2015-10-04

Holy shit! What an awesome project! I'm curious about the final cost.

belsey (author)2015-10-02

This has been a while... how's the garden now?

sitinafiah1801 (author)2015-09-09

amazing project

frivolas (author)2015-06-03

Nice project! I like how you keep the functionality really simple. Just water once a day and keep the lights on all day long. It'd be nice to add a photoresistor array to check what's the environment lighting, especially if you're gonna place your garden near a window. Question, have you implemented the monitoring via wifi? Cheers!

kbowerma (author)2015-04-27

I am wondering why you don't need a resistor in series with the SPST relays to the pumps? Wont they overheat?

randofo (author)kbowerma2015-05-05

I didn't feel it was necessary. I suppose you can put in a 1K (or less) resistor to protect the microcontroller pin, but you would want to make sure that the relays still latch once that is there.

olivia11 (author)2015-03-29

cool

fredjames1 (author)2015-03-19

Great work

smartmiltoys (author)2015-02-23

It is amazing!

JackB12 (author)2015-01-23

This is pretty cool, I considered doing something similar but then I got into closed loop systems and I decided to go with Aquaponics. I still want to use my Galileo or Pi to monitor the system, to alert water temps and water levels (in event of clogging and flooding). Also, something your video showed was how ridiculously bright the grow lights are to have in a working environment. I have also run into this issue, and have moved my box to a window, so it gets more natural lighting while I am working, and then it gets the grow lights when I'm away. I'd like to come up with a clever light solution that doesn't blind me while I'm working. I should note, in the picture below I added backing so that the fish wouldn't go crazy from all of the sunlight.

davis31 (author)2015-01-21

really awesome

Deepakjuneja (author)2015-01-21

its amazing

david_barreda (author)2014-12-14

Do you use Linux on Galileo?

midnightcow (author)2014-11-20

Wow. It's amazing.

Great jobs! It is very well-noted.

FamilyGuy2006 (author)2014-10-29

Great job! Looks great! I bet if you just use an epoxy paint on the metal that is under the soil you can take care of that 'no zink in the soil' issue. I'm impressed that you have a good seal under that metal bracket. I would have thought a small piece of closed cell foam would have been needed as a gasket to seal those holes. Amazing! And well documented too. Thanks for contributing.

Lizzy2 (author)2014-10-28

This is really cool; Do you know how I could make this on a smaller scale( around 5 inches by 12?

MT1 (author)2014-10-09

Same with other holes. No punctures below soil line and no galv. under soil. Toxic to most plants. Move fittings to outside of box and use an elbow.

MT1 (author)2014-10-09

Please review stapling the liner. No staples should be used below the waterline/soil line. Look up installing deep water hydroponic or aguaponic systems and shrink to fit your planter. Basicly fold the liner corners and only staple the top edge of the wood.

raimonds.liep (author)2014-10-08

Hey, great instructable. What kind of soil sensor did you use for this project?

inkstom (author)raimonds.liep2014-10-09

It looks like this one from Adafruit

http://www.adafruit.com/products/1298?gclid=CjwKEAjw5NihBRCZmdLkuuTHyWYSJACtCY0Jwet9mVcmFWxAc1baKwgEddrr7Jur09SyuDd9fMDsaRoCbqbw_wcB

randofo (author)raimonds.liep2014-10-09

http://www.adafruit.com/products/1298

carl.ma.52 (author)2014-10-09

awesome! Wondering if it can be modified to use outdoor.

Robocrafter (author)2014-10-08

Cool

mikeasaurus (author)2014-10-07

Nice foliage. Needs more plastic dinosaurs

BrownDogGadgets (author)2014-10-07

Wow! Impressive!

MsSweetSatisfaction (author)2014-10-07

Awesome! Now office plants will have a chance at a decent life!

About This Instructable

96,305views

959favorites

License:

Bio: My name is Randy and I founded the Instructables Design Studio. I'm also the author of the books 'Simple Bots,' and '62 Projects to ... More »
More by randofo:Large Motor ProjectsRemove a Wheelchair Motor BrakeBuild a Robot
Add instructable to: