Automated Garden

by randofo in Circuits > Electronics

106892 Views, 1022 Favorites, 0 Comments

Automated Garden

main1.jpg

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.

Materials

1A.jpg

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

Cut the Plywood

2A.jpg
2B.jpg

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"

Planter Base

3A.jpg
3B.jpg
3C.jpg
3D.jpg
3E.jpg

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.

Build a Planter Box

4A.jpg
4B.jpg
4C.jpg
4D.jpg
4E.jpg
4F.jpg
4G.jpg

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.

Grow Light Fixture Mounts

5A.jpg
5B.jpg
5C.jpg
5D.jpg
5E.jpg
5F.jpg

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.

Cut the Plug

6A.jpg
6B.jpg
6C.jpg

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

Pass the Wire

7A.jpg
7B.jpg
7C.jpg

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.

Pipe Frame

8A.jpg

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

Light Mount Legs

9A.jpg
9B.jpg

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.

Drill

10A.jpg

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.

Line the Box

11A.jpg
11B.jpg
11C.jpg

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

Mounting Base

12A.jpg
12B.jpg

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.

Mark, Drill and Mount

13A.jpg
13B.jpg
13C.jpg
13D.jpg
13E.jpg
13F.jpg
13G.jpg
13H.jpg

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.

Thread a Wire

14A.jpg
14B.jpg

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.

Connect

15A.jpg
15B.jpg

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

Tubing

16A.jpg
16B.jpg

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.

Soil Sensor

17A.jpg

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

Mini Sprinklers

18A.jpg
18B.jpg
18C.jpg
18D.jpg

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.

Drill Some More

19A.jpg
19B.jpg
19C.jpg

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.

Mono Jack

20A.jpg

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.

Relay Box

21A.jpg
21B.jpg
21C.jpg
21D.jpg
21E.jpg

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.

Mount

22A.jpg
22B.jpg

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

Soil

23A.jpg
23B.jpg
23C.jpg
23D.jpg
23E.jpg
23F.jpg

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.

Sprinklers

24A.jpg
24B.jpg
24C.jpg
24D.jpg

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.

Arrange Plants

25A.jpg
25B.jpg

Arrange your plants however you see fit.

Plant the Plants

26A.jpg
26B.jpg
26C.jpg
26D.jpg

Plant the plants into the soil.

Wire the Motors

27A.jpg
27B.jpg

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.

Motor Panel

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

Mount the Motors

28A.jpg
28B.jpg
28C.jpg

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

Wire the Motors and Relays

schematic.png
29A.jpg
29B.jpg
29C.jpg
29D.jpg
29E.jpg

Solder the three SPST relays to the circuit board.

Wire them to the motors as specified in the schematic.

Drill the Enclosure

30A.jpg
30B.jpg
30C.jpg
30D.jpg
30E.jpg
30F.jpg

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.

Program

31A.jpg
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)
}

Mount the Galileo

32A.jpg
32B.jpg
32C.jpg

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.

Prepare the Mono Jack

41A.jpg

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

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

Mount the Rest

33A.jpg
33B.jpg

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.

Extend the Sensor Cable

34F.jpg
34C.jpg
34B.jpg
34A.jpg
34D.jpg
34E.jpg

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

Wire It Up

35A.jpg

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.

Close the Case

36A.jpg
36B.jpg

Fasten the case shut using the appropriate hardware.

Tubing Connectors

37A.jpg

3D print six tubing connectors using the attached files.

Downloads

Insert the Connector

38A.jpg
38B.jpg

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

Light Bulb

39A.jpg

Insert the light bulbs into the socket.

Mono Cable

40A.jpg

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

Bury the Sensor

43A.jpg
43B.jpg

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

Connect the Tubing

42A.jpg
42B.jpg

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.

Plug Everything In

44A.jpg

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

Automated Gardening

46A.jpg
45A.jpg

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.