Personal Robotics
Learn About
Microcontrollers
Place Scotch tape on one end of the
tube and thread your lens into the
other, then aim it at your flashlight in
a semi-darkened room.
At some point, looking at the
tape with your eye loop, you will see
your flashlight in focus, but upside
down. In this way, you can see the
distance at which a particular lens is
forming an image. This will allow you
to determine the dimensions of your
lens board.
Back to the chicken/egg thing, it
is somewhat difficult to get the lens
centered on the sensor until you have
working software and it is difficult to
get the software going until you have
working optics. Therefore, I highly
recommend using the existing optics
to flesh out the software.
Once you can take pictures of
the surface of your desk, you can
work on the optics. The surface
roughness reading can be beneficial
here, since a sufficiently rough
surface will read as not rough if it is
out of focus.
Again, the chicken/egg thing
comes into play. A rough
surface that is far enough away can
still appear smooth if its features are
too small to be recognized as
features; think of a stucco wall at 20
feet away versus one that is two
inches away. By working out the
software on an optical system that is
known to be good, you can test
optical ideas once the software
works.
A laser pointer with a Scotch
tape diffuser can be helpful here to
“break” the chicken/egg cycle, as
well. It generates what amounts to
infinite roughness. By aiming your
laser at the sensor and looking at the
motion registers or quadrature pins,
you can see if you have broken anything. Aim the laser into the mouse
and wiggle the pointer around. If you
sense motion, then things are good.
Once you know where your new
lens wants to focus, you can set up
an LED and start taking pictures of it.
To start, you will want to work in a
darkened room. Set the mouse sensor
and optic aiming upward. Then place
MAY 2004
the LED above it at some distance,
centered on the mouse sensor.
It is easier if you have your ancillary lens focused at this distance.
Next, take pictures and look at the
data coming out of the lens,
searching for a bright spot. Try to
center this spot by moving the ancillary lens around.
Table 2 shows what the data
coming out of my mouse looks like
when it is centered on the lens.
Notice the pattern of 63s. They are
nearly centered in the data, indicating
that the lens is nearly centered. Once
you have it centered, you can affix
your lens board with an adhesive, like
hot glue. At this point, you can move
the LED to a new distance, look at
the data coming out, and focus it
until you get the sharpest difference
between low numbers and high
numbers.
With these general optical tools
at your disposal, you should have a
reasonably easy experience getting
the mouse to work.
The possibilities for this are really
amazing. Imagine a line following
robot that takes a picture of the line
and uses an artificial neural network
to determine how to steer in order to
track the line. You could use a laser
line generator; take pictures with and
without the line generator on to
detect terrain features.
You can even use it to do
experiments in insect vision, called
“optic flow,” where you read the
quadrature outputs directly to determine the motions of surrounding
objects relative to you.
In the software I have provided
on the Nuts &Volts website
( www.nutsvolts.com), I have the
IsoPod output generate HTML tables
with colored backgrounds according
to the pixel values of the image.
You can save the output to a text file
and as a UTF- 8 file with the extension
“.HTML.” This will allow you to easily
visualize the mouse’s output.
If you have any interesting
experiences with these versatile
chips, please feel free to contact me
at author@bio-bot.com NV
With theAthena
$6.95ea
•Basic Language
•I2c/SPI
• 15 IO Ports
•Hardware Serial IO
•No External Components
•Free Development Software
•Several Carrier Boards
•Super High Speed Version Available
•Educational Kits Available
•Upgrade Path to Dios
•Online Forums
•Tutorial
Athena Carrier Boards
Starting At $5.95
Educational Package
Athena Microcontroller
Athena EDU board
Bread Board
Wire Kit
LED’s
Capacitors
Resistors
Buttons
Software
$49.95
Free Software
Software has built-in
command wizard.
It contains syntax and
code examples for
each command.
Kronos Robotics
and Electronics
www.kronosrobotics.com
703-779-9752
fax 703-779-9753
You won’t believe this web site !!
•Online Store
•Free Information
•Free Software
•Projects
•PC Boards
Circle #118 on the Reader Service Card.
89