PWM Servo Calculator
Calculate PWM pulse width, duty cycle, and servo angle.
Servo range
Angle
90.0°
Pulse width
1500.0 µs
Duty cycle
7.500%
16-bit timer count
4,915
Pulse = minPulse + (angle − minAngle) / (maxAngle − minAngle) × (maxPulse − minPulse)
Period = 20000 µs (1/50 Hz)
Period = 20000 µs (1/50 Hz)
Calculate servo PWM values for any microcontroller
Convert between angle, pulse width, and duty cycle for standard RC servos. The 16-bit timer count output is ready to use with STM32, Arduino, and ESP32 timers.
Frequently asked questions
- What PWM frequency do servos use?
- Standard RC servos use 50 Hz (20ms period) PWM. The pulse width from 500µs–2500µs maps to 0°–180°. Some digital servos support up to 333 Hz for faster response.
- What is the standard servo pulse range?
- Most hobby servos use 1000µs–2000µs (1ms–2ms) as the working range, with 1500µs as center (90°). Many servos actually accept 500µs–2500µs for extended range.
- How do I calculate the 16-bit timer compare value?
- For a 16-bit timer at 50 Hz: compare value = (pulse_µs / period_µs) × 65535. For example, 1500µs at 50 Hz = (1500/20000) × 65535 = 4915.
Related tools
- Resistor Color Code Calculator
Decode resistor color bands. Supports 4-band and 5-band.
- Ohm's Law Calculator
Calculate voltage, current, resistance, or power using Ohm's Law.
- Voltage Divider Calculator
Calculate output voltage for a resistor voltage divider.
- 555 Timer Calculator
Calculate frequency, duty cycle, and timing for 555 timer circuits.
- CRC Calculator
Calculate CRC checksums — CRC-8, CRC-16, CRC-32, and custom polynomials.