FIGURE 3. Schematic view of the CdS photocells, Arduino,
and L298 motor driver board. Note that unlike the PICAXE
version described last month, the Arduino does not derive
its five volt power from the motor driver. Instead, the
Arduino is operated from its own nine volt battery,
connected to the barrel power plug.
Wiring for Motor Control
Phase 1 of the Beginner Bot project used switches for
manual control of the bot’s motors, and that was followed
with converting to electronic control using an H-bridge
module. With the Arduino, you can
connect some of its input/output pins
to the H-bridge module and operate
the motors using software commands.
You can easily modify the behavior of
the Beginner Bot simply by altering a
few lines of code.
Refer to Part 2 on how to mount
the H-bridge to the Beginner Bot;
connect the motors 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
lower than normal supply voltages can
FIGURE 4.
Breadboard view
of connecting
the photocells,
Arduino, and
motor driver.
TABLE 1
Input A Input B What Happens
Low Low Motor stops
Low High Motor turns one direction
High Low Motor turns the other
direction
High High Motor stops
58 SERVO 11.2011