Skip to main content
What is PWM (Pulse Width Modulation)?
  1. Glossary/

What is PWM (Pulse Width Modulation)?

6 mins·
Ben Schmidt
Author
I am going to help you build the impossible.

You might be building a software company where the physical world is an abstraction. But for many founders, the product involves hardware. It involves moving parts, lights, batteries, and the constraints of physics. If you are building a physical product, you inevitably collide with the challenge of controlling power efficiently.

At some point, your engineering team will mention PWM or Pulse Width Modulation. They might bring it up when discussing battery life, motor speed, or why the LED indicator looks strange on a smartphone camera.

It is not just a technical footnote. It is a fundamental method used to bridge the gap between digital logic and analog reality.

In the simplest terms, computers and microcontrollers like to be digital. They prefer states that are On or Off. High or Low. 1 or 0.

The real world is analog. You want a light to be 50% bright, not just on or off. You want a drone propeller to spin at 30% speed. You want a heater to maintain a specific mild temperature.

PWM is the technique used to fake analog behavior using digital signals. It achieves this not by lowering the voltage, but by chopping the signal up into tiny pieces of time.

The Mechanics of the Signal

#

To understand PWM, you have to stop thinking about power as a continuous stream like water flowing from a tap. Instead, think of a light switch.

If you want a light to be half as bright, you have two options. You could reduce the electricity flowing to it, which is the analog approach. Or, you could flip the switch on and off so fast that the human eye cannot see the flickering. If the switch is on for half the time and off for half the time, your brain averages the light out. It looks like 50% brightness.

This is Pulse Width Modulation.

The signal creates a square wave. It oscillates between zero voltage (off) and full voltage (on). There are two main variables you need to understand here.

The first is the Duty Cycle. This is the percentage of time the signal is high (on) versus low (off) during a single cycle.

  • A 50% duty cycle means the power is on half the time.
  • A 10% duty cycle means the power is on only 10% of the time, resulting in a dim light or a slow motor.
  • A 100% duty cycle is just fully on.

The second variable is Frequency. This is how fast the switching happens. If the switching is too slow, you will see the light flicker or feel the motor shudder. If it is fast enough, the output feels smooth and continuous. For LEDs, this usually needs to be faster than 100 times per second (100 Hz) to fool the human eye.

PWM vs. Analog Control

#

Why do engineers prefer this rapid switching over just lowering the voltage?

It comes down to efficiency and heat.

In an analog system, if you want to run a 12V motor at 6V speed, you essentially have to block half the voltage. Traditionally, this is done with a component called a resistor or a linear regulator. The problem is that the blocked energy has to go somewhere. In electronics, wasted energy almost always turns into heat.

If you are building a handheld device or a wearable, heat is your enemy. Heat degrades batteries. It requires bulky heatsinks or fans which ruin your sleek industrial design. It makes the device uncomfortable to hold.

PWM solves this.

When the switch is off, no power is flowing, so no heat is generated. When the switch is fully on, the component is operating at its most efficient state with very little resistance. By switching between fully on and fully off, you avoid that wasteful middle ground where energy is burned off as heat.

Heat is the enemy of hardware.
Heat is the enemy of hardware.
For a startup focused on battery life, shifting from linear regulation to PWM can be the difference between a product that lasts 4 hours and one that lasts 12.

Common Use Cases in Startups

#

You will encounter this technology in three specific areas of product development.

1. LED Dimming Almost every modern device with a dimmable light uses PWM. It ensures the color of the LED remains consistent. Lowering the actual voltage can sometimes shift the color temperature of an LED, but PWM keeps the voltage constant and just changes the timing. This preserves the design integrity of your product.

2. Motor Control If you are in robotics, drones, or automated hardware, you are using PWM. It is the standard way to control servo motors and DC motors. The width of the pulse tells the servo exactly which angle to rotate to. It allows for precise control without losing torque.

3. Audio Class D Amplifiers This is more technical, but modern efficient speakers use a variation of PWM to create sound. It allows small smart speakers to produce loud volume without overheating.

Risks and Considerations

#

While PWM is efficient, it introduces complexity that can bite you during the later stages of product development.

The main issue is EMI (Electromagnetic Interference).

Because you are rapidly switching electricity on and off, you are essentially creating a radio transmitter. These sharp rises and falls in voltage create noise.

If you are not careful with your circuit board layout, this noise can interfere with other parts of your device, such as WiFi or Bluetooth antennas.

More importantly, it can cause you to fail certification testing. Before you can sell electronics in the US or Europe, you must pass FCC or CE testing to prove your device does not pollute the radio spectrum. Poorly implemented PWM is a common reason for failing these expensive tests and delaying launch.

There is also the issue of audible noise.

If the frequency of your PWM falls within the range of human hearing (20Hz to 20kHz), your product might emit a high-pitched whine. This is physically caused by components vibrating on the circuit board.

Imagine shipping a premium smart home device that emits a faint, annoying squeal whenever the lights are dimmed to 50%. It is a user experience disaster that happens more often than you would think.

Finally, consider the video effect.

Have you ever tried to take a video of a car dashboard or a digital sign and seen it flickering or banding on your phone screen? That is caused by PWM. The camera’s shutter speed is out of sync with the LED’s switching frequency.

If your product is meant to be photographed or used on video sets, you need to ensure your engineers push the frequency high enough so it does not interfere with cameras.

The Founder’s Perspective

#

You do not need to know how to calculate the duty cycle or program the microcontroller timers yourself. However, you do need to understand the trade-offs.

When you push for better battery life, you are likely pushing your team toward PWM solutions. When you ask for smoother motor transitions or distinct lighting behaviors, you are relying on this mechanism.

Ask your engineering lead about the frequency they have chosen. Ask if they have considered the EMI implications early in the design phase rather than waiting for the final certification candidate.

Building hardware is about managing constraints. PWM is one of the most powerful tools available to manage the constraints of power and heat. It allows digital brains to interact elegantly with an analog world. Understanding it removes one more layer of mystery from the machine you are trying to build.