Servo does not move on an ESP32: library, pin and power

The standard Arduino Servo library does not always work on ESP32 boards, and a servo needs far more current than a pin can give. Use a supported library and an external supply.

What the message means

A hobby servo needs a 50 Hz pulse of 1 to 2 ms and its own 5 V supply. The ESP32 can make the pulse with its LEDC hardware, but needs a library written for it.

Fix it in this order

  1. Install a servo library written for ESP32, such as ESP32Servo, and use its examples.
  2. Attach the servo to an output-capable pin, not 34 to 39.
  3. Power the servo from a separate 5 V supply and join its ground to the ESP32 ground.
  4. Check the pulse range in code, about 500 to 2400 microseconds for many servos.
  5. Do not power the servo from the 3.3 V pin.
  6. If it jitters, see the servo jitter page.

Why it happens

On an ESP32 the standard Servo library may not work; use the ESP32Servo library. Other causes are no separate 5 V servo supply, a missing common ground, or a signal pin that is input-only. The 3.3 V signal from the ESP32 is normally enough for hobby servos.

Install ESP32Servo, power the servo from its own 5 V supply with a shared ground, attach it to an output-capable pin, and write a value such as 90 first to test.

If you see this, do this

You seeDo this
No movement at allLibrary, pin or missing ground.
It moves then resets the boardServo current dips the supply. Use a separate supply.

servo jitter, servo torque calculator.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.