Skip to content
We are closed on 2nd Oct. Any orders placed or confirmed after 4:00 PM on 1st Oct will be shipped on 3rd Oct. We apologize for the inconvenience and appreciate your patience!

SG90 Servo Motor: Pinout, Torque, Wiring & Code | Robocraze

SG90 Servo Motor: Pinout, Torque, Wiring & Code | Robocraze
D
Written By Daniel D'Souza
📅 Updated on 22 Sep 2026
✨ Summarize with AI
✅ Prompt copied

Summary

Attention all aspiring robotics enthusiasts! Feast your eyes on this comprehensive blog post that delves into the enigmatic depths of the SG90 Servo Motor! Behold as we unveil the arcane secrets of its working mechanism and its manifold applications! The SG90, a micro servo motor of prodigious renown, has been deployed in a plethora of applications such as RC toys and robotics, to name but a few. Fear not, for we have included an intricate disquisition on the intricate workings of servo motors, a treat for those who wish to embrace the captivating universe of automation!

What is SG90 in Servo Motor?

A Servo motor is a type of motor that is powered by a DC source, either from an external supply or by a controller. A small and lightweight servo motor with high output power is called a micro servo motor sg90. This means that the sg90 micro servo motor will only work as hard as is required to complete the task at hand. A wide range of applications for SG90 servo motors exists, including cameras, telescopes, antennas, industrial automation, and robots. 

 

What is SG90 in Servo Motor

 

A motor rotates from 0 to 180 degrees at each position of 90 degrees so that names it SG90. Servo motors have a gear that reduces the rotational speed of the motor by reducing its RPM and increasing the torque.

read our blog explaining the speed control of dc motor, It covers the basics of DC motors, their working mechanism, and the importance of speed control.

Components and Supplies

