VMA502
V. 02 – 05/04/2019
7
©Velleman nv
7.3
PWM Gradational LED
PWM (Pulse Width Modulation) is a technique used to encode analogue signal levels into digital ones. A
computer cannot output analogue voltage but only digital voltage values. So, we will be using a high-resolution
counter to encode a specific analogue signal level by modulating the duty cycle of PWM. The PWM signal is also
digitalized because in any given moment, fully on DC power is either 5 V (on) of 0 V (off). The voltage or
current is fed to the analogue load (the device using the power) by repeated pulse sequence being on or off.
Being on, the current is fed to the load; being off, it is not. With the adequate bandwidth, any analogue value
can be encoded using PWM. The output voltage value is calculated via the on and off time.
output voltage = (turn on time/pulse time) * maximum voltage value
PWM has many applications: lamp brightness regulation, motor speed regulation, sound making, etc. The
following are the basic parameters of PWM:
There are six PQM interfaces on Arduino
®
, namely digital pin, 3, 5, 6, 9, 10 and 11. In this experiment, we will
be using a potentiometer to control the LED brightness.