Pulse Width Modulation (PWM)
Encoding information in the duration (width) of pulses.
What is Pulse Width Modulation (PWM)?
Pulse Width Modulation is a clever technique used to control analog devices with a digital signal. Imagine trying to control the brightness of a light bulb using a simple on/off switch. You can't make it dimmer; it's either fully on or fully off. However, if you could flip the switch on and off very rapidly, the average brightness you perceive would depend on how long the switch stays on compared to how long it stays off. This is the core idea behind PWM.
In PWM, information is encoded in the width (or duration) of a series of pulses. While the height (amplitude) of the pulses remains constant, their duration is varied according to the information signal we want to represent. It's a type of .
How PWM is Generated
A simple and common method for generating a PWM signal involves comparing two signals:
- The Modulating Signal: This is the original information we want to encode (e.g., a sample of an analog voice signal, a desired motor speed).
- The Carrier Signal: A high-frequency signal with a constant shape, typically a sawtooth or a triangle wave.
These two signals are fed into a device called a . The comparator's output becomes the PWM signal:
- When the instantaneous value of the modulating signal is greater than the carrier signal, the comparator's output is HIGH ('1').
- When the modulating signal is less than the carrier signal, the comparator's output is LOW ('0').
The result is a series of rectangular pulses whose width is directly proportional to the value of the modulating signal at that moment. A higher modulating signal value results in a wider pulse, and a lower value results in a narrower pulse.
Key Parameter: The Duty Cycle
The most important parameter describing a PWM signal is its Duty Cycle. This is the ratio of the pulse's "on-time" to the total period of the signal , usually expressed as a percentage.
- A 0% Duty Cycle means the signal is always off.
- A 100% Duty Cycle means the signal is always on.
- A 50% Duty Cycle means the signal is on for half the time and off for the other half. The average voltage is 50% of the HIGH level.
By varying the duty cycle from 0% to 100%, we can precisely control the average power delivered to a device.
Interactive PWM Demonstration
PWM Information
Applications of PWM
While PWM can be used for communication, its main application area is in power control due to its exceptional efficiency.
1. Power Control and Regulation
PWM is widely used to control the power supplied to electrical devices. Its key advantage is efficiency. The switching transistors used to generate the signal are either fully ON (acting like a closed switch with very low resistance) or fully OFF (acting like an open switch with no current flow). In both states, the power dissipated as heat in the transistor is minimal ( or ), making PWM a highly efficient way to control power.
Common examples include:
- Motor Speed Control: Controlling the speed of DC motors in everything from consumer electronics to industrial robotics.
- LED Dimming: Efficiently controlling the brightness of LED lights in homes, cars, and displays.
- Power Converters: Forming the basis of modern switch-mode power supplies (like your phone charger) to efficiently convert voltages.
2. Telecommunications
PWM can also be used to transmit data. In this context, the value of each sample of an original analog signal is assigned to a unique pulse width. The receiver then measures the width of each incoming pulse to reconstruct the value of the sample, and thus, reconstruct the original signal.