Skip to content
ActuatorsServo

SG90 Micro Servo Motor

The classic 9g micro servo — small, cheap, and perfect for any hobby mechanism.

Wiring & code for

SG90 practical reference

The most common hobby servo in existence — 180° rotation, 9g weight, and near-universal library support across every microcontroller platform.

Key specifications

  • Operating voltage: 4.8V - 6V DC (5V typical)
  • Torque: ~1.8 kg·cm at 4.8V, ~2.2 kg·cm at 6V
  • Rotation: ~180° on most units (some batches are limited to 120° — test before mounting)
  • Speed: ~0.1 sec/60° at 4.8V, no-load
  • Control signal: PWM, 50Hz, ~1ms-2ms pulse width (1.5ms = center)
  • Weight: ~9g

Pinout and connection notes

Wire color order (GND-VCC-Signal vs Signal-VCC-GND) varies by manufacturer — check the connector keying, not just color, before powering on.

  • GND: Ground — usually the brown or black wire
  • VCC: Power, 4.8V-6V DC — usually the red wire
  • Signal: PWM control input — usually the orange or yellow wire

Integration checklist

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.

Troubleshooting and reproducibility

Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.

Board Integration

Library

Servo by Arduino

Bundled with the Arduino IDE core

Wiring

Component pinESP32 pinNote
VCC5V (VIN, if available on your ESP32 board)SG90 draws far less current than the MG996R and usually runs fine from the ESP32's 5V pin, but move to an external supply if you see brownouts
GNDGND
SignalGPIO18Any PWM-capable GPIO works

Swipe sideways to see every column →

C++

SG90 typically draws under 200mA at idle, spiking higher under load -- fine from the ESP32's 5V pin on most boards, but move to an external supply if the board resets when the servo moves.

View full ESP32 guide