Introduction: The Plant Buddy

Having a home garden can be beneficial to a person’s health because of its therapeutic qualities and also by supplying them with fresh vegetables and/or fruit. The downside to having a garden is that it is time consuming, requires constant attention, and is difficult to measure exactly how much water and sunlight a plant needs. But what if there could be a device that could allow anyone, regardless of schedule, to maintain their very own garden? Well now there is! Welcome to the world of The Plant Buddy!

The Plant Buddy has been developed to promote healthy eating lifestyle as well as helping people get into a new hobby without spending large amounts of time and money. The Plant Buddy costs around 80$ depending on what parts one might use to build the Plant Buddy (PVC pipe, water bottle, plastic container, etc.)

Step 1: Inventory

Electronic Parts Needed:

  • Arduino Uno
  • Bread Board
  • Potentiometer
  • 3 LED's
  • 1 RGB LED
  • 1 Servo
  • 1 Photo resister
  • 1 Soil Humidity Sensor
  • 7 330 resistors
  • Arduino Uno Power Supply
  • M/F Jumper Wires

Structural Parts Needed (subject to your own creativity)

  • Conduit Box 8x8x4
  • Conduit Pipe (cut to desired height)
  • Water Bottle
  • Balloon
  • Electrical Tape
  • Light Switch Plate
  • 2 Nuts/Bolts(1/4)
  • 4 Washers
  • Fishing Line (cut to needed)
  • Electrical Tape
  • Caulking

Tools Needed 

  • Drill
  • 1/4 inch bit
  • 5/64 inch bit
  • Screw Driver
  • Hack Saw
  • Box Cutter
** Make sure before you use the hacksaw, or the drill you mount things carefully so things are less likely to slip, and you don't get hurt.

Step 2: Preparing the Enclosure

The first step in the construction of your very own Plant Buddy is to prepare the enclosure (conduit box) for the various LEDs and electronics that will need holes to access the outside. We used a 1/4" drill bit to drill 6 holes on the top ( 4 LEDs, 1 photo resistor and 1 potentiometer), one hole on the left side for the power cord, and two holes on the right side for the servo and soil humidity wires to pass through.

Step 3: Assembling the Post and Reservoir

