IntermediateTopic 63 of 104Electronics & Embedded
PWM
Varying duty cycle controls average power to motors and LEDs.
In depth
PWM varies duty cycle at fixed frequency to control average power: V_avg=D·V_max. Used for motor speed, LED dimming, servos (1–2 ms pulses at 50 Hz) and class-D audio. Frequency must exceed what the load can respond to.
Key points
- Duty cycle resolution
- Dead time in half bridges
- Filter to get an analogue level
Example25% duty at 12 V gives 3 V average.
What is PWM?
Varying duty cycle controls average power to motors and LEDs.
Why is it important to understand PWM?
PWM controls average power by varying the duty cycle, which is how most embedded systems dim LEDs and drive motors efficiently.
What is duty cycle?
The fraction of each period that the output is high, and the average voltage is the supply times this fraction for a simple switch.
Why does PWM avoid wasting power?
The switch is fully on or fully off, so it dissipates little power, unlike a linear control that drops the excess voltage as heat.
How is PWM used in practice?
Typical applications include dimming a lighting panel with a 10 kHz PWM signal, controlling the speed of a DC fan with a MOSFET and driving a servo with a pulse of about 1 to 2 milliseconds.
What should I learn before PWM?
Study "Timers and counters" first (topic 62 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.
What are the key points of PWM?
Duty cycle resolution. Dead time in half bridges. Filter to get an analogue level.
Can you give an example of PWM?
25% duty at 12 V gives 3 V average.
What comes after PWM?
The next topic is "UART", which builds directly on this one.
How difficult is PWM?
It is classed as Intermediate in Electronics & Embedded (topic 63 of 104). It is an intermediate topic. Work through the beginner topics in Electronics & Embedded first.