小编
Published2025-10-15
This article delves into the details of the SG90 servo motor pin diagram, its significance in various electronic projects, and how to wire and use it effectively. Learn how the SG90 servo motor works, its pin layout, and key features, making it an essential component for hobbyists and engineers alike.

SG90 servo motor, servo motor pin diagram, SG90 motor wiring, hobby electronics, robotics, servo motor usage, electronics for beginners, pin configuration, motor control.
Introduction to the SG90 Servo Motor
The SG90 servo motor is one of the most popular small-size servo motors used in various hobby and professional electronic projects. With its compact size, low cost, and high precision, the SG90 has become the go-to choice for anyone looking to add motion to their designs. Whether you're building a robot, an automated system, or even a simple mechanical arm, understanding the pin diagram and wiring of the SG90 servo motor is critical.
What is an SG90 Servo Motor?
Before we dive into the specifics of the SG90 servo motor pin diagram, it’s important to first understand what a servo motor is and how it works. A servo motor is an actuator that allows precise control of angular position, velocity, and acceleration. Unlike regular DC motors that spin continuously, a servo motor is designed to rotate to a specific position (within a limited range) based on the control signal it receives.
The SG90 is a miniature servo motor capable of rotating up to 180 degrees, making it ideal for small-scale robotics and projects where space is a constraint. It's widely used in applications such as robotic arms, automated systems, camera gimbals, and even toys.
Why is the Pin Diagram Important?
The SG90 servo motor, like any other electronic component, has specific pins that serve different functions. Understanding the pin diagram is essential for correctly wiring the motor to your control system, typically a microcontroller like an Arduino or Raspberry Pi. Incorrect wiring can lead to the servo malfunctioning, or even worse, getting damaged.
In the next section, we will explore the SG90 servo motor pin diagram in detail and break down the functions of each pin.
SG90 Servo Motor Pin Diagram Overview
The SG90 servo motor typically has three pins, which are:
This is the power input pin for the SG90 servo motor. It typically requires a supply voltage of 4.8V to 6V. Connecting this pin to a higher voltage than recommended can damage the motor, so be sure to use a regulated power supply that matches the motor’s requirements.
The GND pin is used to complete the circuit by connecting the servo motor to the ground (or negative) terminal of your power supply or microcontroller. This pin is crucial because it provides a common reference for the system’s power and control signals, allowing proper operation.
The signal pin is the most important for controlling the movement of the servo motor. It receives Pulse Width Modulation (PWM) signals from the microcontroller, which dictate the position of the servo motor’s shaft. The SG90 servo motor uses PWM signals to control its rotation. By varying the width of the pulse sent through the signal pin, the servo will rotate to the corresponding position within its 180-degree range.
How the SG90 Servo Motor Works
The SG90 operates based on the concept of PWM (Pulse Width Modulation). PWM involves sending a series of pulses at a regular interval, where the duration of each pulse (pulse width) determines the position of the servo. For instance:
A 1ms pulse will move the servo to 0 degrees (its extreme left position).
A 1.5ms pulse will move the servo to 90 degrees (its middle position).
A 2ms pulse will move the servo to 180 degrees (its extreme right position).
The frequency of the pulses is generally fixed, usually around 50 Hz, and only the width of the pulse is adjusted to control the angle of the servo motor. This means that the SG90 can be precisely controlled using a microcontroller or any device that can generate PWM signals.
Wiring and Usage of the SG90 Servo Motor
Now that we've explored the basic pin diagram and how the SG90 works, it's time to move on to the practical aspects of using the SG90 servo motor. In this section, we’ll look at how to wire the servo motor to a microcontroller, how to control it with code, and common troubleshooting tips.
Wiring the SG90 Servo Motor to an Arduino
One of the most common ways to control an SG90 servo motor is by using an Arduino. Here's a simple step-by-step guide to wiring the SG90 to an Arduino:
Connect the VCC Pin to the 5V Pin on the Arduino
The 5V pin on your Arduino will provide the power required for the SG90 servo. Make sure to check that your servo motor is rated to work with 5V to prevent damage.
Connect the GND Pin to the GND Pin on the Arduino
The ground pin on the SG90 needs to be connected to the ground pin on the Arduino. This completes the circuit and ensures proper operation.
Connect the Signal Pin to a PWM-enabled Pin on the Arduino
You will need to connect the signal pin of the servo to one of the PWM-enabled pins on the Arduino. These pins are typically marked with a '~' symbol next to the pin number (e.g., pin 9, 10, etc.).
Writing the Code to Control the SG90 Servo Motor
To control the SG90 servo motor with an Arduino, you will use the Servo library, which simplifies the process of sending PWM signals. Below is a simple example of code that rotates the servo motor back and forth between 0 and 180 degrees.
#include // Include the Servo library
Servo myServo; // Create a servo object
myServo.attach(9); // Attach the servo to pin 9 on the Arduino
myServo.write(0); // Move servo to 0 degrees
delay(1000); // Wait for 1 second
myServo.write(180); // Move servo to 180 degrees
delay(1000); // Wait for 1 second
In this code, the servo motor will move to 0 degrees, wait for 1 second, then move to 180 degrees and wait again. The myServo.write() function sends the necessary PWM signal to the servo, and the delay() function pauses the execution for a specified amount of time.
Common Issues and Troubleshooting
While the SG90 servo motor is fairly simple to use, there are a few common issues that beginners might face:
Double-check your wiring to ensure the VCC, GND, and signal pins are connected correctly.
Make sure the power supply is providing the correct voltage (usually 5V for the SG90).
Ensure that your code is correctly sending PWM signals to the signal pin.
Servo Jittering or Not Reaching Desired Angles:
This may be caused by insufficient power supply. The SG90 requires a stable power source; using the 5V pin from the Arduino may not be enough if the servo draws too much current.
Consider using an external power supply for the servo, especially when controlling multiple servos.
If the servo motor becomes excessively hot, it could be a sign of overloading or using a higher voltage than the motor can handle. Ensure you're within the motor’s specified voltage range (typically 4.8V to 6V).
The SG90 servo motor is a versatile and reliable component for a wide range of electronic and robotic applications. Understanding the SG90 servo motor pin diagram and how to wire and control the motor is the first step in unlocking its full potential. Whether you’re building a robot, an automated system, or a simple mechanical project, the SG90 can provide precise control with its simple PWM input. By following the wiring instructions and using appropriate coding techniques, you can make your projects come to life with ease.
Established in 2005, Kpower has been dedicated to a professional compact motion unit manufacturer, headquartered in Dongguan, Guangdong Province, China.
Update:2025-10-15
Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.