The H-bridge spins the motor at full speed when it receives
+5V (“high”), and stops it when it received 0V (“low”).
But what about intermediate speeds? We don’t want our locos
running at full speed all the time! Microprocessors generally
can’t produce variable (analog) voltages, so they use “pulse
width modulation” or “PWM” to achieve variable speeds.
PWM sends a series of 5V pulses to simulate a variable volt-
age. For example, if the pulses are on half the time and off half
the time, the pin appears to have half of the supply voltage ,or
2.5V on it. Pulses that are on 25% of the time and off 75% of
the time look like 1.25V, and so on. See [8]. (This is exactly how
DCC decoders vary motor speed.)
9
9. The parts arranged near their locations on the circuit
board.