From the course: Learning Arduino: Interfacing with Analog Devices

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding pulse-width modulation (PWM)

Understanding pulse-width modulation (PWM) - Arduino Tutorial

From the course: Learning Arduino: Interfacing with Analog Devices

Start my 1-month free trial

Understanding pulse-width modulation (PWM)

- [Instructor] Pulse with Modulation or PWM simulates an analog output signal using a digital signal. Let's see how it works. We know that the digital values are zero or one. So they are either low or high. The pulse with modulation technique controls the amount of time a digital output toggles between high and low values. This is called the duty cycle of the signal. So this is a 0% duty cycle. This means that the digital output is always at the low-level. With a 20% duty cycle the high is kept on for 20% of the total period. When the duty cycle is 50%, the high value is applied half of the time, so it's on for half of the period. The same principle applies when having 70% duty cycle and 100% duty cycle, where the digital output is always high. The duration of the on time is called the pulse width. To get varying analog values, you change or modulate that pulse width. The length of the duty cycle determines the simulated analog voltage generated by the digital interface. The longer…

Contents