PWM (Pulse Width Modulation)
Pulse width modulation is used in a variety of applications including dimming of LEDs, DC Motor Speed Control or to control the direction of a servo motor. In PWM we work on concept of duty cycle.
Pulse width modulation allows us to vary the time of a signal to be in high or low state in an analog fashion. Where the signal can only be high (usually 5V) or low (ground) at any time, we can change the time for which the signal is high compared to when it is low over a consistent time interval. When the signal is high, we call this "on time". Percentage of “on time” is called duty cycle. 100% duty cycle would be the same as setting the voltage to 5 Volts (high). 0% duty cycle would be the same as grounding the signal.
Important terms associated with PWM:
TON (On Time): It is the time when the signal is high.
TOFF (Off Time): It is the time when the signal is low.
Period: It is the sum of on time and off time.
Duty Cycle: It is the percentage of time when the signal was high during the time of period.