58 SERVO 03.2016
When you are building large robots, 2A motor drivers
just don’t cut the mustard. There are quite a few high
current motor drivers on the market, but one in particular
that I like is the Parallax HB- 25.
The HB- 25 uses a single wire to control speed and
direction with a servo-like control signal. There are a ton of
other motor drivers from companies such as Pololu,
Cytronics, Dagu, Adafruit, and more — far too many to
I2C / SPI / Serial
Controller and Drivers
If you can’t (or don’t want to) generate Pulse Width
Modulation (PWM) pulses to control motor speed for the
PWM drivers, you will need a motor controller; take, for
example, the one from Seeed Studio
( www.seeedstudio.com) shown in Figure 7.
There are a LOT of motor controllers out there — and
they can be interfaced to your Raspberry Pi via a wide
range of choices. Most motor controllers connect via one of
1. Servo interface — three wires consisting of signal,
power, and ground. These controllers take a servo style
control pulse and generate a PWM signal for the motor (the
2. I2C interface — three wires consisting of SDA, SCL,
and ground. These controllers present an I2C interface
(Seeed Studio version).
3. SPI interface — five or six wires consisting of /CS,
CLK, MISO, MOSI, and ground.
4. Serial interface — three wires consisting of TX, RX,
and ground (RoboPi).
5. USB interface — usually presents as a serial port.
Build Your Own
A really easy way to control high powered motors is to
use an old fashioned relay. However, this is only really
feasible if you do not need PWM speed control of the
motor. A better solution is to make your own H-bridge with
Okay. You have Chosen a
Motor Driver — Now What?
You have to make the motor run, of course. Motor
speed is controlled by using PWM to manage how much
power is provided to the motor.
Why the ENABLE Signal of
Three-Wire Drivers is Useful
Most two-wire motor drivers will actively brake the
motor if the A and B inputs are at the same level. When
PWM speed control is used, both inputs are guaranteed to
be driven low during the “off” period of the PWM signal —
which will short the two motor leads, actively braking. This
is less than ideal for the motor, as it will get short spurts of
power, then brake repeatedly. The practical effect of this is
that low speed motor control will not be linear, and the
motor will sound like it is grinding.
EN/A/B Three-Wire Driver
The popular L293D and L298 motor drivers are often
configured for EN/A/B three-wire control. For three-wire
drivers, use digital Write() (or an equivalent) to set the two
direction pins, then use analog Write() to control the motor
speed using PWM. Please note that the minimum speed will
be different for different motors.
Some driver boards permanently tie EN high in order to
use only two pins. However, I do not recommend this
practice as it is harder on both the motors and batteries as
0 Disable the motor driver, motor coasts
1 Enable the motor, motor turns in direction specified
by A or B
Figure 7. Seeed Studio I2C motor controller with onboard
L298N motor driver.
Parallax HB- 25.