SG90 Mini Servo

View on Amazon
Overview
About SG90 Mini Servo
The SG90 is a popular micro servo motor widely used in robotics, RC models, and DIY electronics. It offers precise angular control via PWM signals, making it ideal for small-scale projects that require lightweight and reliable actuation.
⚡ Key Features
- Torque – 1.8 kg·cm at 4.8V, suitable for light-duty tasks.
- Operating Voltage – 4.8V to 6V, making it compatible with ESP32 and other microcontrollers.
- Angular Range – 0° to 180°, controlled via PWM signals.
- Compact & Lightweight – Weighs 9g with dimensions 22.8mm × 12.2mm × 28.5mm.
- Nylon Gears – Ensures smooth operation and durability for lightweight applications.
Looking for an ESP32-compatible servo motor project?
Get Your SG90
💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
SG90 Specifications
Complete technical specification details for SG90 Mini Servo
📊 Technical Parameters
SG90 Pinout
The SG90 is a 3-wire servo motor with GND (brown), +5V (red), and DATA (orange) wires.
Visual Pinout Diagram

Pin Types
Quick Tips
Object],[object Object]
Object],[object Object]
gears (less durable than metal gears),[object Object]
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 GND | Power | Ground connection. Connect to ESP32 GND or external power supply ground. | Completes the electrical circuit. |
2 +5V | Power | Power supply input (4.8V-6V). Can be powered from ESP32 5V pin for light loads. | Use external power supply for multiple servos. |
3 DATA | PWM | PWM control signal. Pulse width: 1ms (0°), 1.5ms (90°), 2ms (180°). | Connect to a PWM-capable GPIO pin (e.g., GPIO 18). |
Wiring SG90 to ESP32
To control the SG90 servo with an ESP32, connect the brown wire to GND, red wire to 5V power, and orange wire to a PWM GPIO pin.
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| SG90 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 GND (brown) Required | GND | Ground connection for both power and signal reference. | |
2 +5V (red) Required | 5V or External Supply | Power supply (4.8V-6V). Use external supply for multiple servos. | |
3 DATA (orange) Required | GPIO 18 | PWM control signal (50Hz, 1-2ms pulse width). |
Object]
Object]
Object]
Object]
100µF capacitor across power supply to reduce noise
Object]
Object]
ESP32Servo library or ledc functions for control
SG90 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The SG90 servo does not move as expected or exhibits erratic behavior.
Possible causes include insufficient power supply, incorrect wiring, or improper PWM signal configuration.
Solution: Ensure the servo is powered by an adequate external power source, as the Arduino's 5V pin may not supply sufficient current. Verify that the control signal is connected to the correct PWM-capable pin on the microcontroller. Confirm that the PWM signal parameters match the servo's specifications, typically a 50Hz frequency with pulse widths between 1ms and 2ms corresponding to 0° to 180° positions.
Issue: The SG90 servo rotates continuously instead of moving to a specified position.
Possible causes include the use of a continuous rotation servo variant or incorrect pulse width parameters.
Solution: Determine whether the servo is a standard positional servo or a continuous rotation model. For standard servos, ensure that the control pulses correspond to the correct positional commands. If using the Servo.attach() function in Arduino, specify appropriate minimum and maximum pulse widths to match the servo's requirements.
Issue: The SG90 servo jitters or twitches when holding a position.
Possible causes include electrical noise, unstable power supply, or interference from other components.
Solution: Use a stable and adequately rated external power supply for the servo. Implement proper grounding and consider adding decoupling capacitors to filter out electrical noise. Ensure that the control signal is clean and free from interference, and avoid running servo wires parallel to high-power lines to minimize electromagnetic interference.
Issue: The SG90 servo becomes excessively hot during operation.
Possible causes include overloading the servo, continuous operation under high torque, or mechanical binding.
Solution: Check for any mechanical obstructions or excessive loads that may cause the servo to work harder than intended. Ensure that the servo is operating within its specified torque range and duty cycle. If the application requires continuous rotation under load, consider using a servo designed for such purposes or a geared motor with appropriate specifications.
Debugging Tips
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Additional Resources
SG90 Programming Examples
Ready-to-use code examples for different platforms and frameworks
Wrapping Up SG90
The ESP32 SG90 Mini Servo is a powerful servo sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.
Best Practices
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Safety First
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.
Ready to Start Building?
Now that you have all the information you need, it's time to integrate the SG90 into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the SG90? Check out these similar sensors that might fit your project needs.

MG90S Mini Servo
The MG90S is a robust micro servo motor designed for robotics and DIY projects. Operating on 4.8V to 6V, it provides up to 2.2 kg·cm torque,...

PCA9685 16-Channel 12-bit PWM/Servo Driver
The PCA9685 is a 16-channel, 12-bit PWM controller from NXP, widely used to control servos, LEDs, and other PWM devices. It communicates...

MG996R Servo
The MG996R is a high-torque servo motor ideal for robotics and demanding DIY projects. Operating on 4.8V to 7.2V, it delivers up to 11 kg·cm...





