Blog

SG90 Micro Servo Motor – Complete Guide

Micro Servo Motor

SG90 Micro Servo Motor

9g Analog Servo with 180° Positional Control

Unlike a plain DC motor, a servo is a small closed-loop position-control system in a single package: a geared-down DC motor is mechanically coupled to a potentiometer that continuously reports the output shaft's current angle back to a tiny onboard control board, which compares that reading against the angle you're commanding and drives the motor until the two match, then holds that position actively against outside force. All of this is commanded over a single signal wire using a 50Hz PWM pulse whose width - typically between 1ms and 2ms, with 1.5ms landing at center - maps directly to a target angle, which is exactly why servos are so easy to use from virtually any microcontroller: one digital pin and a standard servo library are all it takes, with none of the H-bridge or motor-driver circuitry a plain DC motor would require. The SG90's plastic gear train keeps cost and weight down, at the tradeoff of somewhat less durability under sustained heavy load than metal-gear servos like the MG90S or MG996R.

0° – 180°
Rotation
1.8 kg·cm
Torque
~0.1s / 60°
Speed

Key features

Closed-Loop Position Control

An internal potentiometer feeds back shaft angle, letting the servo hold a commanded position precisely.

Single-Wire PWM Control

One signal pin sets the target angle - no separate driver circuitry required.

Plastic Gear Train

Lightweight and inexpensive, well suited to light-duty projects.

Compact & Lightweight

About 9 grams, small enough to fit into tight robotics and RC builds.

Standard 3-Pin Connector

Compatible with virtually every hobby servo header and extension cable.

Wide Voltage Tolerance

Runs from 4.8V to 6V, matching both 5V logic supplies and RC battery packs.

Technical specifications

Operating Voltage 4.8V – 6V
Rotation Range 0° – 180°
Stall Torque ~1.8 kg·cm (at 4.8V)
Operating Speed ~0.1 sec / 60° (at 4.8V, no load)
Control Signal PWM, 50Hz, 1–2ms pulse width
Gear Type Plastic (nylon)
Weight ~9g
Dead Band Width ~10µs
Connector ~25cm cable, standard 3-pin servo connector

Pinout

PinFunction
Signal (Orange/Yellow) PWM control input
VCC (Red) 4.8V – 6V power supply
GND (Brown/Black) Ground

Applications

RC car steering Small robotic arm joints Camera pan-tilt mounts RC airplane control surfaces Animatronics and costume props Line-following and sumo robot steering

What's in the box

1x SG90 micro servo
Mounting horns and screws

Downloads

Datasheet (PDF) Arduino Servo Library Example Sketch
🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
SG90Signal/VCC/GNDboard PWM-capable pin / 5V / GND
📟
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - Arduino Uno
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - Arduino Nano
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - Arduino Mega
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - ESP32
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - ESP8266
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - STM32
Micro Servo SG90 - 0 to 180 Degrees, 1.8 kg.cm, Plastic Gears - Raspberry Pi Pico
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_arduino_uno.inoArduino Uno
567 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin 9 on Arduino Uno. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN 9
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_arduino_nano.inoArduino Nano
568 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin 9 on Arduino Nano. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN 9
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_arduino_mega.inoArduino Mega
568 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin 9 on Arduino Mega. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN 9
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_esp32.inoESP32
563 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin 25 on ESP32. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN 25
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_esp8266.inoESP8266
565 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin D1 on ESP8266. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN D1
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_stm32.inoSTM32
565 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin PA8 on STM32. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN PA8
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
📄 File: micro_servo_sg90_-_0_to_180_degrees,_1.8_kg.cm,_plastic_gears_-_raspberry_pi_pico.inoRaspberry Pi Pico
575 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// Signal pin 15 on Raspberry Pi Pico. Power the servo from a separate 5V supply for anything beyond a single small SG90 - a board's own 5V pin can't supply a servo's stall current.
6#include <Servo.h>
7
8Servo myServo;
9#define SERVO_PIN 15
10
11void setup() {
12 Serial.begin(115200);
13 myServo.attach(SERVO_PIN);
14}
15
16void loop() {
17 for (int angle = 0; angle <= 180; angle += 5) {
18 myServo.write(angle);
19 delay(20);
20 }
21 for (int angle = 180; angle >= 0; angle -= 5) {
22 myServo.write(angle);
23 delay(20);
24 }
25}
Standard hobby micro servo, 0-180 degree position control.
Stall current can spike well beyond what a microcontroller's onboard 5V pin is designed to supply, especially when driving more than one servo at once - power servos from a separate 5-6V supply that shares a common ground with your microcontroller, rather than pulling current through the board's own regulator. Individual units (and clones in particular) can vary slightly in exactly how pulse width maps to angle, so for precise endpoint tuning use the library's writeMicroseconds() function and calibrate against the actual servo in hand rather than assuming 1000-2000µs maps perfectly to 0-180° on every unit. Avoid forcing the horn past its mechanical limit by hand or in software - the plastic gear train is the first thing to strip under excess load.