If you strip away the plastic shell of a standard hobby servo, you will not find a single, simple motor. You will find a complete, miniaturized closed-loop control system. To answer the question of how does a servo work, you have to look at the feedback loop: a command signal tells the internal circuit where the output shaft should be, a physical sensor measures where it actually is, and an error amplifier drives a DC motor to eliminate the difference between the two.
Unlike open-loop steppers that blindly step and hope they haven't missed a pulse, a servo constantly corrects itself. This makes servos the undisputed choice for high-torque, dynamic-load applications in robotics, RC vehicles, and automated camera gimbals. But selecting the right one for your Arduino or ESP32 project requires more than just looking at the stall torque printed on the box.
Servo vs. Stepper vs. DC: Which Motor Fits Your Load Profile?
Before wiring up a microcontroller, you must match the motor type to the mechanical reality of your load. Makers frequently treat steppers and servos as interchangeable, which leads to stripped gears or missed steps. Steppers excel at holding a static position with high precision but lose torque rapidly as speed increases. Servos maintain their torque curve across their entire operating speed range because the closed-loop feedback dynamically adjusts current to meet the load.
| Motor Type | Torque Curve | Control Needs | Relative Cost | Best Load Profile |
|---|---|---|---|---|
| Hobby Servo (RC) | Flat, high torque up to rated speed; drops at mechanical limit. | 50Hz PWM (1-2ms pulse) or serial bus. | $3 - $25 | Robotic arms, pan/tilt gimbals, steering linkages. |
| NEMA Stepper | High holding torque at zero speed; drops off sharply at higher RPM. | Step/Dir pulses via dedicated driver (e.g., A4988, TMC2209). | $10 - $40 | 3D printers, CNC routers, precise linear actuators. |
| Industrial AC Servo | Constant torque across a wide speed range; high peak torque for acceleration. | Industrial bus (EtherCAT, CANopen) or analog +/- 10V. | $300 - $2000+ | Factory automation, high-speed pick-and-place, heavy CNC. |
| Brushed DC Motor | Maximum torque at stall; linear drop to zero torque at no-load speed. | H-Bridge for direction; PWM for speed. Open-loop. | $2 - $15 | Wheeled drivebases, conveyor belts, simple fans. |
The Verdict: Choose a servo when your load is dynamic, requires high torque at varying speeds, and operates within a limited angular range (typically 180° to 270°). Choose a stepper when you need continuous rotation with precise open-loop positioning and high holding torque. For a deeper dive into general motor physics, the Adafruit Motor Selection Guide provides excellent baseline comparisons.
Inside the Shell: Wiring, Terminals, and Control Signals
Understanding how a servo works electrically starts with its terminal identification. Standard analog hobby servos use a 3-wire interface, while modern 'smart' servos use digital serial buses. Feeding the wrong signal into a smart servo, or drawing too much current from a microcontroller's 5V rail into a standard servo, are the two most common ways makers brick their boards.
| Servo Class | Wire/Pin Count | Pinout / Colors | Signal Protocol | Power Requirements |
|---|---|---|---|---|
| Standard Analog (e.g., SG90, MG996R) | 3 wires | Brown/Black (GND), Red (VCC 4.8-6V), Orange/White (Signal) | 50Hz PWM, 500µs to 2500µs pulse width. | 4.8V - 6.0V DC. Draws 500mA - 2.5A at stall. |
| Smart/Serial (e.g., Dynamixel XL430, LewanSoul) | 3 or 4 wires | GND, VCC (7-12V), Data (TTL or RS485) | Half-duplex UART (1Mbps typical). Packet-based. | 7V - 12V DC. Integrated voltage/current/temperature telemetry. |
| Continuous Rotation (Modified) | 3 wires | Same as Standard Analog | 50Hz PWM. 1500µs = stop, <1500µs = reverse, >1500µs = forward. | 4.8V - 6.0V DC. No internal positional feedback. |
Sizing a Servo for Your Project: Rules of Thumb and Load Math
Servo manufacturers rate their products in 'stall torque' (usually in kg-cm or oz-in). This is the maximum torque the motor can produce before it physically stalls and the internal current spikes. If you size your servo based purely on the static weight of your load, the first time the arm accelerates, the dynamic inertia will exceed the stall torque, the servo will jitter, and the nylon or brass gears will strip.
The Sizing Rule of Thumb: Calculate the peak static torque required by your load, then apply a 2.5x dynamic safety factor to account for acceleration, inertia, and mechanical friction. Select a servo whose rated stall torque exceeds this calculated value.
Worked Load Example: Robotic Arm Joint
Imagine you are building a robotic arm. The forearm section (including the gripper and payload) weighs 300 grams (0.3 kg). The distance from the elbow joint (the servo shaft) to the center of mass of the forearm is 12 cm (0.12 m).
- Calculate Static Torque: Torque = Force × Distance. Force = mass × gravity (0.3 kg × 9.81 m/s² = 2.94 Newtons).
Static Torque = 2.94 N × 0.12 m = 0.352 Nm. - Convert to kg-cm (Standard Hobby Rating): 0.352 Nm ≈ 3.59 kg-cm.
- Apply the 2.5x Safety Factor: 3.59 kg-cm × 2.5 = 8.97 kg-cm.
- Select the Servo: A standard SG90 (1.8 kg-cm) will instantly fail. An MG996R (13 kg-cm) will work comfortably. For a high-reliability build, a DS3218 (20 kg-cm) or a Dynamixel XL430-W250 (4.1 Nm / ~41 kg-cm) provides excellent overhead.
Driver Demands and Failure Signatures: Hum, Stall, and Overheat
Knowing how a servo works mechanically is only half the battle; driving it correctly via your embedded controller is where most debugging happens. Standard analog servos expect a 50Hz PWM signal. The width of the HIGH pulse dictates the target angle: typically 1000µs for 0°, 1500µs for 90°, and 2000µs for 180°. Modern ESP32 chips (like the ESP32-S3 or C3) handle this beautifully via the MCPWM or LEDC peripherals, as detailed in the Espressif MCPWM API documentation. Arduino users typically rely on the standard Servo.h library.
When things go wrong, the servo will tell you through distinct failure signatures. Recognizing these saves hours of bench troubleshooting.
1. The 'Servo Hum' or Jitter
Symptom: The servo holds position but vibrates audibly, emitting a high-pitched hum or buzzing, and the shaft jitters slightly.
Causes & Fixes:
- Noisy Power Supply: The internal error amplifier is highly sensitive to voltage ripple. If you are sharing a 5V buck converter with high-draw components (like LEDs or relays), voltage dips cause the servo to think it has moved. Fix: Add a 470µF electrolytic capacitor directly across the servo's VCC and GND wires at the connector.
- PWM Signal Jitter: Software-driven PWM (bit-banging) on an Arduino can jitter if interrupts fire during the pulse generation. Fix: Use hardware-timed PWM. On ESP32, use the LEDC hardware peripheral. On Arduino, ensure you are using the hardware timer-backed Servo library, not a software delay loop.
- Potentiometer Wear: In cheap analog servos, the carbon track inside the feedback potentiometer wears out, creating dead spots. The error amplifier sees a sudden jump in resistance and overcorrects. Fix: Replace the servo, or upgrade to a digital servo with a magnetic encoder.
2. Overheat and Thermal Shutdown
Symptom: The servo casing becomes too hot to touch, it stops responding, or it emits a faint burning smell.
Causes & Fixes:
- Continuous Stalling: If your mechanical linkage prevents the servo from reaching its target angle, the internal H-bridge will pump maximum current into the DC motor continuously, trying to close the error gap. Coreless DC motors inside hobby servos will burn out their windings in under 30 seconds of a hard stall. Fix: Implement a software timeout. If you command a position and read back no movement (on smart servos) or detect a current spike on your power rail, cut the PWM signal to 0µs to disable the drive.
- Excessive Duty Cycle: Analog servos are not rated for 100% duty cycle operation. Fix: Ensure your mechanical design allows the servo to reach its target and rest, rather than constantly fighting a spring or gravity.
3. Mechanical Stall and Gear Stripping
Symptom: A loud 'clunk' or grinding noise, followed by the servo motor spinning freely but the output shaft no longer moving.
Causes & Fixes:
- Shock Loading: Dropping a robotic arm or hitting an obstacle generates inertial forces that far exceed the 2.5x safety factor, shearing the teeth off the final output gear. Fix: Add mechanical hard stops (physical pins or brackets) that absorb the shock load before it reaches the servo's internal gear train. Alternatively, use a servo with a built-in mechanical clutch.
- Over-tightening the Horn: The central screw that holds the plastic or aluminum horn to the output shaft also pre-loads the internal thrust bearings. Over-tightening it binds the gear train, causing the motor to stall internally. Fix: Tighten the horn screw only until snug, then apply a drop of blue Loctite 242 to prevent vibration loosening.
Understanding the closed-loop nature of the servo—from the PWM command to the physical potentiometer feedback—transforms it from a mysterious black box into a predictable, highly capable actuator. By respecting the dynamic safety factors in your sizing math, isolating your power rails, and listening to the physical failure signatures on your workbench, you will build embedded motion systems that survive long past the prototype phase.






