If you’ve used any prototyping platform or are generally an electronics enthusiast, you must have heard of the term PWM, or Pulse-Width Modulation. But what is it?
Pulse Width Modulation is just a cool way to talk about a Digital Signal, consisting of 1s and 0s or “ON” and “OFF”. As most of you probably know, everything in computers works on the principle of ones and zeroes, or binary. Each “1” is basically a “ON” Signal while each “0” is an “OFF” Signal. A typical PWM wave looks something like the one below.
As you can see, each crest (High point) is a 5V signal and each trough (Low Point) is where there is no voltage.
PWM is used almost everywhere in computer. That’s why Arduino boards have specially labelled PWM pins.
PWM has some really important practical uses. The most common one is to dim an LED.
How?
Let me give you a quick biology lesson. The human eye has a persistence of vision of 0.1 seconds. That means that images stay in a person’s mind for 0.1 seconds before a next distinct one can be shown. This means that if images are shown at a succession of less than 01 seconds interval, the human brain cannot perceive them as separate images, but rather considers them to be part of one moving object. This is the concept on which videos work. They are images that are played at more than 10 Frames per Second.
This can be applied to LEDs. If we turn on the LED for 0.25 seconds, then turn it off for 0.75 seconds and repeat this cycle, our brain won’t be able to register them as two different states. What’s the difference from a continuously on light? It will only be of 25% brightness.
By managing the on and off times, we can alter the brightness of the LED or Bulb. See the PWM examples below:
Hopefully you now know what PWM is! Please don’t hesitate to ask your questions in the comments section below. Thanks!



