Introduction: Coffee Bot

This project was mostly copied from MakeZine article here. It was updated to use a breadboard to make construction easier.

The original project is here: Supplies are all mentioned in the article. The only additional piece is a small breadboard.

This instructable is to be used by class in a high school as an extracurricular activity.

Step 1: Step 1 - Setup

Supplies are all mentioned in the article. The only additional piece is a small breadboard.

Step 2: Step 2 : Wire the Motors. USE GREEN NOT BLUE

Attach a wheel to each motor shaft.

Position the motor heads facing each other. Strip the ends of 2 red and 2 green wires, and hook these into the copper terminals: a green wire to the bottom and a red wire to the top terminal of each motor. Solder all 4 connections. Hot-glue the wires to the motors for strain relief.

Caution: Take care not to rest the hot soldering iron on the plastic motor body, and not to overheat the copper terminals.

Pictures from http://makezine.com/projects/make-34/coffee-bots/

Step 3: Step #3: Build the Chassis.

  • Hot-glue one 6" solid craft stick across the top of both motors, and one across the bottom, for structural support.
  • For front-and-back stability, hot-glue a third craft stick perpendicular to the first 2. At each end, hotglue the wine corks and bottle caps as shown in the chassis diagram.
  • Note: Make the front cork slightly shorter than the rear cork, and allow the chassis to teeter. This ensures that the wheels will always be in contact with the ground.
  • Place your favorite coffee can on top of the chassis. Glue additional pieces of craft sticks as necessary to strengthen the connection between the chassis and the can.

Step 4: Step 4: Make 2 Light Sensors

Cut 4 pieces of yellow wire and strip the ends from all ends.

Solder 2 pieces of yellow wire to each light resistor as shown in the picture.

Hot glue each photo resistor and yellow wire to a stick.

Step 5: Step 5: Set Up Power by Extending Wires.

  • Get the battery pack and cut the red and black wires in half.
  • Strip off a bit of each wire (so 4 ends) - challenging because wire is so thin.
  • Cut 2 red and 2 black and solder those ends to the battery pack and plug as shown in picture.
  • Wrap all 4 joints with black electrical tape so they are protected.
  • Glue power pack anywhere you like.

Step 6: Step 6: Setup the Breadboard

Add all to breadboard as shown in the pictures:

Secure it to your coffee can in some way.

Step 7: Step 7: Program Your Arduino

/*

This program makes your robot either seek light or avoid light, depending on how it is wired up. Try this program first, and then start modifying it to give your robot the personality you desire. Shine a flashlight, or hold your hand over a light sensor, to change the behaviour. */

void setup() { // Set the mode of the digital pins to outputs to drive the motors // (the analog inputs are automatically inputs and so don’t need to be set) pinMode( 3, OUTPUT ); // motor pinMode( 5, OUTPUT ); // motor }

void loop() { // Compare the two light sensors

if ( analogRead( 0 ) - analogRead( 2 ) <-200) // If one light sensor has more light than the other ... { digitalWrite( 3, LOW ); // turn this motor off ... digitalWrite( 5, HIGH ); // and this motor on to turn in one direction }

else if ( analogRead( 0 ) - analogRead( 2 ) >200) // If the other { digitalWrite( 3, HIGH ); // turn this motor on digitalWrite( 5, LOW ); // and this motor off to turn in the other direction }

else{

digitalWrite( 3, HIGH ); // turn this motor on digitalWrite( 5, HIGH); // and this motor off to turn in the other direction }

}

}

Step 8: Step 8: Add Features

It is easy to add leds or other features - play around.