ESP32 SG90 Mini Servo

SG90 Mini Servo image

SG90

Protocol: PWM

Overview

The SG90 is a compact micro servo motor ideal for robotics and DIY projects. Operating on 4.8V to 6V, it delivers 1.8 kg·cm torque, with a 0° to 180° range controlled via PWM signals. Weighing 9g, its nylon gears and dimensions (22.8mm x 12.2mm x 28.5mm) make it perfect for lightweight, precise applications.

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

  • Torque1.8 kg·cm at 4.8V, suitable for light-duty tasks.
  • Operating Voltage4.8V to 6V, making it compatible with ESP32 and other microcontrollers.
  • Angular Range0° 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? Check out our ESP32 Servo Motor Guide!

Where to Buy

SG90 Mini Servo

Starting from

1.5$ per unit

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specifications

Operating Voltage 4.8V to 6V
Torque 1.8 kg·cm at 4.8V
Operating Angle 0° to 180°
Pulse Width Control 1ms (0°) to 2ms (180°)
Dimensions 22.8mm x 12.2mm x 28.5mm
Weight 9 grams
Gear Material Nylon
Control Signal PWM (50Hz)

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

  • The servo's GND wire (brown) is used to complete the electrical circuit and must be connected to the ground of the ESP32 and/or the external power source.
  • The servo's +5V wire (red) supplies power to the servo motor and must receive 5 volts from the ESP32 or an external power source.
  • The servo's DATA wire (orange) carries the PWM signal to control the servo's position and should be connected to a PWM-capable GPIO pin on the ESP32.

Wiring with ESP32

  • Connect the servo's signal wire (orange) to a PWM-capable GPIO pin on the ESP32 (e.g., GPIO 13).
  • Connect the power wire (red) to the 5V pin on the ESP32 or an external power source.
  • Connect the ground wire (brown) to the ESP32's GND pin and ensure it's shared with the external power source if used.

Troubleshooting Guide

Common Issues

❌ Servo Not Responding or Moving Erratically

🔄 Continuous Rotation Instead of Positional Movement

⚡ Servo Jittering or Twitching

🔥 Servo Overheating

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🔧

ESP-IDF Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

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.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.