⚡
usefultools.dev
PWM

PWM Duty Cycle & Frequency Calculator

NOVO

PWM duty cycle calculator: convert frequency, period, on-time and duty %, get average voltage and AVR / Arduino timer prescaler and TOP settings.

Funciona 100% no seu navegador — o que você insere nunca é enviado nem armazenado nos nossos servidores.

Esta ferramenta ainda não está totalmente traduzida, por isso parte do texto continua em inglês. A ferramenta funciona da mesma forma em todos os idiomas.

Hz

= 1 kHz

%
V

= 5 V

Frequency
1 kHz
Duty cycle
25 %
Period
1 ms
On-time
250 µs
Off-time
750 µs
Average voltage
1.25 V
RMS 2.5 V
Fórmula com os seus números
T    = 1 / f = 1 ms
D    = t_on / T = 250 µs / 1 ms = 25 %
Vavg = D × V = 0.25 × 5 V = 1.25 V
Vrms = √D × V = 2.5 V
0 V5 V0 s1 ms2 ms3 ms
PWM outputAverage 1.25 V
The average voltage applies to a resistive load or after an RC filter. Motors and LEDs respond to the average power, but a logic input still sees full 0 / 5 V pulses.
Timer resolution helper (AVR / Arduino style)
Hz

= 16 MHz

PWM frequency
976.56 Hz
Resolution
8 bits
256 steps
Duty step
0.3906 %
Tick
4 µs
Compare value for 25 %
63
OCR = round(D·(TOP+1)) − 1
Closest setting for 1 kHz: N = 64, TOP = 249 → 1 kHz (0 %), 7.97 bits, OCR = 62.
Arduino Uno defaults (16 MHz, N = 64, TOP = 255): pins 5 and 6 run fast PWM at 976.56 Hz, pins 3, 9, 10 and 11 run phase-correct PWM at 490.2 Hz. Formulas follow the ATmega328P datasheet — verify against the datasheet for your exact board.
⚡

Exemplos rápidos

Entradas típicas e os resultados que esta ferramenta gera.

Timing
1 kHz, 25 % duty
on 250 µs, off 750 µs
Voltage
50 % of 12 V
Vavg 6 V, Vrms 8.485 V
Timer
16 MHz, N 64, TOP 255, fast
976.56 Hz, 8 bits
Timer
16 MHz, N 64, TOP 255, phase
490.2 Hz
Find
20 kHz on 16 MHz Timer1
N 1, TOP 799, 9.64 bits
📖

Visão geral

Pulse-width modulation switches a pin fully on and off at a fixed frequency; the share of each period spent high is the duty cycle. Motors, LEDs and heaters respond to the average, so 25 % duty on a 5 V pin acts roughly like 1.25 V into a resistive load.

This PWM duty cycle calculator converts between frequency, period, on-time, off-time and duty percentage, and shows the average and RMS voltage with a waveform. A timer helper applies the ATmega328P formulas — fast PWM f = clk / (N·(1 + TOP)) and phase-correct f = clk / (2·N·TOP) — to give frequency, duty resolution in bits and the compare register value, and finds the prescaler and TOP that hit a target frequency on an 8- or 16-bit timer.

It runs entirely in your browser. Use it for Arduino analogWrite tuning, motor drivers, LED dimming or any microcontroller timer setup; check your chip's datasheet for its own timer modes.

Por que usar esta ferramenta?

  • Convert frequency, period and duty in one place
  • Know the real average voltage at the load
  • Pick prescaler and TOP without trial and error
  • See how many duty steps your timer really has
  • Private, free and instant
⭐

Recursos

🔄

Two-way conversion

Enter frequency or period plus duty % or on-time; everything else is derived.

⚡

Average and RMS voltage

Vavg = D·V and Vrms = √D·V for the supply you enter.

⏲️

Timer helper

Clock, prescaler, TOP and mode give frequency, tick, bits and duty step.

🎯

Prescaler finder

Finds the highest-resolution prescaler / TOP for your target frequency.

🔢

Compare value

OCR value for the current duty cycle in fast or phase-correct mode.

📈

Waveform

SVG of three periods with the average level marked.

🛠️

Como usar

1

Set timing

Choose Frequency or Period and type a value such as 1k or 50u.

2

Set pulse width

Choose Duty % or On-time and enter it, plus the supply voltage.

3

Tune the timer

In the timer helper enter the clock, timer width, mode, prescaler and TOP.

4

Copy the result

Copy the timing summary or note the suggested prescaler, TOP and OCR.

🤔

Perguntas frequentes