By L. Paul Verhage
The CheapBot Smart Proximity Detector
The PICAXE-14M inside the
CheapBot- 14 (our small platform
we’ve been working on) robot
controller only has 256 bytes of
memory. While that’s fine for a basic
robot, it leaves something to be
desired when trying to create a more
capable robot. So, why not use a
second microcontroller to offload
some of the PICAXE- 14’s work?
The smart proximity detector outlined
here incorporates an inexpensive
PICAXE-08M that takes care of
detecting obstacles and leaves the
driving to the robot controller.
Not familiar with a proximity detector? A proximity detector is an infrared (IR) bumper system used to detect collisions before they become collisions. As the
robot carrying the proximity detector approaches an
obstacle (like a wall), the detector raises the alarm in time
to avoid a collision.
The first proximity detector I read about was described
in the book, Mobile Robots, by Jones, Seiger, and Flynn.
Their detector uses an inverter, resistor, and capacitor to
create a pulsed 40 kHz signal. Other designs use a 556 (a
dual 555 IC) timer in place of the inverter. Anodes of two
infrared LEDs (IREDs) are connected to the timer. By
bringing the cathodes of the IREDs to ground one at a
time, each is activated from the same 40 kHz timer. I like
that idea; use a single timer for both IREDs, but only let
one flash at a time.
Due to the tolerances in the timing components (the
capacitor and resistor), a trimmer is required to properly set
the frequency of the IREDs. So, what if a PICAXE-08M was
used instead? Setting the proper frequency of the IREDs
32 SERVO 02.2010
would be as simple as writing a single line of code.
However, using a PICAXE-08M to blink two IREDs replaces
50 cents in parts with a $3 chip with lots of spare memory.
Blinking the IREDs barely taps into the capability of the
So, what about adding another feature to the proximity
detector, like monitoring an IR detector? That gives the
PICAXE the responsibility of monitoring reflections from the
IREDs rather than the robot controller. The results can be
reported to the robot controller over a serial data link.
Since Mobile Robots was published in 1999, there’s a
greater number of 40 kHz IR detectors available. So, I
switched from the old Sharp sugar cube IR detector they
used to a ROM 37. 9 kHz receiver module (part number
G16943 from Electronic Goldmine;
www.goldmine-elec.com). Switching to a 38 kHz detector posed no
problem; I just needed to change one line of PICAXE code.
Since there’s a single PWM timer available on a
The IR detector I selected for the
Smart Proximity Detector. It’s a
three-pin device that’s simple to
use. When it detects an IR pulse, its
output goes to ground.
PICAXE-08 (pin 5), the anodes of both IREDs connect to the
PICAXE here. The cathodes of the IREDs however, connect
to different PICAXE I/O pins ( 3 and 6). By LOWing these
pins one at a time, each IRED is activated at its proper time.
It sounds good so far. The PICAXE-08M provides the