Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Motors & Motion
  4. ›SG90 and MG90S Micro Servo

Component guide · Beginner · 4 min read

SG90 and MG90S Micro Servo

Pinout, Wiring and Code

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the SG90 servo isSG90 servo pinoutWiring the SG90 servoExample codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Short answer

The SG90 is a 9 g micro servo that turns to an angle between 0 and 180 degrees when it receives a 50 Hz pulse of about 0.5 to 2.4 ms. Brown is ground, red is 5 V and orange is signal. It gives about 1.8 kg-cm of torque; the MG90S has the same size and pinout with metal gears and a little more torque.

Key specs at a glance

Weight
SG90 9 g, MG90S 13.4 g
Torque
SG90 about 1.8 kg-cm, MG90S about 2.2 kg-cm at 4.8 V
Speed
About 0.1 s per 60 degrees
Voltage
4.8 to 6 V
Signal
50 Hz PWM, roughly 500 to 2400 µs pulse for 0 to 180 degrees
Gears
SG90 plastic, MG90S metal

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1TowerPro SG90 9g Micro Servo (180°)₹442
  • Option 2TowerPro MG90S Metal Gear Micro Servo₹189
01

What the SG90 servo is

A hobby servo contains a small DC motor, a gearbox, a potentiometer on the output shaft and a control board. The control board compares the pulse width it receives with the potentiometer position and turns the motor until they match, so the shaft holds an angle.

The SG90 is the cheapest and most common servo for learning, pan-tilt camera mounts and small robot arms. Choose the MG90S when the gears must survive knocks, and an MG996R when you need much more torque.

02

SG90 servo pinout

The pins on the SG90 servo and what each one does.

PinFunction
Brown wireGND
Red wire+5 V (4.8 to 6 V)
Orange wireSignal (PWM)
PinFunction
Brown wire
GND
Red wire
+5 V (4.8 to 6 V)
Orange wire
Signal (PWM)
03

Wiring the SG90 servo

One SG90 can run from an Uno's 5 V pin for testing. For two or more, or any ESP32 build, use a separate 5 V supply of at least 1 A per servo and join its ground to the board's ground.

SG90 servo pinArduino UnoESP32
Brown (GND)GNDGND
Red (+5 V)5V (one servo) or external 5 VExternal 5 V
Orange (signal)D9GPIO 18
Brown (GND)
Arduino Uno:
GND
ESP32:
GND
Red (+5 V)
Arduino Uno:
5V (one servo) or external 5 V
ESP32:
External 5 V
Orange (signal)
Arduino Uno:
D9
ESP32:
GPIO 18
04

Example code

Setting the min and max pulse lets the servo reach its full range; the library default of 544 to 2400 µs is close.

Sweep a servo (Arduino Servo library) · Arduino C++Verify & upload in Electrolark
#include <Servo.h>            // ESP32: use the ESP32Servo library instead

Servo s;

void setup() {
  s.attach(9, 500, 2400);         // pin, min and max pulse in µs
}

void loop() {
  for (int a = 0; a <= 180; a++) { s.write(a); delay(10); }
  for (int a = 180; a >= 0; a--) { s.write(a); delay(10); }
}
05

Setup and tuning

Range

cheap servos rarely give exactly 180 degrees. Start with 500 to 2400 µs and narrow it if the servo buzzes at the ends; that buzz means it is pushing against its end stop.

Jitter

usually a weak supply. Add a 470 to 1000 µF capacitor across 5 V and GND near the servos.

Centre first

before fitting the horn, write 90 degrees so the arm is mounted at the middle of its travel.

Many servos

use a PCA9685 board to drive up to 16 from two I2C pins.

Angle maths

the servo pulse calculator converts pulse width to angle.

06

What you need

Shop this list4 of 5 found in our store · ₹1,242

  • TowerPro SG90 9 g micro servo (180°): plastic gears, lightest optionTowerPro SG90 9g Micro Servo (180°)₹442
  • TowerPro MG90S metal gear micro servo: metal gears, same sizeTowerPro MG90S Metal Gear Micro Servo₹189
  • Uno R3 development board: the controller used in the wiring tableFind this part
  • 4-DOF robotic arm kit (for SG90 / MG90S): a first project for these servos4-DOF Robotic Arm Kit (for SG90 / MG90S)₹562
  • Dupont jumper wires: for the signal connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
07

Alternatives and when to choose them

  • ✓MG996R: 11 kg-cm class, for arms and steering.
  • ✓Continuous rotation servos: spin like a gear motor instead of holding an angle.
  • ✓Serial bus servos: position feedback and daisy-chain wiring for advanced robots.
08

Try it: Servo pulse angle calculator

Change the values and the diagram and results update as you type.

09

Common mistakes to avoid

  • !Powering several servos from the Arduino 5 V pin, which resets the board.
  • !Forcing the shaft by hand, which strips the plastic gears.
  • !No common ground between the servo supply and the controller.
  • !Using the Uno Servo library on an ESP32 instead of ESP32Servo.
10

Frequently asked questions

What is the difference between SG90 and MG90S?

Same size and wiring. The MG90S has metal gears and slightly more torque, so it survives knocks better.

Can SG90 rotate 360 degrees?

The standard SG90 turns about 180 degrees. Continuous rotation versions exist, but they cannot hold an angle.

Why does my servo jitter?

Usually a weak or noisy supply. Use a separate 5 V supply and add a large capacitor; also check the ground connection.

Can I power an SG90 from 3.3 V?

It may move but with little torque. Power it from 5 V; the 3.3 V signal from an ESP32 is still fine.

How many servos can an Arduino control?

The Servo library supports up to 12 on an Uno, but power is the real limit. Use a PCA9685 for many servos.

How much weight can it lift?

About 1.8 kg at 1 cm from the shaft, so only about 180 g at 10 cm. Keep arms short.

Parts for this guide

  • TowerPro SG90 9g Micro Servo (180°)
    ₹442View
  • TowerPro MG90S Metal Gear Micro Servo
    ₹189View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • 4-DOF Robotic Arm Kit (for SG90 / MG90S)
    ₹562View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Servo Motors

Calculators

Servo pulse angle calculatorRobot arm torque calculator

Projects that use it

Put this into practice: 52 step-by-step builds in our project library use parts from this guide.

Beginner · 1–2 hoursAutomatic dustbin lidView projectIntermediate · 3–4 hoursObstacle-avoiding robotView projectIntermediate · 2–3 hoursRFID card door lockView project
Browse all 52 projects

Keep learning

Component guideBeginnerServo Motors GuideA 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.3 min read · Motors & MotionHow-toIntermediatePCA9685 16-Channel Servo DriverThe PCA9685 board makes 16 independent PWM signals and takes commands over I2C, so two pins on an Arduino, ESP32 or Pico can drive 16 servos without jitter.3 min read · Motors & MotionConcept explainerBeginnerPWM ExplainedPWM (pulse-width modulation) switches a pin fully on and off very quickly; the share of time it is on, the duty cycle, sets the average power.3 min read · Electronics FundamentalsComponent guideIntermediateRobotic Arms and GrippersA hobby robot arm is a chain of joints, each driven by a servo or motor.3 min read · Robotics

Sources

  • TowerPro SG90 and MG90S data sheets
  • Arduino Servo library reference

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the SG90 servo isSG90 servo pinoutWiring the SG90 servoExample codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide1 item · ₹442

TowerPro SG90 9g Micro Servo (180°)

Run itChange the inputs and watch the output
SG90 0°
500 µsPulse width

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question