Seattle Robotics
CMUcam1 AppMod Vision System
TM
for
BoeBot
User Guide
This product or portions thereof is manufactured under license from Carnegie Mellon University.
AppMod is a trademark of Parallax, Inc.
Copyright 2004 Seattle Robotics. All Rights Reserved.
User Guide version 1.0
The CMUcam1 AppMod vision system
The goal of this product is to give you as simple a plug-n-play experience as possible.
Plug in the hardware, upload the demo code then press the buttons and watch your BoeBot use it’s new
vision system to “see” and respond to it’s environment.
The CMUcam1 AppMod vision system consists of a CMUcam1 vision system mounted on a plug in
AppMod board.
Included on the AppMod board is a simple user interface consisting of two buttons, eight LED’s and one
piezo speaker. The user interface serves these three purposes –
1) A simple menu selection system which works with the included demo code to allow you to select and
run one of eight robot vision demonstration programs.
2) Provide visual feedback from the LED’s as the demo programs run showing where the CMUcam1 is
seeing the tracked target.
3) Indicate the color of objects it see’s by illuminating the red leds for a red object, green led’s for a green
object and yellow led’s for a yellow object.
With some clever circuitry on the AppMod board the two buttons, eight led’s and one piezo speaker only
require four I/O pins on your Basic Stamp2 thereby conserving I/O pins for other uses.
CMUcam1 AppMod package
Your CMUcam1 BoeBot package should include –
1. A CMUcam1 mounted on an AppMod user interface board.
2. This printed user manual.
3. A CD-ROM that includes demo programs.
Begin here
Before opening the plastic bag containing the CMUcam1 be careful to discharge any static charge from
your body before handling the CMUcam1. Typically you can do this by holding your finger to a metal table
or lamp before you remove the CMUcam1 from its package. Although the CMUcam1 is quite rugged
static discharge can damage it. You may wish to use a grounding strap during installation. You may
notice that the CMUcam1 printed circuit board appears to be missing some of the components. This is
correct, there is nothing wrong with your board. The circuit board for the CMUcam1 is a multi-purpose
board capable of serving several functions. The optimal components for the BoeBot have been
incorporated in this version of the assembly. Your CMUcam1 board and camera module have been
tested at the factory before shipping to assure proper operation when you get it.
Installing the CMUcam1 AppMod on your BoeBot
1. Before beginning the installation process be sure the power to your BoeBot is disconnected. It is good
practice to remove the batteries from the BoeBot during the installation process.
2. Plug the CMUcam1 AppMod into the AppMod connector located toward the front of the BoeBot
behind the white solder less bread board.
3. Be sure the camera lens is pointing forward across the top of the solder less bread board.
4.
Double check that the CMUcam1 AppMod orientation is correct before proceeding.
5. Connect power to your BoeBot and observe that the CMUcam1 red power LED turns on. If the
CMUcam1 red power LED does not turn on disconnect the power immediately and double check the
orientation.
6. Remove the lens cap (shown at the bottom of this photo) when you are ready to use your CMUcam1
AppMod.
Note:
It’s a good idea to leave the lens cap in place when the CMUcam1 is not in use.
Try not to touch the surface of the CMUcam1 lens with your finger as it will leave an oily smudge that
could impair it’s proper function. To avoid scratching your lens only use a cleaning cloth designed for
either camera lenses or eye glasses to clean the CMUcam1 lens.
CMUcam1 tilt angle
For typical applications and the included eight function demo program you will want to adjust the
mounting bracket so your CMUcam1 has a downward tilt angle similar to the picture below. This allows
your BoeBot to see directly in front of it and a short distance forward and forward to the right and left. The
pivot point on the mounting bracket uses knurled head nylon screws that you can loosen and tighten by
hand. Be careful not to over tighten these screws as they are made of soft plastic and you can strip them.
You should use the camera tilt angle as a way of fine tuning the programs forward / backward and
right / left tracking performance.
Lens focus
The lens comes pre-focused for close-up to moderate range viewing, which works best with your BoeBot
for most applications. Once you are experienced using the CMUcam1 you may have an application that
requires a farther distant focus and you can gently turn the lens housing in or out to adjust.
Caution:
The focus on the CMUcam1 is very sensitive. It will function as is for most any application using
the BoeBot. Be very careful when adjusting the focus to only change it in small increments. If it gets very
far out of focus it will have difficulty identifying and tracking objects close up and far away.
You should also be aware of the fact that technically speaking the CMUcam1 is mounted upside down on
its mounting bracket. This reverses the relationship of the X and Y data from the camera.
Battery Problems
If your CMUcam1 and BoeBot appear to work erratically chances are your batteries are discharged. The
CMUcam1 consumes a hefty 200 ma of power from your BoeBot voltage regulator and batteries. This will
make your batteries run down much sooner than before. Be sure and replace all four batteries at the
same time with quality alkaline batteries.
The AppMod essentially contains the Low Battery Indicator circuit from your Parallax Robotics Student
Workbook chapter 2, activity 1. This can help diagnose intermittent low battery problems. The integral
piezo speaker included on your CMUcam1 AppMod board acts as the Low Battery Indicator circuit.
The Eight Function Demo Code
Once you have your CMUcam1 AppMod vision system plugged into the BoeBot AppMod connector the
next step is to program the main demo code from the CDROM to your Basic Stamp2. The demo code has
eight functions each function demonstrating a capability of the CMUcam1. The AppMod interface board
has eight LED’s and two push buttons that function as a simple menu selection system. When you first
turn on the BoeBot the eight led’s will flash several times then the piezo speaker will beep indicating it is
ready. Each function starts with one audible beep and stops with two beeps. The LED’s flash during each
function in different patterns to let you know how that function is operating.
How to use the menu interface
Press the “Select” button repeatedly and you will see the LED’s light one after the other in sequence from
left to right. It helps to put a finger under the edge of the AppMod board as you depress the button. This
keeps the AppMod board from moving on it’s plug in connector mount. Press the “Go/Stop” button to start
a function. If a function is already activated press the “Go/Stop” button again to stop that function. You
may then press the “Select” button again to select another function.
The eight demo functions
Function 1
- “Calibrate Lighting” the first step after the BoeBot is turned on is to calibrate the CMUcam1
to the ambient lighting conditions. Press the Select button until the red LED “1” is lit, then press the
Go/Stop button. The LED’s will flash while the CMUcam1 is calibrating for the lighting conditions. This
takes about 20 seconds. Make sure the area is clear of objects in front of the BoeBot (out to about six
inches) and that you are in the typical lighting conditions you will be operating in. Avoid facing the camera
directly toward a light source. As you are using your BoeBot and if your lighting conditions change you
may wish to run this function again.
Function 2 -
“Sample and Save Color” hold a colored object directly in front of the CMUcam1 lens (1 to 2
inches away) and then select function two and press the Go/Stop button. It takes about a second to lock
onto the color of the object and the LED’s will flash and the speaker will beep twice when done. The color
values are saved in the Basic Stamp 2 EEPROM. The sampled color will be saved even when the robot is
turned off.
Function 3 -
“Track Color” the robot moves forward, backward, right and left to follow the color of the
object saved during function 2. The LED’s will light up to indicate which direction the robot will move. The
two center green LED’s illuminate for forward, the four red LED’s for backward and the one yellow LED
on each side for right and left turns. This is very useful for testing. The LED’s also flash briefly during
each look and move loop.
Function 4 -
“Move and Avoid” the robot will move forward and avoid objects using the vision sensor
only. It works by sampling the color range of the floor in front of the robot. It then backs up and turns away
from anything it sees that is not the color of the floor. You must have the area in front of the robot object
free when you first start this function so it can sample the floor color correctly.
Function 5 -
“Adaptive Tracking” the robot locks onto the first color it sees and tracks that color (it only
goes fwd, right and left, not bwd). If it loses the object for about five seconds it then locks onto the next
color it sees and tracks that until it loses that etc. You can hold any colored object in front of the robot and
it will beep fast twice to indicate it has locked onto the object it will track.
Function 6 –
“Line Following” it is assumed a black line about ½” wide on a white line tracking course.
This is very simple basic line following. The CMUcam1 should be calibrated on the white line tracking
course background before you select this function.
Function 7 –
“Finger Point and Move” the robot will backup, turn right and turn left in relation to finger
pointing. This is done with the CMUcam1 using the same downward facing angle as is used on all the
other functions. The hand is laid flat on the surface in front of the robot. One finger only is extended and
pointed toward the center of the robot facing head on toward the robot. As you get close to the front of the
robot it will backup. Your finger should be flat on the floor pointing straight at the center of the front of the