SG90 Micro Servo
A 9-gram positional micro servo that swings about 180 degrees in response to a 50 Hz servo pulse, rated at 4.8V.
- Supply voltage5 V
- InterfaceGPIO pulse timing
- Weight9 g

The SG90 is TowerPro's 9 g micro servo, rated 1.8 kg·cm of stall torque and 0.1 s per 60 degrees at 4.8 V, with about 180 degrees of travel (TowerPro SG90 spec page; SG90 datasheet). Connect brown to GND, red to 5 V and orange to a PWM-capable pin, then drive it with the Servo library: a 1.5 ms pulse every 20 ms centers it, about 1 ms and 2 ms reach the two ends (SG90 datasheet).
The SG90 is one of the most common hobby micro servos. It packs a small DC motor, a plastic POM gear train, a position-feedback potentiometer and a control board into a case of about 23 x 12.2 x 29 mm weighing 9 g (TowerPro). Three wires come out of it: power (red), ground (brown) and the control signal (orange). It is a positional servo, not a continuous-rotation motor.
Unlike a bare motor, a servo holds a commanded angle. It reads a pulse every 20 ms (50 Hz) on the signal line and moves its horn to a position set by the pulse width: about 1 ms is all the way to one side, 1.5 ms is the middle and about 2 ms is the other side, for roughly 180 degrees of travel (90 in each direction). TowerPro rates it at 1.8 kg·cm of stall torque and 0.1 s per 60 degrees at 4.8 V.
Because the driver electronics are built in, you only supply power and a pulse. On an Arduino, the Servo library generates the timing on any digital pin. The SG90 suits light positioning jobs such as pan-tilt mounts, small robotic arms and grippers, but its plastic gears and modest torque make it a poor fit for heavy or high-shock loads.
SG90 Micro Servo pinout
| Pin | Function | Type |
|---|---|---|
| VCC | VCC (5V)5 V | power in |
| GND | GND | power in |
| SIG | PWM | input |
How to wire the SG90 Micro Servo
Pin by pin, for the board you have.
| SG90 Micro Servo | Arduino Uno | Note |
|---|---|---|
| VCC | 5V | |
| GND | GND | |
| SIG | D3 |
| SG90 Micro Servo | ESP32 DevKit V1 | Note |
|---|---|---|
| VCC | VIN | |
| GND | GND | |
| SIG | GPIO13 (D13) |
- VCC is on VIN, which gives about 5 V only while the board is powered from USB.
| SG90 Micro Servo | Raspberry Pi Pico | Note |
|---|---|---|
| VCC | VBUS | |
| GND | GND | |
| SIG | GP0 |
- VCC is on VBUS, which gives about 5 V only while the board is powered from USB.
SG90 Micro Servo code
Every example here compiles for its board.
// SG90 Micro Servo on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/servo-sg90
#include <Servo.h>
const int SERVO_PIN = 3;
Servo servo;
void setup() {
servo.attach(SERVO_PIN);
}
void loop() {
for (int angle = 0; angle <= 180; angle += 2) {
servo.write(angle);
delay(15);
}
for (int angle = 180; angle >= 0; angle -= 2) {
servo.write(angle);
delay(15);
}
}
Compiled for arduino:avr:uno on 2026-10-30// SG90 Micro Servo on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/servo-sg90
#include <ESP32Servo.h>
const int SERVO_PIN = 13;
Servo servo;
void setup() {
servo.attach(SERVO_PIN, 500, 2400);
}
void loop() {
for (int angle = 0; angle <= 180; angle += 2) {
servo.write(angle);
delay(15);
}
for (int angle = 180; angle >= 0; angle -= 2) {
servo.write(angle);
delay(15);
}
}
Compiled for esp32:esp32:esp32 on 2026-10-30// SG90 Micro Servo on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/servo-sg90
#include <Servo.h>
const int SERVO_PIN = 0;
Servo servo;
void setup() {
servo.attach(SERVO_PIN);
}
void loop() {
for (int angle = 0; angle <= 180; angle += 2) {
servo.write(angle);
delay(15);
}
for (int angle = 180; angle >= 0; angle -= 2) {
servo.write(angle);
delay(15);
}
}
Compiled for rp2040:rp2040:rpipico on 2026-10-30// SG90 Micro Servo on STM32 Blue Pill (F103C8): wiring and a free simulation at https://www.tinkered.ai/components/servo-sg90
#include <Arduino.h>
#include <Servo.h> // the STM32 core's own Servo: no lib_deps
Servo servo;
void setup() { servo.attach(PA8); }
void loop() {
servo.write(0); delay(1000);
servo.write(180); delay(1000);
}
Compiled for stm32:stm32:bluepill_f103c8 on 2026-10-30Before you wire it
- SIG must connect to a PWM-capable pin (D3, D5, D6, D9, D10, D11)
- For more than 1 servo: use external power supply (Arduino 5V cannot provide enough current)
- Common GND between Arduino and external power supply is mandatory
- Use the Servo library: attach(pin), write(angle), the library DIFFERS by platform, see lib_deps below
- Add 100uF electrolytic capacitor across power supply for stability (optional but recommended)
- Do not power more than 1 servo from Arduino 5V pin (stall current exceeds USB supply)
- Do not omit common GND between Arduino and external supply
- Do not use non-PWM pins for SIG
- TowerPro rates the SG90 at 4.8 V; it is normally run from a 5 V rail.
- One SG90 with a light load can run from a board's 5V pin. For more than one servo, or a servo working under load, give the servos their own 5 V supply: the current spike as a servo starts or stalls can sag the board's regulator and reset it.
- Always tie an external supply's ground to the Arduino ground. The pulse is referenced to ground, so without a shared ground the servo jitters or ignores the signal.
- No external motor driver or flyback diode is required: the SG90's own control board drives the motor. The signal pin only receives the 50 Hz pulse.
- A 100 µF electrolytic capacitor across the servo supply smooths the current spikes and reduces brownout resets, especially with several servos.
Specifications
- Supply voltage
- 5 V
- Interface
- GPIO pulse timing
- Weight
- 9 g
From the maker's datasheet.
Common mistakes
Powering several servos from the Arduino's 5V pin
Each SG90 pulls a current spike when it starts or stalls. Two or more on the board's 5V pin sag the regulator and the board browns out or resets. Use a separate 5 V source for the servos and share a common ground with the Arduino.
Treating it like a continuous-rotation motor
The standard SG90 is a positional servo with about 180 degrees of travel. Commanding it to spin like a wheel only drives it against its end stop, where it buzzes and stalls.
Forgetting the common ground
When the servo runs from an external supply, its ground must connect back to the Arduino ground. Skipping this leaves the signal without a reference, so the servo twitches or does not respond.
Commanding angles beyond the travel range
Pulses past what a unit can reach push the servo against its mechanical stops. It grinds and pulls stall current, which heats the motor and wears the plastic gears.
Reversing the power wires
On the SG90, brown is ground, red is power and orange is the signal. Swapping red and brown puts reverse voltage on the control board and can damage the servo.
SG90 Micro Servo questions
What voltage does an SG90 servo need?
TowerPro rates the SG90 at 4.8 V, and its torque (1.8 kg·cm) and speed (0.1 s per 60 degrees) are given at that voltage (TowerPro SG90 spec page). In practice it runs from a 5 V rail.
Can I power an SG90 from the Arduino 5V pin?
One lightly loaded SG90, yes. For two or more, or a servo under load, use a separate 5 V supply with its ground tied to the Arduino's ground, because the start-up spikes reset the board. A 100 µF capacitor across the servo supply helps.
Can an ESP32 or Raspberry Pi Pico control an SG90?
Yes. The 3.3 V pulse from an ESP32 or Pico drives the orange signal wire, while red takes 5 V from VIN, VBUS or an external supply with a shared ground. On the ESP32 family use the ESP32Servo library; the Pico core ships its own Servo.h.
Why does my SG90 jitter or not move?
Check the three usual causes: no common ground between the servo supply and the board, a supply that sags when the servo starts, or the signal on a pin your sketch did not attach. A servo that buzzes at one end is being driven past its travel; reduce the pulse range.
How many degrees does an SG90 rotate?
About 180 degrees, 90 in each direction: a 1.5 ms pulse is the middle, about 1 ms is fully one way and about 2 ms fully the other (SG90 datasheet). Units vary slightly, so check the end points of yours before fixing a mechanism to it.
SG90 vs MG996R: which servo should I use?
The SG90 weighs 9 g and gives 1.8 kg·cm at 4.8 V on plastic gears (TowerPro SG90 spec page); the MG996R weighs 55 g and gives 11 kg·cm at 6 V on metal gears with a 1,400 mA stall current (TowerPro MG996R spec page). Use the SG90 for light pointers and flaps, the MG996R for arms and loads.
Build something with the SG90 Micro Servo
- Build this
Pan-tilt camera or sensor mount
Two SG90s stacked at right angles aim a camera or distance sensor across two axes for tracking and scanning.
- Build this
Radar-style ultrasonic scanner
Mount an HC-SR04 on the servo horn and sweep it back and forth to plot distances on a radar-style display.
- Build this
Small robotic arm or gripper
Several SG90s form the joints of a lightweight arm or an open/close gripper for pick-and-place demos.
- Build this
Automated dispenser or pet feeder
The servo swings a flap to release a measured portion on a schedule.
- Build this
Analog dial or gauge indicator
Map a sensor reading to a servo angle to drive a physical needle across a printed scale.
This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/servo-sg90.md