There are a number of similar L298
Arduino shields and stand-alone modules,
and if you use one of these, just remember
to adjust the I/O connections accordingly.
On the DFRobot shield, the motors are
connected to pins 4/5 and 6/7. Each motor
uses two pins: one for direction and one for
Listing 1 is a demo Arduino sketch that
cycles through the basic functions of DC
motor control for a robot: moving it forward
and backward; steering it left or right; and
The control pin for each motor can also
be used with pulse width modulation (PWM)
to set the speed of the motor. Listing 2
shows how this is done using the Arduino’s
analog Write statement. To set the speed of
the motor, you specify a number from 0 (off)
to 255 (full on). These values control the
duty cycle — the ratio between on and off
times — of a fast series of pulses sent to the
Not all motors respond to very low duty cycles.
When used with the Tamiya worm gearmotors, values
under about 96 have little or no effect. That’s why the
for loop in Listing 2 starts at 96, and goes to 255.
Important note! In programming code, the
physical direction of a DC motor is ambiguous. It all
depends on how the motor is wired to the control
circuitry. I intentionally wired both motors in the exact
same way to the L298 shield which then required that
the motors be commanded in opposite — one motor is
set to LOW, while the other is set to HIGH. This propels
the bot forward or backward. If a motor doesn’t turn in
the direction you want it to, merely flip its wiring to the
FIGURE 7. A much larger version of the Mini
T-Bot, made with a pair of 12” T straps.
Using Larger Ts for
You’re not limited to just the 6” T strap. By using a
bigger T, you can construct a larger (and heftier) robot.
For your reference, Table 1 are the specifications of the
most commonly available sizes of Simpson Strong-Tie
strapping Ts and their weight in ounces.
Yikes! ... the 1212T strap weighs almost a pound, so
you’ll need bigger motors (and batteries) to haul that kind
of weight around.
The robot brute in Figure 7 uses a pair of 12” straps,
separated by 5” long aluminum tubing used as risers. In this
FIGURE 8. Outline shapes of three common nail plates.
Like T straps, these are found in the lumber section of local
hardware or home improvement stores.
particular prototype, the motors were mounted at an angle,
with the metal of the lower T bent at 45°. This was partly
done to accommodate the motor itself, as its mounting
holes were on the side opposite the axle and wheels. I also
did it simply to be different.
14 gauge galvanized 6”
14 gauge galvanized 12”
14 gauge galvanized 12”
*Width is the width of the strapping metal.
Other Sheet Metal for
Don’t stop with just T-shaped straps for building robot
bodies. The same lumber section of your local home
improvement store has plenty of other choices. Some of it
is specially formed and bent for things like hanging 2 x 4
joists in an attic or garage. These are somewhat less useful
than flat metal.
Figure 8 shows the outline drawing of three commonly
SERVO 06.2011 47