A hobby servo reads a 50 Hz pulse; the pulse width sets the angle. Enter the pulse range of your servo and the angle you want.
Ranges differ between servos. Test the limits slowly, because a servo pushed past its stop draws high current.
How it is calculated
Pulse width = minimum pulse + (maximum pulse − minimum pulse) × angle ÷ angle range. Period = 1,000,000 ÷ frequency in microseconds. Duty cycle = pulse width ÷ period. Duty count = duty cycle × (2 to the power of bits − 1).
A worked example
With a 500 to 2400 us range over 180 degrees, 90 degrees gives 500 + 1900 × 90 ÷ 180 = 1,450 us. At 50 Hz the period is 20,000 us, so the duty cycle is 1,450 ÷ 20,000 = 7.25%. With 16 bits that is a count of about 4,751.
Common mistakes
- Assuming every servo uses exactly 1000 to 2000 us.
- Using the 3.3 V pin to power the servo instead of a separate 5 V supply.
- Driving the servo to its mechanical limit and stalling it.
Related
servo torque calculator, servo not moving on ESP32, servo jitter.
Last reviewed: November 2026. The calculator runs in your browser and sends nothing anywhere. Results are ideal-case figures; add margin before you order parts.