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 SuperMini | SG90 micro servo (9 g) | Wire | Notes |
|---|---|---|---|
| 10 | SIG | orange | A 3.3 V signal is enough for the SG90. |
| 5 V 1 A supply · +5V | VCC | red | |
| 5 V 1 A supply · GND | GND | brown | |
| GND | GND | black | Common 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
Servolibrary 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
// 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);
}
}// 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
Sweeping 0° ↔ 180°
Angle 0°
Angle 30°
Angle 60°
Angle 90°Sweeping 0° ↔ 180° Angle 0° Angle 30° Angle 60° Angle 90°