FIGURE 5. Cadmium sulfide
photocells attached to the solderless
breadboard area of the PropBOE.
not to short-circuit anything! For
example, you might want to place
a small amplifier and speaker
underneath, so you can add
sound, music, or voice to your
robot. Keep in mind that the
balance skid of the Beginner Bot is
placed in the rear, under the main
batteries. That’s where most of the
weight is. Avoid adding too much
weight to the front of the robot,
or it won’t ride on the rear skid.
Of course, you can always move
the skid from the rear to the front
if your bot tips the wrong way.
In the first part of this series, you learned how to
use switches for manual control of the bot’s motors.
You then learned how to convert to electronic control
using an H-bridge module, then adapt the electronics
for use with a microcontroller.
Refer to Part 2 on how to mount the H-bridge to
the Beginner Bot, connect the motors to it, and wire a
battery pack to it. I recommend using a six-cell AA
battery holder and rechargeable nickel-metal hydride
(NiMH) batteries. Keep the batteries freshly charged, as
a lower than normal supply voltage can cause
mysterious and hard-to-track problems.
Refer to Figure 3 for how to connect the PropBOE
to the H-bridge module, including a set of cadmium
sulfide (CdS) photocells that act as simple eyes. Use the
mini breadboard and header connections as the
interface between the motor bridge, the two
photocells, and the PropBOE. Figure 4 shows the circuit
in breadboard view.
Note that the PropBOE gets its power from its own
nine volt battery. A common ground connection is used
between the PropBOE and the H-bridge module. This is
required for proper operation. If you leave off the
ground between the two circuits, the motors on your
Beginner Bot may not work or they may function
erratically. (Unlike that shown in Parts 2 and 3 of this
series, the PropBOE does not require 5V power from
the motor driver board.)
Use a piece of Velcro™ to secure the nine volt
battery to the bottom deck. There’s room on the left
side, in front of the motor. Make or purchase a battery
cable that has the standard nine volt battery clip on
one end and a 2.1 mm (center positive) barrel plug on
the other. The cable should be about 6” to 8” long.
The basic operating circuit is straightforward: Two
photocells detect the amount of light falling on them.
The photocell exhibits a change of resistance,
depending on the amount of light. The less light, the
higher the resistance; the more light, the lower the
resistance. For each CdS “eye,” a 22 kΩ resistor turns
the resistive output to a varying voltage. The resistance
of the CdS cell plus the fixed resistor form a voltage
Note that the photocells are connected to the 5V
supply, rather than 3.3V. This is intentional, in order to
increase the sensitivity of the readings. While the
Propeller is powered at 3.3V, the analog-to-digital
converter circuit on the PropBOE is run at 5V so it can
be interfaced to circuits that operate at up to five volts.
Attach the photocells to the mini solderless
breadboard as shown in Figure 5. Gently bend the
leads of the cells so that they point slightly upward and
outward. Add heat shrink tubing (unshrunk) over the
photocell leads to provide both mechanical support and
Use the Right Motors!
The Beginner Bot uses a pair of Tamiya gearboxes that
have been modified according to instructions provided in
Part 2 of this series. Specifically, the motors used in the
gearboxes have been replaced with versions that provide
for operation at six to 12 volts, and with higher efficiency.
These motors are available from Pololu (item #1117),
among other sources. Cost is under $2 each.
Be sure to not use the stock motors that come with
the Tamiya gearboxes. These are rated for only three volts
and can consume copious amounts of current. This
current exceeds the rating of the L298 H-bridge used to
control the motors.
SERVO 12.2011 49