PWM Signal Generation using AVR Timers

Printer-friendly versionPDF version

PWM Signal Generation using AVR Timers from Priyank Bolia on Vimeo.

Microcontrollers can only generate a high voltage of +5V and a low voltage of 0V. Let's say you need a +2.5V for controlling the brightness of LED or the speed of the DC motor. To handle such situations, we use Pulse Width Modulation (PWM). In PWM, we will vary the output voltage between high and low at a very high speed, such that, the effective output voltage is the desired voltage. For example, for +2.5V, we will switch between high and low voltage alternatively, at a very high speed. The output wave is actually square in nature, but at a very high frequency, we can safely assume the average as the output voltage.

PWM

More information about PWM and the code for this example can be found at:

No votes yet