Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.
Actuator · servo

Fix servo jitter, twitching or ESP32 resets when the servo moves

Servos jitter from weak power, a shared supply with the board, or PWM timing conflicts. Give the servo its own 5 V supply with a common ground.

Arduino UnoESP32Arduino NanoUpdated 31 Oct 2026

Community draft — report a mistake

What you see

OutputOutput
(servo buzzes and twitches around the target angle)
ESP32 Serial Monitor:
Brownout detector was triggered

Servo jitter is almost always a power problem. A servo is a small motor with a control circuit; when it pulls current from the same supply as your board, both suffer.

Quick fix — try in order

  1. 1

    Power the servo separately

    Use a 5 V supply rated at least 1 A per SG90 (more for MG996R). Do not power servos from the board’s 5V or 3V3 pin.

  2. 2

    Connect the grounds

    The servo supply GND must connect to the board GND, or the signal has no reference.

  3. 3

    Add a capacitor at the servo supply

    470–1000 µF across 5 V and GND near the servo absorbs current spikes.

  4. 4

    Use the right library and pin

    ESP32: use ESP32Servo and a normal output pin. Uno: Servo uses Timer1, which disables PWM on pins 9 and 10.

  5. 5

    Detach when idle

    If the servo only needs to hold position lightly, detach() after moving to stop the hunting buzz.

Why it happens

Supply voltage dips

A moving servo draws hundreds of mA. On a shared supply the voltage dips, the servo loses its reference and the ESP32 may reset — see brownout.

Noisy signal or long wires

Long servo leads pick up noise; keep them short or twist signal with ground.

Cheap or worn servos

SG90 servos have a small deadband and plastic gears; some jitter at rest is normal for them.

Board-specific notes

Current budget: Check your total with the current budget tool.

Parts: SG90 servo — pinout, voltage and library notes.

↑↓ to move · Enter to open