Pulse Width Modulation (or PWM) is a technique for controlling power. We use it here to control the amount of power going to the motor and hence how fast it spins.

The diagram below shows the signal from the PWM pin of the Raspberry Pi.  

Every 1/500 of a second, the PWM output will produce a pulse. The length of this pulse controls the amount of energy that the motor gets. No pulse at all and the motor will not turn, a short pulse and it will turn slowly. If the pulse is active for half the time, then the motor will receive half the power it would if the pulse stayed high until the next pulse came along.

Last updated on 2015-05-04 at 04.27.11 PM Published on 2013-01-14 at 11.34.14 AM