Monday, August 18, 2014

Introduction to Pulse Width Modulation (PWM)

PWM — Pulse Width Modulation
In general it's a method of controlling analog voltage by changing digital impulses width. In other words we can change analog signal with digitall signals.


If we need to change LED brightness, we will connect it to the
variable resistor. If we need constant brightness we will compute our resistor, but still some of the power will be converted to heat on the resistor, well, it's not very efficient.

In addition we have to manually change resistance and sometimes that is impossible (RC cars).






PWM helps us to handle these problems, it's easy to build and control.

Now let's say we connected LED to the switch and can press button for 1000 times per second, so that we don't see that LED is blinking.

e.g. If we keep LED on for half of milisecond and other half it will be off, then 50% of time it will be gaining brightness and other 50% it will be fading, so LED will think that it is getting only half of the voltage (half of impulses amplitude).

In that situation our PWM has 50% duty cycle (active time / total time)

This is how PWM that uses rectangular impulses looks like .



Impulse - when output voltage is > 0 
Period - time between 2 impulses (same state, e.g. rise edge of impulses)

If we want to get analog voltage from PWM we can use RC or LC circuit.

After which we can get our desired voltage.

TO compute our outut analog voltage, we need to know our digital sygnal duty cycle

If we have 30% duty cycle, then our output voltage will be equal to the 30% of our digital signals amplitude.


Blue line represents analog output voltage.

PWM is used for controlling brightness of LED's, displays, motor rotating speed, etc.

Information sources:

No comments :

Post a Comment