Introduction: Automated Garden

About: My name is Randy and I am a Community Manager in these here parts. In a previous life I had founded and run the Instructables Design Studio (RIP) @ Autodesk's Pier 9 Technology Center. I'm also the author of t…

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

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

(Note that some of the links on this page are affiliate links. This does not change the cost of the item for you. I reinvest whatever proceeds I receive into making new projects. If you would like any suggestions for alternative suppliers, please let me know.)

Step 2: 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

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

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

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

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

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

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

Step 9: 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

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

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

Step 12: 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

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

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

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

Step 16: 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

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

Step 18: 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

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

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

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

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

Step 23: 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

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

Arrange your plants however you see fit.

Step 26: Plant the Plants

Plant the plants into the soil.

Step 27: 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

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

Step 30: 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

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

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

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

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

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

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

Step 37: 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

Fasten the case shut using the appropriate hardware.

Step 39: Tubing Connectors

3D print six tubing connectors using the attached files.

Step 40: 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

Insert the light bulbs into the socket.

Step 42: Mono Cable

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

Step 43: Bury the Sensor

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

Step 44: 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

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

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

Did you find this useful, fun, or entertaining?
Follow @madeineuphoria to see my latest projects.