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.

SG90 servo with ESP32-C3 SuperMini — ESP32Servo sweep

Drive an SG90 servo from GPIO10 of an ESP32-C3 SuperMini with ESP32Servo, powered from its own 5 V supply so the tiny board doesn’t brown out.

Arduino C++Verified — core esp32 3.3.12, ESP32Servo 3.2.1, 3 Nov 2026Compile-only

Community draft — report a mistake

An SG90 needs a 50 Hz pulse of roughly 0.5–2.4 ms. ESP32Servo produces it on any output pin of the C3, so the sketch looks just like an Uno servo sketch.

The SuperMini-specific lesson is power: the board is tiny and so is its regulator. Give the servo its own 5 V supply, join the grounds, and send only the signal from GPIO10.

Wiring

ESP32-C3 SuperMiniOnly the pins used are shown · 3.3 V logic5 V 1 A supplySG90 micro servo (9 g)+5VGNDGND10 · 10SIGVCCGND
Also needed: 5 V 1 A supply (or 4×AA pack), 470 µF capacitor across the servo supply.
Every connection
ESP32-C3 SuperMiniSG90 micro servo (9 g)WireNotes
10SIGorangeA 3.3 V signal is enough for the SG90.
5 V 1 A supply · +5VVCCred
5 V 1 A supply · GNDGNDbrown
GNDGNDblackCommon ground between the supply and the SuperMini.

4.8–6 V (several hundred mA while moving or stalled) part, 3.3 V board. The signal input is happy with 3.3 V logic, so ESP32 and Pico drive it directly. On ESP32 use the ESP32Servo library — the standard Servo library is for AVR and RP2040.

Board quirks

  • The Arduino Servo library is AVR-only. ESP32Servo supports the C3 and drives the pulse from an LEDC channel — the C3 has 6 of them, so up to 6 servos.
  • A moving SG90 pulls a few hundred mA, a stalled one more. On the SuperMini that dips the USB 5 V and the small 3.3 V regulator, and the C3 resets. A separate 5 V supply with a common GND fixes it.
  • GPIO10 has no boot role. Avoid GPIO2/8/9 (strapping) — a servo twitching during reset is the least of the problems there.

Code

servo-esp32c3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// SG90 micro servo on an ESP32-C3 SuperMini with ESP32Servo.
// SIG → GPIO10. Servo VCC/GND → a separate 5 V supply, and that supply's GND → SuperMini GND.
// The SuperMini's small 3.3 V regulator and USB 5 V can't absorb servo current spikes.
#include <ESP32Servo.h>

constexpr uint8_t SERVO_PIN = 10;
Servo servo;

void setup() {
  Serial.begin(115200);
  delay(1500);  // let the native USB serial port enumerate
  servo.setPeriodHertz(50);           // standard 50 Hz servo frame
  servo.attach(SERVO_PIN, 500, 2400);  // SG90 pulse range in µs
  Serial.println("Sweeping 0° ↔ 180°");
}

void loop() {
  for (int a = 0; a <= 180; a += 30) {
    servo.write(a);
    Serial.printf("Angle %d°\n", a);
    delay(500);
  }
  for (int a = 180; a >= 0; a -= 30) {
    servo.write(a);
    Serial.printf("Angle %d°\n", a);
    delay(500);
  }
}

Library: Servo (Arduino) — compiled with ESP32Servo 3.2.1.

Expected serial output

Serial Monitor · 115200Output
Sweeping 0° ↔ 180°
Angle 0°
Angle 30°
Angle 60°
Angle 90°

Common errors

Servo jitters or buzzes

Supply noise. Add a 470 µF capacitor across the servo supply and keep the common GND short. Full fix.

“Servo.h: no such file” or “architecture avr” error

You included the AVR Servo library. Install ESP32Servo and include ESP32Servo.h. Full fix.

↑↓ to move · Enter to open