Mobile Sun-Seeking Robot

by 10DotMatrix in Circuits > Arduino

18821 Views, 195 Favorites, 0 Comments

Mobile Sun-Seeking Robot

Screen Shot 2014-11-07 at 12.20.25 PM.png

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

Make the Robot's Base

dowels and wood.JPG
glue on dowel.JPG
all dowels on plank.JPG
laser cut walls 1.JPG
all parts layed out  copy.JPG

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.

Downloads

"Grow" a Box

draw outline and cut.JPG
cut.JPG
cut slot.JPG
cut holes.JPG
draw circle on grass 2.JPG
cut circle 1.JPG
final cut circle on wood.JPG
everything you need.JPG

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.

Glue the Case Together

gluing edges.JPG
clamp box.JPG

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.

Attach the Grass and Watering Pail

center grass on wood.JPG
apply epoxy.JPG
epoxy 1.JPG
epoxy 2.JPG
epoxy 3.JPG
place grass onto board.JPG
epoxy on open circle.JPG
place watering pail.JPG

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.

Attach Stabilizers

IMG_9529.JPG
IMG_9531.JPG

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

3D Print Mounts

all mounts.JPG
IMG_0176.JPG

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.

Assemble the Wheels

IMG_0400.JPG
IMG_0402.JPG
IMG_0405.JPG
IMG_0407.JPG
IMG_0412.JPG
IMG_0413.JPG

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.

Add Components Inside Box

IMG_9532.JPG
IMG_9558.JPG
IMG_9559.JPG
IMG_9567.JPG

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.

Circuit

arduinomicro_pins.png
Screen Shot 2014-10-02 at 12.08.50 PM.png

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

Preparing the Protoboard

cutting arduino mount.JPG
cutting arduino mount 02.JPG
pins for digital i:o unsoldered.JPG
pins for digital i:o soldered.JPG
5V wire connections.JPG
GND wire connections.JPG
I:O wire connections.JPG

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.

Making Ultrasonic Range Finder Connectors

IMG_0361.JPG
IMG_0365.JPG
IMG_0375.JPG
IMG_0384.JPG

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

Make Solar Cell Connectors

IMG_0393.JPG
IMG_0394.JPG

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.

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.

Calibrating the Servos

Screen Shot 2014-09-14 at 8.17.14 PM.png
Screen Shot 2014-09-14 at 8.31.43 PM.png

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.

You Are Ready to Go

best hero shot.JPG

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