Introduction: Mobile Sun-Seeking Robot

About: I tinker with things at Instructables.

Your plant can navigate to the sunniest spot in the house with this sunshine seeking indoor planter. It's controlled by an Arduino Micro and driven by two continuous rotation servo motors. The planter seeks sunshine with the help of two solar panels that detect sunlight and differentiate true sunshine from indoor lighting. Two ultrasonic range detectors keep the planter from running into obstacles or falling off ledges.

However, a robotic planter doesn't have to look like a boring terracotta planter at your local hardware store.This planter is designed to look like a log cabin, complete with log walls, faux grass, and a watering pail that holds your plant.

Parts List

Materials for decoration

  • (x2) 4-ft long 1” diameter wooden dowels
  • 24”x 24” 3/16” thick plywood
  • Wood glue
  • Astroturf
  • Watering can
  • Epoxy

Other useful things

  • Snippers
  • Aul
  • Scissors
  • Ruler
  • X-Acto knife
  • Probably a plant for the planter

Step 1: Make the Robot's Base

The planter's electronics are kept safe and dry inside a custom-built base. The watering pail sits on top of the base and holds a plant. The pail is water-tight but can drain excess water out through its spout.

I designed the planter's base with Inventor and BoxMaker. The design is included here as an Illustrator file. To give the box a "log cabin feel", I cut 1" thick wooden dowels in half and glued them to a 3/16" piece of plywood. The walls of the box are cut from the dowel-covered plywood with a 450W laser cutter. The box's nice shading comes from placing the plywood dowel-side down onto the laser cutter's platform. The top and bottom of the box are cut from a smooth piece of 3/16" plywood with a 150W laser cutter.

Step 2: "Grow" a Box

Use scissors to cut an 8" x 8" piece of astroturf and place it onto the box top. Cut slits with an X-Acto knife into the astroturf through the top's two ovals. Wires from the robot's solar panels will run though these slits and into the planter's base. Use an awl to poke holes in the astroturf. Screws will be driven though these holes to hold 3D printed parts and mounts.

Next, make a mark on the astroturf where the watering pail will be placed. Use a cup to draw a circle around this mark and cut it out with an X-Acto knife.

Step 3: Glue the Case Together

For all the box faces except the top, paint the tabs with wood glue and clamp the walls together. Let the box dry for 2 hours.

Step 4: Attach the Grass and Watering Pail

Use two-part epoxy to secure the astroturf and pail to the box top. Squeeze quarter-size dollops of epoxy close together and mix. Apply epoxy over box top, lay grass onto the epoxy, and weigh down to ensure the bond. Let the top dry for 30 minutes to 1 hour. Repeat this process with the pail. The pail and grass should both be securely bonded to the box top.

Step 5: Attach Stabilizers

Print stabilizers for the bottom of the base. I used an Afinia 3D printer and ABS plastic from RadioShack.

Step 6: 3D Print Mounts

I designed mounts and brackets that are easily screwed onto the planter's base. The stl files are included here. Ultrasonic range sensors are screwed onto square mounts that are placed inside the base. The mounts are angled so that the robot knows if it is about to run into an object or fall off a table's edge. Solar cells easily slide into L-shaped mounts that are screwed into the top of the planter's base. Servo clamps keep the robot's servos secure while in motion. All clamps and mounts are printed on a RadioShack Afinia 3D Printer.

Step 7: Assemble the Wheels

Print the wheel holders and inserts that are included here on an Afinia 3D printer. Press fit the wheel holder into the hub of a 60mm rubber luggage wheel, flip, and press fit the remaining piece into the other side. Press fit the new hub into the servo shaft. Do this for both servos.

Step 8: Add Components Inside Box

Attach the range sensors and servos to their mounts and secure them to the bottom of the box with screws. Strap down a 12V rechargeable battery pack with a piece of velcro that slips through two cutouts. Screw the solar mounts to the top of the board, slide the solar cells into the mounts, and thread their wires through the incisions cut into the grass. Wiring will be outlined in the steps to come.

Step 9: Circuit

The circuit for this bot is very simple. An Arduino Micro controls the bot and is powered by a 12V rechargeable battery. The Arduino pins being used are listed below and connections are shown in the circuit diagram.

Analog Pins: A0, A2

Digital Pins: 5, 7, 9, 10

Other Pins: Vin, GND

Step 10: Preparing the Protoboard

Fit the Arduino Micro into a row of female header pins cut to size. Solder the pins into the protoboard. Next, cut four 3-pin male-to-male header pins and solder them into the board. These pins will connect the range detectors and servos to the Arduino. Next, cut a pair of 3-pin female header pins and solder these into the board. These pins will connect the solar cells to the Arduino. Solder connections from the pins to 5V, GND, and the appropriate digital or analog pins, as shown previously in the circuit diagram.

Finally, solder a 12V battery connector to the Arduino's VIN and GND pins. No need for a voltage regulator; the Micro can handle an input of 5-12V.

Step 11: Making Ultrasonic Range Finder Connectors

Strip 3 wires from a 10-wire ribbon cable. Solder a 3-pin male-to-female header pin to the ribbon cable. Protect with shrink wrap. Repeat for the other end of the cable. Make two for both range detectors

Step 12: Make Solar Cell Connectors

Solder extra lengths of braided wire to extend the reach of a solar cell. Solder a 2-pin male-to-male header pin to the end of the extension wires.

Step 13: Overview of Code

The planter first triggers its ultrasonic range detectors to check its location in space. If the planter will crash or fall the robot backs up and turns to reposition itself. It all is well, the robot begins finding the sunniest spot on the table.

The robot has a solar cell on each side of its body. The solar cells detect the number of photons hitting them. The higher the number, the sunnier it is. The robot uses the sum of both solar cell readings to detect the overall "sunniness" of its current location. It uses individual cell readings to decide whether to turn left or right. If it is in the sunniest spot, it waits 10 minutes until looping back through the code. It iterates through this process repeatedly.

This piece of code is it's structure is based on the program found here. It gives a wonderful description of what the code is doing. I tried to emulate this by also heavily commenting my code.

Step 14: Calibrating the Servos

This robot uses Parallax Continuous Rotation Servos. You communicate to these servos through pulse width modulation. Pulse width modulation, in essence, let's us get a variety of output voltages by only using a voltage that is "pulsed" high and low. The average value of the pulse returns a variety of voltages between the high and low value. For this project, the duration of these pulses is what controls the speed and direction of the servos. Each pulse is from 1300 to 1700 microseconds (μs) in duration — one microsecond is one millionth of a second. These servos are built such that:

  • 1300 μs: Turn clockwise
  • 1500 μs: Stops the motor
  • 1700 μs: Turn counterclockwise

However, some servos will not stop at exactly 1500 μs due to slight differences in electronic circuitry. You may need to adjust the servo mechanics so that the motor stops moving when pulses of exactly 1500 μs are supplied.

Use the potentiometer located on the top of the servo (see image included) to calibrate its stop point. First, connect the servo's red wire to the power supply you will be using (I used a 12V rechargeable battery back), its black wire to ground, and its white wire to pwm pin 10. Run the calibration code included here to apply a stream of 500 μs pulses to the servo, 20 ms apart. The Arduino code can also be found at the Parallax Website here. While the code is running, slowly adjust the potentiometer using a small (#0 or #1) Phillips screwdriver. Adjust the pot until the motor stalls.

Step 15: You Are Ready to Go

Now your plants can always enjoy the sunniest spot on the table.