First cut about two feet of conduit piping. Then using a hack saw cut a hole big enough for the servo to fit in about 2 inches from the top. Use a drill and a 5/64 bit to make holes for the wall toggle switch cover.  Place wall toggle switch cover over the servo hole and secure into place using the screws provided. Slide servo into switch cover and the hole you cut with the hacksaw (you may need to shave away a bit from the switch cover). Next, cut the bottom off of your water bottle. Place the water bottle, inverted, onto the pipe just under the switch cover in order to mark two even distributed bolt holes onto the pipe. Use your drill to create the two bolt holes.  You can also cut a hole in the cap of the water bottle to reduce flow, but it is not needed.  Placing the water bottle back over the holes you can use the drill to poke the holes through the water bottle.  When mounting the water bottle use caulking to create a seal so you do not lose water through the holes.  A tip for caulking the bolt is to put it on both sides of the washer to make the seal work better.  Next, fill your water balloon with a mixture of salt and water to make it just big enough to cover the inside tapered portion of the bottle nearest the cap (which is now pointed downward). Take a strand of fishing wire and tape the fishing wire to the top of the balloon (use electrical tape). Then straighten out the strand and attach it to the servo arm (just enough that the balloon just reaches the nozzle of the bottle.

Step 4: Wiring

We have provided a fritzing diagram to assist you with wiring up your Plant Buddy. Wire lengths are up to you in order to suit your personal application.  You will need to use 19 m/f jumper wires to extend the components to where they need to go.

We decided to connect the components using jumper wires because it would be very hard to make the project look good if everything was connected directly to the beard board.  We also wanted to make sure some of the parts were getting analogue connections, because that was needed for the system to work correctly.

Step 5: Programming the Arduino

The code for this project was straight forward. The fist step was getting all of the different sensors working. The SIK code was used to help in this process. Once the sensors were working properly, we then started creating specific functions. Making the photo resistor and RGB LED work together was simple. For demo purposes, the day time was set to 40, and would be set back to zero every time it reached 40. Another value will count up every second if the photo resistor is at a certain value. It is also reset to zero once the day variable is set to 40. The next and more challenging part was making the potentiometer, LED’s , moisture sensor, and servo work together. The solution we found was to stack if statements. The first would read the potentiometer value and visually light up an LED. Each LED would signal to the user how much water the plant will receive, and no LED meant you were not using it to water. Once that was distinguished, the moisture sensor was read, and depending on that value, the servo would trigger a water. We decided it would be good to have a time out period, so the water would have time to spread.

*note some moisture and sunlight variables will need to be changed to suite your application

#include #include // servo library int potPin = A2; const int lightValue = A0; int moistValue = A3; const int RED_PIN = 11; const int GREEN_PIN = 10; const int BLUE_PIN = 9; int lightLevel = 0; int moistLevel = 0; int exposure = 0; int dayTime =0; int LedPin8 = 8; int LedPin12 = 12; int LedPin13 = 13; int waterCount =0; Servo servo1; // servo control object

void setup() { pinMode(RED_PIN, OUTPUT); pinMode(GREEN_PIN, OUTPUT); pinMode(BLUE_PIN, OUTPUT); pinMode(LedPin8, OUTPUT); pinMode(LedPin12, OUTPUT); pinMode(LedPin13, OUTPUT); servo1.attach(6);

// mainColors(); Serial.begin(9600);


void loop() // this function runs repeatedly after setup() finishes { lightLevel = analogRead(lightValue); mainColors(); waterLevel(); waterCount ++;

Serial.println(moistLevel); Serial.println("moisture"); Serial.println(waterCount); Serial.println("waterCount"); } void waterLevel() { int potValue; potValue = analogRead(potPin); if (potValue < 255) { digitalWrite(LedPin8, LOW); digitalWrite(LedPin12, LOW); digitalWrite(LedPin13, LOW); if (waterCount == 10) { waterCount =0; } } if (potValue > 255 && potValue < 510) { digitalWrite(LedPin8, HIGH); digitalWrite(LedPin12, LOW); digitalWrite(LedPin13, LOW); moistLevel = analogRead(moistValue); if (waterCount == 10 && moistLevel < 600) { waterer1(); waterCount = 0; } else if (waterCount == 10) { waterCount = 0; } } if (potValue > 510 && potValue < 765) { digitalWrite(LedPin8, HIGH); digitalWrite(LedPin12, HIGH); digitalWrite(LedPin13, LOW); moistLevel = analogRead(moistValue); if (waterCount == 10 && moistLevel < 625) { waterer2(); waterCount = 0; } else if (waterCount == 10) { waterCount = 0; } } if (potValue > 765) { digitalWrite(LedPin8, HIGH); digitalWrite(LedPin12, HIGH); digitalWrite(LedPin13, HIGH); moistLevel = analogRead(moistValue); if (waterCount == 10 && moistLevel < 650) { waterer3(); waterCount = 0; } else if (waterCount == 10) { waterCount = 0; } }

} void waterer1() { servo1.write(15); // Tell servo to go to 90 degrees delay(1000); // Pause to get it time to move servo1.write(90); // Tell servo to go to 0 degrees } void waterer2() {

servo1.write(7); // Tell servo to go to 90 degrees

delay(1100); // Pause to get it time to move

servo1.write(90); // Tell servo to go to 0 degrees } void waterer3() {

servo1.write(0); // Tell servo to go to 90 degrees

delay(1200); // Pause to get it time to move

servo1.write(90); // Tell servo to go to 0 degrees }

void mainColors() { dayTime ++; delay(1000); if (dayTime > 45) { exposure = 0; dayTime =0; digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, LOW); digitalWrite(BLUE_PIN, LOW); } if (lightLevel < 300) { exposure ++; Serial.println(exposure); } // yelllow (turn on red and green LED ): if (exposure > 29) { digitalWrite(RED_PIN, HIGH); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, LOW); } // red (turn red on): if (exposure > 19 && exposure <= 29) { digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, LOW); } // Purple (turn red and blue on): if (exposure > 10 && exposure <= 19) { digitalWrite(RED_PIN, LOW); digitalWrite(GREEN_PIN, HIGH); digitalWrite(BLUE_PIN, HIGH); } } void showRGB(int color) { int redIntensity; int greenIntensity; int blueIntensity;

if (color <= 255) // zone 1 { redIntensity = 255 - color; // red goes from on to off greenIntensity = color; // green goes from off to on blueIntensity = 0; // blue is always off } else if (color <= 511) // zone 2 { redIntensity = 0; // red is always off greenIntensity = 255 - (color - 256); // green on to off blueIntensity = (color - 256); // blue off to on } else // color >= 512 // zone 3 { redIntensity = (color - 512); // red off to on greenIntensity = 0; // green is always off blueIntensity = 255 - (color - 512); // blue on to off }

analogWrite(RED_PIN, redIntensity); analogWrite(BLUE_PIN, blueIntensity); analogWrite(GREEN_PIN, greenIntensity); }

Step 6: Overview of Operation

  1. Install Plant Buddy post with reservoir and the soil humidity sensor into the potted plant.
  2. Ensure the reservoir stop valve (the balloon) is seated completely covering the nozzle
  3. Fill reservoir with approximately 12 FL Oz of water.
  4. Turn the dispenser adjustment knob to the desired setting, using the yellow LEDs as indication of selected setting ( 1 for small plants, 2 for medium plants and 3 for large plants).
  5. Periodically check the sunlight readout LED to ensure your plant is getting the appropriate amount of sunlight (Blue - Low exposure to light. Green - Medium exposure to light, Yellow - High exposure to light)
  6. Enjoy not having to water your plant!

Step 7: Future Ideas to Make Better

It would be better if we took the light sensing a step further.  Low medium and high light plants need a different intensity of light,.  It would be better for the plants if we could change the intensity threshold of what makes the RGB LED change colors.  It would correspond to what each level would require.