SG90 Micro Servo Motor-RobocrazeSG90 Micro Servo Motor-Robocraze

    TowerPro SG90 9G Micro Servo Motor 180° for Arduino & Robotics

    SG90 9G Micro Servo Motor The TowerPro SG90 9G Micro Servo Motor is a compact and lightweight servo motor designed for Arduino projects, robotics, RC models, automation, CNC applications, and DIY electronics. With approximately 180° of rotational movement, it provides precise positioning and controlled...
    Rs 99/-
    Rs 99/-
    Rs 149/-
    Save Rs 50/-
    Original Arduino Uno R3 microcontroller board with ATmega328P and USB port - Arduino Uno Board -RobocrazeOriginal Arduino Uno R3 microcontroller board with ATmega328P and USB port - Arduino Uno Board -Robocraze

      Arduino Uno R3 Original

      Arduino UNO R3 Original The Arduino Uno R3 is a microcontroller board based on the ATmega328P chip and is widely recognized as the best original Arduino Uno board for beginners and projects. This board has 14 digital I/O pins (6 support PWM), 6 analog...
      Rs 2,750/-
      Rs 2,750/-
      Rs 3,499/-
      Save Rs 749/-

      SG90 vs MG90S vs MG996R

      Choosing between these three servos mainly depends on the required torque, size, gear construction, and load.

      Feature SG90 MG90S MG996R
      Servo type Micro Mini metal-gear High-torque metal-gear
      Typical gear Plastic/nylon Metal Metal
      Torque 1.2 kg-cm @ 4.8 V; 1.6 kg-cm @ 6 V 1.8 kg-cm @ 4.8 V; 2.2 kg-cm @ 6 V 9.4 kg-cm @ 4.8 V; 11 kg-cm @ 6 V
      Operating voltage 3.0–7.2 V 4.8–6.0 V 4.8–7.2 V
      Speed 0.10 s/60° @ 4.8 V 0.10 s/60° @ 4.8 V; 0.08 s/60° @ 6 V 0.17 s/60° @ 4.8 V; 0.14 s/60° @ 6 V
      Weight 9 g 13.4 g 55 g
      Typical use Small mechanisms, education Compact robotics, RC, small mechanisms Robotic arms, manipulators, higher-load mechanisms

      The MG90S provides higher torque than the SG90 while retaining a compact form factor and metal gears. Robocraze specifies 1.8 kg-cm at 4.8 V and 2.2 kg-cm at 6 V.

      The MG996R is substantially larger and provides much higher torque, with Robocraze specifying 9.4 kg-cm at 4.8 V and 11 kg-cm at 6 V.

      Quick selection: Use the SG90 for lightweight mechanisms, the MG90S when you need a compact metal-gear servo, and the MG996R when the mechanism requires substantially more torque.

      For more options across different torque, size, gear, and voltage requirements, explore Robocraze's Servo Motors & Controllers collection

       

      SG90 Servo Torque: Worked Example

      Torque tells you how much rotational force a servo can produce at a particular lever-arm distance.

      A simple static calculation is:

      Torque = Force × Distance

      When working with kg-cm servo ratings:

      Required torque (kg-cm) = Load (kg) × Distance (cm)

      Example

      Suppose an SG90 needs to lift a 200 g load positioned 5 cm from the servo shaft.

      Convert the load:

      200 g = 0.2 kg

      Therefore:

      Torque = 0.2 kg × 5 cm

      Torque = 1.0 kg-cm

      What is Micro Servo 9g SG90?

      A typical SG90 servo motor has only 9g that operation made simple and gives precise rotation with the help of Pulse Width Modulation (PWM). 

      Pulse Width Modulation

      Pulse width modulation is a tried-and-true method for controlling semiconductor devices in power electronics. A typical control method that produces analog signals from digital devices like microcontrollers is called pulse width modulation or PWM. The resulting signal will consist of a series of square wave-like pulses. This means that the wave will either be high or low at any given time.

       

      Pulse Width Modulation

      Servo Motor SG90

       

      A micro servo motor is wound with stator and rotor windings on its stationary and rotating portions, respectively. In addition to using less electricity, this motor is very efficient, and it is quite easy to maintain. Servo motors are driven by driver amplifiers, which receive velocity commands from controllers. Feedback devices such as resolvers and encoders provide information on the speed and position of servo motors. It is possible to build the resolver or encoder within the motor, or it may be placed somewhere else. Closed-loop systems allow servo motors to run in accordance with a particular motion profile programmed into the controller.

      SG90 Servo motor consists of 3 pins, Vcc, GND and PWM. In the robotics field, servo motors are widely used because they provide the precise position required for specific tasks. SG90 consist of four parts, these are Electonic assembly, Protective case, drive gears, and output spline.

      Also, read our blog on the Working Principle of AC Motor explaining how AC motor works with diagram and different types of AC motors and how they work.

      Electronic Assembly

      PWM is the electronic board that can control the part of the speed in the servo. We can control the shaft with the program at angles ranging from 0 to 180 degrees. Additionally, we can alter the speed at which the shaft rotates.

      Protective Case

      A plastic casing around the servo that provides protection from dust or other debris, containing electronic assembly and gear within a setup box-like enclosure.

      Drive Gears

      The force flow is always coaxially transmitted via planetary servo gear units. A sun gear that rotates in the rotational direction and at the speed of the micro servo motor is in the middle. Rotating around this sun gear are three or more planet gears that transfer the applied force to the outer annulus gear on the output side. The input shaft and output shaft move in the same direction because of this design. In other words, they rotate in the same direction.

       

      Drive Gears


      Output Spline

      An output shaft connects to the motor's gears so that external parts can be connected.


      How Servo Motor Work? 

      As mentioned before, servo motors work with PWM converters and require a controller to control the pulse, which can be controlled by microcontrollers such as the Arduino, ARM, or other programmable controllers.

       

      How Servo Motor Work

       

      To use the library first, download and install the Servo library into the Arduino IDE. After installation, include the library to sketch the code, also follow this way to get code from the library by clicking Files> Examples> Servo>Knob or sweep, or paste the following code into your IDE.

       

      #include <Servo.h>

      Servo myservo;

       

      int pos = 0;    

       

      void setup() {

        myservo.attach(9);   

      }

       

      void loop() {

        for (pos = 0; pos <= 180; pos += 1) {  

          myservo.write(pos);              

          delay(15);                        

        }

        for (pos = 180; pos >= 0; pos -= 1) {  

          myservo.write(pos);               

          delay(15);                     

        }

      }



      Applications of SG90

      • Robotics
      • Telescope
      • Industrial production
      • Machinery Works
      • Production industries


      Conclusion

      In this blog, we have learned that the SG90 servo motor is truly a game-changing device that has transformed the world of robotics and automation. With its small form factor and exceptional torque, this little powerhouse is perfect for a plethora of applications, from tinkering in your garage to automating large-scale industrial processes. Whether you're a novice or a seasoned pro, the SG90 micro servo motor is a must-have tool in your arsenal that will unleash a universe of possibilities that will blow your mind. Don't delay, seize the opportunity to own an SG90 today and immerse yourself in a thrilling adventure that defies all limits!

       

      If you appreciate our work don't forget to share this post and leave your opinion in the comment box.

       

      Please do check out other blog posts about Popular electronics

       

      Make sure you check out our wide range of products and collections (we offer some exciting deals!)

      Excerpt

      Complete SG90 micro servo guide: pinout, 1.8 kg-cm torque rating, operating voltage, PWM control, Arduino wiring and code, and when to upgrade to MG996R.

      Frequently Asked Questions

      1. What is the pinout of BC547?


      The BC547 is a three-pin NPN transistor with Collector (C), Base (B), and Emitter (E) pins. For the common TO-92 BC547 package, the pin arrangement should be verified from the specific manufacturer datasheet before wiring, as package orientation can vary.

       

      2. What is the maximum current of BC547?


      The BC547 has a maximum continuous collector current of 100 mA. It is intended for low-power switching and amplification applications. For loads requiring more than 100 mA, use a transistor or MOSFET designed for the required current, with suitable thermal and electrical margins.

       

      3. What is the difference between BC547 and 2N2222?


      BC547 and 2N2222 are both general-purpose NPN transistors, but their voltage, current, power, gain, and package specifications can differ by manufacturer and exact variant. For example, the Robocraze BC547 is rated at 100 mA continuous collector current, while its 2N2222A listing specifies different voltage and power ratings. Check the datasheet for the exact part.

       

      4. How do I calculate the base resistor for BC547?


      Calculate the base resistor using RB = (Vcontrol − VBE) / IB. For switching, a forced beta of about 10 is commonly used to estimate base current. For example, with a 5 V control signal and a 50 mA load, IB = 5 mA, giving RB = (5 − 0.7) / 0.005 ≈ 860 Ω. A standard 820 Ω or 1 kΩ resistor can then be considered, while checking the controller's current limit.

      5. What are the specifications (torque, speed, voltage) of SG90?

      The SG90 servo motor provides approximately 1.8 kg-cm of torque, a speed of 0.1 seconds per 60 degrees at 4.8V, and operates typically at a voltage range of 4.8 to 6.0 volts. These specifications make it suitable for various lightweight applications and projects.

      6. How do you wire an SG90 servo to an Arduino?

      To wire the SG90 servo to an Arduino, connect the brown wire to GND, the red wire to +5V, and the yellow or orange wire to a PWM pin (like pin 9). This simple setup allows for easy control of the servo motor using Arduino code.

      7. What code is needed to control SG90 servo motor?

      Common projects featuring the SG90 servo include remote-controlled vehicles, robotic arms, and automated doors. Additionally, it's often used in Arduino-based projects like simple robots, pan-and-tilt camera systems, and educational kits, demonstrating basic robotics concepts.

      8. What are common projects using SG90 servo motors?

      The standard SG90 servo motor offers precise angle control, providing a range of motion between 0 to 180 degrees. In contrast, a continuous-rotation SG90 can rotate indefinitely but lacks angle precision, focusing instead on speed and direction control. Choose based on project needs.

      9. What is the difference between continuous-rotation and standard SG90?

      The SG90 servo motor typically provides about 180 degrees of movement. This range allows it to perform various tasks in hobby robotics and automation, making it versatile for many applications.

      10. How many degrees of movement does an SG90 provide?

      SG90 servo motors have limitations, including lower torque compared to larger servos and susceptibility to overheating under heavy loads. Additionally, its limited 180-degree movement may not suit all applications requiring full rotation or complex maneuvers, making careful project planning essential.

      11. What are the limitations of SG90 servo motors in robotics?

      To power multiple SG90 servos safely, use a separate power supply with adequate current rating to avoid overload. Connect the ground of the power supply to the Arduino ground. Avoid powering many servos directly from the Arduino to prevent damage to its voltage regulator.

      12. How do I power multiple SG90 servos safely?

      To calibrate or center an SG90, first connect it to an Arduino and upload a simple position control code. Adjust the myServo.write() value until the servo's arm points directly at the desired center position (usually around 90 degrees). Fine-tuning can help achieve accurate movement.

      13. How do I calibrate or center an SG90 servo motor?

      Prev Post
      Next Post

      Leave a comment

      Please note, comments need to be approved before they are published.

      Thanks for subscribing!

      This email has been registered!

      Shop the look

      Choose Options

      Edit Option
      Back In Stock Notification
      Compare
      Product SKU Description Collection Availability Product Type Other Details

      Choose Options

      this is just a warning
      Login
      Shopping Cart
      0 items
      FREE SHIPPING!
      ₹100 OFF
      ₹200 OFF
      ₹999
      ₹2500
      ₹4900
      WhatsApp Chat Chat