Component guide · Beginner · 3 min read
Servo Motors Guide
SG90 vs MG90S vs MG996R, Wiring and Code
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
A hobby servo is a small motor with a gearbox, position sensor and control circuit that moves to an angle you set with a pulse signal. A 1.5 ms pulse every 20 ms centres it; about 1 ms and 2 ms move it toward each end. The SG90 suits light loads, the MG996R lifts roughly five times more. Power servos from a separate 5 to 6 V supply.
Key specs at a glance
- Signal
- 50 Hz PWM: 1 to 2 ms pulse (often 0.5 to 2.5 ms for full 180°)
- Wires
- Brown/black = GND, red = V+, orange/yellow/white = signal
- SG90
- 4.8 to 6 V, about 1.8 kg·cm, plastic gears, 9 g
- MG90S
- 4.8 to 6 V, about 2.2 kg·cm, metal gears, 13 g
- MG996R
- 4.8 to 7.2 V, about 9 to 11 kg·cm, metal gears, stall current up to about 2.5 A
- Rotation
- 180° positional, or 360° continuous-rotation versions
How a servo motor works
Inside a hobby servo, a DC motor turns a gear train connected to the output shaft and to a potentiometer. The control board compares the potentiometer's position with the pulse width it receives and drives the motor until they match. That closed loop is why a servo holds its angle under load, and also why it draws current constantly when pushing against something.
SG90 vs MG90S vs MG996R
| SG90 | MG90S | MG996R | |
|---|---|---|---|
| Torque | About 1.8 kg·cm | About 2.2 kg·cm | About 9.4 kg·cm at 4.8 V, 11 kg·cm at 6 V |
| Gears | Plastic | Metal | Metal |
| Weight | 9 g | 13 g | 55 g |
| Plan per servo | 0.5 to 0.7 A peak | 0.7 A peak | Up to 2.5 A stall |
| Best for | Pan-tilt, light flaps, learning | Robot arms, small legs | Robot arms, steering, heavy loads |
- Torque
- SG90:
- About 1.8 kg·cm
- MG90S:
- About 2.2 kg·cm
- MG996R:
- About 9.4 kg·cm at 4.8 V, 11 kg·cm at 6 V
- Gears
- SG90:
- Plastic
- MG90S:
- Metal
- MG996R:
- Metal
- Weight
- SG90:
- 9 g
- MG90S:
- 13 g
- MG996R:
- 55 g
- Plan per servo
- SG90:
- 0.5 to 0.7 A peak
- MG90S:
- 0.7 A peak
- MG996R:
- Up to 2.5 A stall
- Best for
- SG90:
- Pan-tilt, light flaps, learning
- MG90S:
- Robot arms, small legs
- MG996R:
- Robot arms, steering, heavy loads
Wiring a servo to Arduino or ESP32
Connect the signal wire to a PWM-capable pin, the brown wire to ground, and the red wire to a 5 to 6 V supply. One SG90 can run from an Arduino's 5 V pin for testing, but two or more, or any MG996R, need a separate supply, such as a 5 V 2 A adapter or a buck converter. Always connect the supply ground to the board ground.
The servo signal is fine at 3.3 V, so ESP32 and Pico boards drive servos directly. On the ESP32, install the ESP32Servo library instead of the standard Servo library.
#include <Servo.h> // ESP32: #include <ESP32Servo.h>
Servo s;
void setup() {
s.attach(9, 500, 2400); // pin, min and max pulse in microseconds
}
void loop() {
for (int a = 0; a <= 180; a += 2) { s.write(a); delay(15); }
for (int a = 180; a >= 0; a -= 2) { s.write(a); delay(15); }
}Running many servos: power budget and PCA9685
For robot arms, hexapods and animatronics, use a PCA9685 16-channel servo driver. It generates all pulses over I2C, so your microcontroller only needs two pins, and up to 62 boards can share a bus.
Budget power for the worst case: six MG996R servos can draw over 10 A at the same instant. Use a 5 to 6 V supply rated for the total, thick wires, and a 1000 µF capacitor across the servo power rail.
Positional vs continuous-rotation servos
A 360° continuous-rotation servo looks the same but has no position limit. The pulse width sets speed and direction instead of angle: 1.5 ms stops, shorter spins one way, longer spins the other. They are handy for small wheeled robots but cannot move to a set angle.
Try it: PWM duty cycle calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Powering several servos from the Arduino 5 V pin, causing resets and jitter.
- Forgetting to join the servo supply ground to the microcontroller ground.
- Forcing the horn by hand, which strips SG90 plastic gears.
- Commanding angles beyond the mechanical stop; the servo stalls, buzzes and overheats.
- Using the standard Servo library on an ESP32, where it does not compile; use ESP32Servo.
Frequently asked questions
How much torque does an SG90 servo have?
About 1.8 kg·cm at 4.8 V: it can hold 1.8 kg at 1 cm from the shaft, or 180 g at 10 cm.
Can I power a servo from an Arduino?
One small SG90 under light load is fine for testing. Anything more needs an external 5 to 6 V supply with a shared ground.
Why is my servo jittering?
Usually an inadequate power supply or a missing common ground. Noisy signal timing, such as software PWM on a busy board, also causes jitter; a PCA9685 fixes that.
Can a servo rotate 360 degrees?
Standard servos move about 180 degrees. Continuous-rotation servos turn endlessly but control speed rather than position. For precise multi-turn positioning, use a stepper motor.
What do the three servo wire colours mean?
Brown or black is ground, red is power (4.8 to 6 V), and orange, yellow or white is the control signal.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 52 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- SG90 micro servo datasheet (TowerPro)
- MG996R datasheet (TowerPro)
- PCA9685 16-channel 12-bit PWM controller datasheet (NXP Semiconductors)
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




