A servo motor is a type of motor designed for precise control of angular position, making it ideal for applications like robotics, RC vehicles, automation, and control systems. It’s compact, easy to control using microcontrollers (like ESP32, Arduino, etc.), and widely used in DIY electronics.
A servo motor is an actuator that rotates to a specific angle based on a control signal.
| Feature | Description |
|---|---|
| Type | Closed-loop control system |
| Rotation | Usually 0° to 180° (some 360° continuous) |
| Precision | High positional accuracy |
| Control Signal | PWM (Pulse Width Modulation) |
Inside a typical servo motor:
๐ DC Motor – Provides the rotation.
โ๏ธ Gearbox – Reduces speed, increases torque.
๐ฏ Potentiometer – Measures current position.
๐ข Control Circuit – Compares target angle vs actual angle, adjusts motor.
This closed-loop system allows the servo to "know" where it is and adjust itself to reach the desired position.
| Type | Description |
|---|---|
| Standard Servo | Rotates 0–180° (common in robotics) |
| Continuous Servo | Rotates 360° (acts like a DC motor with direction control) |
| High Torque Servo | For heavier mechanical loads |
| Micro Servo | Small, low-power (e.g., SG90) |
Most servo motors have 3 wires:
| Wire Color | Function | Connects To |
|---|---|---|
| Red | VCC (5V) | 5V or 3.3V |
| Black/Brown | GND | GND |
| Yellow/Orange | Signal (PWM) | GPIO pin (e.g., D18) |
โ ๏ธ Power your servo from an external source if it draws high current (>500mA).
Servos are controlled using PWM (Pulse Width Modulation).
50 Hz frequency (20ms period)
Pulse width determines angle:
0.5ms – 1ms → 0°
1.5ms → 90°
2ms → 180°
The duration of the HIGH signal tells the servo what angle to move to.
Arduino: Servo.h
ESP32: ESP32Servo.h
Servo motors draw a lot of current, especially under load.
Don’t power them directly from ESP32/Arduino’s 3.3V or 5V pin.
Use a separate power supply (like 5V adapter or batteries) and connect GNDs together.
๐ค Robotics – Arm joints, grippers, walkers
โ๏ธ RC planes/cars/boats – Steering, throttle
๐ฎ Pan-Tilt camera systems
๐ง Automation systems – Smart locks, servo-based switches
๐น Joystick-controlled actuators