[Coco] Project Sneak Peek

Salvador Garcia salvadorgarciav at yahoo.com
Thu Jul 21 10:31:50 EDT 2016

```Although Mathieu sent you the link of links, I'll answer your question here. PWM is YAA* for Pulse Width Modulation and is a way to modulate using the duty cycle. The modulation can be used to encode data or to control power transferred.

For example, suppose we have  a wave that looks something like 000000111111000000111111000000111111 where 0 is the low level (off) and 1 is the high level (on). Here the duty cycle is 50/50 because the wave is on half of the time and off the other half, as represented by the 6 zeros off and the 6 ones on. If I change the duty cycle to say 80/20, now the level is on 80% of the time and off the remaining 20%.

Using the duty cycle I can now, for example, dim an LED. A straight forward way of dimming an LED is to decrease the voltage; however, what if the voltage is not variable? In this case, I can use a programmable device to establish a duty cycle for the voltage going to the LED. Using the example above, if the duty cycle is 50/50 then that means that the voltage going to the LED will be Vcc half the time and 0v the other half. This will cause the LED to glow at half the brightness of Vcc, not because its voltage varied (which it did not), but because of the time that it is ON and OFF. If I change the duty cycle to 80/20 then Vcc will be Vcc 80% of the time and off the remaining 20%. This will cause the LED to glow brighter than the previous 50/50. What if I invert the duty cycle and now have 20/80? In this case the LED will only have a slight glow because it will be off 80% of the time and on the remaining 20%.

Since sound is a frequency, PWM can be used to encode the audio signal by varying the duty cycle. Voltage regulation is the adaptation of an input voltage to a desired output voltage. If I have 9v, but require 6v, I can use PWM with the correct duty cycle to limit the output and thus generate the desired 6v. I hope this helps :-) Salvador

*Yet Another Acrionym

From: Richard E. Crislip <rcrislip at neo.rr.com>
To: coco at maltedmedia.com
Sent: Thursday, July 21, 2016 8:35 AM
Subject: Re: [Coco] Project Sneak Peek

OK <Ignorance on> what is PWM? TIA <Ignorance off>

```

More information about the Coco mailing list