Pulse Width Modulation
Goes Digital
Motor Speed Control the Easy Way
by Bill Axsen
There are a lot of pulse width modulation (PWM) circuits out there using the
venerable 555 timer, but they all have their limitations. Being analog, they aren’t easily
adapted to digital circuits. They’re great if all you
want to do is control the speed of a motor with
a pot, but they are almost impossible to connect
to a computer or an external device without a lot
of extra circuitry. With a digital design, you have
the flexibility of going both ways.
With this circuit, you can control the speed of a motor from a
computer, connect a sensor array to track a light source, or just
control the speed of a model train without a variable transformer.
I’ve used this circuit to control the speed of remote control cars,
slowly turn on the lights in the house as the sun goes down, and
in robotic devices, of course. PWM is a versatile tool. It can be used
in power supplies, proportional temperature controllers, or even
light dimmers.
What makes PWM so unique is the way power is delivered to a
device. Just think of PWM as an electronic switch which can be
turned on and off for varying lengths of time. The length of time the
switch stays on is the duty cycle. The longer the duty cycle, the more
power delivered to the motor and faster it will run; the shorter, the
slower. Duty cycle can be varied from 0% to 100%. The photos
below shows waveforms of 12% and 70% duty cycles.
The speed at which the switch goes on and off is controlled by
the input frequency. Too low a frequency and the motor will pulse;
too high and the motor may stall. For this reason, the frequency is
PWM running a small
DC motor at a duty
cycle of 9.0%.
12% Duty Cycle
34 SERVO 09.2009
70% Duty Cycle