小编
Published2025-10-15
Introduction to SG90 Servo Motor and its Significance in Robotics
The SG90 servo motor has earned a reputation as one of the most popular and affordable servo motors in the world of hobby electronics and robotics. Whether you're a beginner just starting out with robotics or an experienced engineer working on more complex projects, understanding the basics of the SG90 servo and how to use it in your designs is essential.

A servo motor is a small, self-contained unit that includes a motor, gearbox, and control circuit, which allows it to rotate to a specific angle. Unlike regular DC motors that spin continuously, a servo motor can rotate only within a set range—typically between 0° and 180°—and maintain a fixed position when powered. This precision makes servos ideal for applications that require exact positioning, such as in robotic arms, aircraft control surfaces, and camera pan/tilt mechanisms.
The SG90 is a miniature servo motor that delivers high torque in a small package, making it perfect for lightweight projects and even some advanced applications that require compact actuators. Despite its small size, the SG90 has become a go-to choice for enthusiasts looking to add precision movement to their creations.
The SG90 Servo Motor Pinout Explained
Understanding the SG90 servo motor's pinout is crucial for anyone wanting to successfully integrate it into a project. The SG90 servo has three main pins:
Signal Pin (Control): This pin is responsible for receiving the control signal from a microcontroller (such as an Arduino or Raspberry Pi). It receives a Pulse Width Modulation (PWM) signal, which determines the angle the servo will rotate to. A varying pulse width controls the position of the servo, typically within the 1-2 millisecond range.
Power Pin (VCC): This pin provides the necessary power to the servo motor. It is usually connected to a 5V supply, though the exact voltage might vary slightly depending on the servo's specifications. Proper power distribution is important to avoid damaging the motor or your microcontroller.
Ground Pin (GND): This pin completes the circuit by connecting to the ground of your system. It's essential for providing a return path for the current, enabling the servo motor to function properly.
The layout of the pins is typically as follows (from left to right, when viewed with the shaft facing you):
Knowing this pinout is fundamental because it ensures that the servo is correctly connected to the controller and that it receives the necessary power and signal to operate.
How the SG90 Servo Motor Works
The SG90 operates based on the PWM signal received at the signal pin. Here's how it works:
PWM Signal: The pulse width of the signal determines the servo’s position. The servo motor is designed to respond to the timing of the pulse. A typical control signal would range between 1 millisecond (ms) for one extreme position (say 0°) and 2 milliseconds for the other extreme position (180°).
Rotation: The motor will rotate its shaft to the corresponding angle based on the pulse width. When the microcontroller sends a PWM signal, the servo motor moves to the specific angle set by the pulse width.
Feedback Loop: While the servo is moving, the internal feedback mechanism keeps track of its position. This is why servos are capable of holding their position without the need for constant power. Once the desired position is reached, the motor "holds" it in place.
Why Choose the SG90 for Your Projects?
The SG90 offers several key advantages that make it a popular choice for beginners and hobbyists:
Affordability: The SG90 servo is inexpensive and widely available, making it accessible for anyone getting started with robotics or automation.
Compact Size: At just 23 x 12 x 22 mm in size, the SG90 is small enough to be used in constrained spaces or lightweight applications.
Ease of Use: The SG90 servo motor can be controlled easily using popular microcontrollers like Arduino or Raspberry Pi, making it ideal for DIY projects and prototypes.
Good Performance: Despite its small size, the SG90 provides a decent amount of torque and a smooth range of motion for many basic robotic applications. It can rotate up to 180° and deliver a torque of about 1.8 kg-cm at 4.8V, which is sufficient for many light-duty tasks.
Now that we've gone over the basics of the SG90, including its pinout and how it operates, let’s dive deeper into wiring it up and integrating it into projects.
How to Wire and Use the SG90 Servo Motor in Your Projects
Connecting an SG90 servo motor to a microcontroller and controlling it with a program is one of the easiest ways to get started with robotics and electronics. Below, we’ll walk through the wiring process, followed by a sample code to control the servo motor.
Wiring the SG90 Servo Motor
Wiring up the SG90 is straightforward. Here are the basic steps to properly wire the servo motor:
Power Connection: Connect the VCC pin (Pin 2) of the SG90 to the 5V output of your microcontroller. If you are using an external power source for the servo, be sure to connect the power supply to the VCC pin accordingly.
Ground Connection: Connect the GND pin (Pin 3) of the SG90 to the ground (GND) of your microcontroller. This completes the circuit and ensures the servo receives the correct return path for the current.
Signal Pin: The Signal Pin (Pin 1) should be connected to a PWM-capable pin on your microcontroller. For example, if you are using an Arduino, you might connect it to pin 9 (but any PWM pin should work). This pin will send the control signal to the servo, determining its position.
Basic Control Using Arduino
Once you’ve wired the servo motor, the next step is to program your microcontroller to control it. Below is a simple example using an Arduino to rotate the SG90 servo back and forth:
Servo myServo; // Create servo object to control a servo
myServo.attach(9); // Connect the signal pin to pin 9
myServo.write(0); // Move the servo to 0 degrees
delay(1000); // Wait for 1 second
myServo.write(180); // Move the servo to 180 degrees
delay(1000); // Wait for 1 second
In this example, the Arduino controls the SG90 by sending PWM signals through pin 9. The servo motor rotates to 0° and 180° alternately every second. The Servo.write() function takes an angle in degrees, ranging from 0° to 180°, which corresponds to the servo's movement range.
Troubleshooting and Common Issues
While working with the SG90, a few common issues may arise. Here are some tips for troubleshooting:
Servo Not Responding: Ensure that the power supply is correctly connected. Double-check that the VCC is connected to a 5V source and that GND is connected to ground.
Unexpected Servo Behavior: If your servo is jittering or not moving smoothly, it might be receiving inconsistent PWM signals. Ensure your control code is sending a stable signal. Avoid sending very fast or frequent updates to the servo, as this could cause it to behave erratically.
Servo Movement Limitations: The SG90 can rotate only 180°. If the servo exceeds its range, it can get damaged. Always ensure that the requested position is within the servo's operational limits.
Power Supply Issues: If your servo is stalling or weak, it could be due to insufficient power. Ensure your power supply can handle the servo's current requirements, especially when using multiple servos or high-torque motors.
With its small size, simplicity, and versatility, the SG90 servo motor is an excellent choice for beginners looking to experiment with robotics and automation. By understanding its pinout and wiring, you can easily integrate it into your projects, whether it’s a simple robotic arm or a more complex robot platform.
Leveraging innovations in modular drive technology, Kpower integrates high-performance motors, precision reducers, and multi-protocol control systems to provide efficient and customized smart drive system solutions.
Update:2025-10-15
Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.