Skip to content
Omnikalc

PWM duty cycle and average voltage calculator

From the supply voltage, frequency and duty cycle of a PWM signal, get the on and off times, the average and RMS voltage, the power in a resistive load and the timer compare value.

Updated on
Your inputs
V

Value out of range

Hz

Value out of range

%

Value out of range

Ω

Value out of range

Timer resolution

Results

Average voltage

3.00 V

Average power in the load

3.6 W

RMS voltage
6.00 V
On-time per period
250 µs
Off-time per period
750 µs
Period
1,000 µs
Peak current when on
1.2 A
Timer compare value
64

What PWM does

Pulse-width modulation switches a voltage fully on and fully off many times per second. The share of each period spent on is the duty cycle. Because the switch itself wastes almost no power, PWM is the standard way to dim LEDs, control motor speed, drive heaters and build switching power supplies.

Key formulas

  • Period T = 1 ÷ frequency
  • On-time = duty × T, off-time = (1 − duty) × T
  • Average voltage = duty × V
  • RMS voltage = V × √duty
  • Power in a resistor R = duty × V² ÷ R

The average sets the speed of a motor or the brightness perceived through a filter. The RMS value sets the heating of a resistive load, which is why it is higher than the average.

Example

A 12 V supply at 1 kHz with a 25% duty cycle:

Quantity Value
Period 1,000 µs
On-time 250 µs
Average voltage 3 V
RMS voltage 6 V
Power into 10 Ω 3.6 W
8-bit compare value 64 of 255

The power is a quarter of the 14.4 W the resistor would take at full on, while a steady 3 V supply would give only 0.9 W. This difference matters when you size resistors or heaters.

Choosing a frequency

  • LEDs: above about 200 Hz to avoid visible flicker; above 1 to 2 kHz for cameras.
  • DC motors: often 15 to 25 kHz, above the audible range, to avoid whine.
  • Switching regulators: from 100 kHz to several MHz to keep inductors small.
  • Servos: a 50 Hz frame with a 1 to 2 ms pulse, which is position coding rather than average power.

Timer resolution

Microcontroller timers count from 0 to 2ⁿ − 1. The compare value sets the duty cycle: 8 bits gives 256 steps, 10 bits 1,024 and 16 bits 65,536. Higher resolution at the same timer clock lowers the maximum PWM frequency: f = f_timer ÷ 2ⁿ.

Frequently asked questions

What is the duty cycle?

It is the percentage of each period the signal spends on. A 25% duty cycle is on for a quarter of the time and off for three quarters.

Why is the RMS voltage higher than the average?

Power depends on the square of the voltage. During the on-time the load sees the full voltage, so the heating effect, measured by the RMS value, exceeds what the average suggests.

Does PWM really change motor speed?

Yes. The motor's inductance and inertia smooth the pulses, so it responds mostly to the average voltage, while the transistor stays efficient because it is either fully on or fully off.

Which PWM frequency should I use?

Above 200 Hz for LEDs to avoid flicker, 15 to 25 kHz for motors to avoid audible whine, and higher frequencies for switching power supplies.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.