A servo motor is a closed-loop rotary actuator that uses positional feedback—typically an internal potentiometer or magnetic encoder—to precisely control angular position, velocity, and acceleration. Unlike a standard DC motor that spins continuously when voltage is applied, a hobby servo requires a specific Pulse Width Modulation (PWM) signal to move to and hold an exact degree. If you push the output shaft off its target position, the internal error amplifier detects the mismatch and drives the motor back to the commanded angle.
For embedded makers using Arduino or ESP32 boards, servos are the default choice for robotic arms, pan-tilt camera mounts, and steering mechanisms. But selecting the wrong torque rating, wiring it incorrectly, or treating it like a stepper motor will result in stripped gears, brownouts, and jittery motion. Here is the bench-level guide to sizing, wiring, and debugging servos in embedded systems.
Stepper vs. Servo vs. DC: Which Motor Fits Your Load?
A common mistake in robotics forums is treating stepper motors and servos as interchangeable. They are not. Steppers excel at high-precision, low-speed open-loop positioning (like 3D printer axes), while servos excel at high-torque, dynamic closed-loop movement (like a robotic arm lifting a payload). If your load requires holding a heavy weight at the end of a long lever arm against gravity, a stepper will likely skip steps or overheat, whereas a servo will actively fight to maintain position.
| Motor Type | Torque Curve Profile | Control Needs | Typical Cost (Hobby) | Best Load Profile |
|---|---|---|---|---|
| Standard DC | High speed, low holding torque | H-Bridge (PWM for speed) | $2 - $8 | Drive wheels, conveyors, fans |
| Stepper (NEMA 17) | High holding torque, drops at speed | Step/Dir Driver (A4988/TMC2209) | $12 - $25 | CNC routers, 3D printers, linear slides |
| Hobby Servo (RC) | High stall torque, fixed 180° range | 50Hz PWM (1-2ms pulse) | $5 - $20 | Robotic arms, pan/tilt, RC steering |
| Smart Servo (UART) | High torque, programmable compliance | Half-duplex UART (1Mbps) | $45 - $250+ | Multi-joint humanoids, dynamic walking |
Wiring, Terminals, and Controller Demands
Standard hobby servos (like the ubiquitous TowerPro MG996R or DS3218) use a 3-pin JST or Dupont connector. Smart servos (like the Dynamixel XL430) use a 3-pin or 4-pin TTL/RS485 bus. For standard analog/digital RC servos, the pinout is universal:
- Brown or Black (GND): Connect to the common ground of your power supply and microcontroller.
- Red (VCC): Connect to the positive power rail. Most standard servos require 4.8V to 6.0V. High-voltage (HV) servos can handle 7.4V to 8.4V.
- Orange, Yellow, or White (Signal): Connect to a PWM-capable GPIO pin on your Arduino or ESP32.
Controller Demands: Standard servos expect a 50Hz PWM signal (a pulse every 20ms). The pulse width dictates the angle: typically 1.0ms for 0°, 1.5ms for 90°, and 2.0ms for 180°. On an Arduino, the Servo library handles this via hardware timers. On the ESP32, you must use the LEDC (LED Control) peripheral to generate the 50Hz PWM, as the ESP32 does not natively support the standard Arduino Servo library without wrapper modifications.
Sizing Rule of Thumb and Worked Load Example
Servo torque is rated in kg-cm (kilogram-centimeters) or oz-in. This rating represents the maximum weight the servo can hold at a specific distance from the output shaft center before it stalls. The sizing rule of thumb: Calculate the theoretical holding torque required at the furthest extension of your lever arm, then multiply by a safety factor of 2.0 to 2.5 to prevent gear stripping and account for dynamic acceleration forces.
Worked Load Example:
You are building a robotic arm segment. The payload (gripper + object) is 200g (0.2 kg). The distance from the servo output shaft to the center of mass of the payload is 15 cm.
- Calculate Force: Mass × Gravity = 0.2 kg × 9.81 m/s² = 1.96 N.
- Calculate Base Torque: Force × Distance = 1.96 N × 0.15 m = 0.294 Nm.
- Convert to kg-cm: 0.294 Nm / 0.0980665 = 3.0 kg-cm.
- Apply Safety Factor: 3.0 kg-cm × 2.5 = 7.5 kg-cm minimum required.
Selection: A micro SG90 (1.8 kg-cm, ~$3) will immediately strip its plastic gears. A standard MG996R (13 kg-cm, ~$8) is sufficient and leaves headroom. If the arm moves rapidly, bump up to a DS3218 (20 kg-cm, ~$18) to handle the inertial spike. Always check the stall current of your chosen servo; the MG996R pulls up to 2.5A at stall, meaning your 5V power supply must be rated for at least 3A per servo to prevent voltage sag.
Failure Signatures: Hum, Overheat, and Stall
When a servo misbehaves, it rarely fails silently. Recognizing the failure signature saves hours of debugging code when the issue is actually electrical or mechanical.
- Humming or Jittering at Rest: This is usually caused by mechanical binding in the linkage, a dirty internal potentiometer, or an unstable PWM signal. On the ESP32, if you are running heavy WiFi/Bluetooth tasks on the same core as your PWM timer, the RTOS task switching can cause microsecond delays in the PWM pulse, resulting in visible servo jitter. Pin your servo control task to Core 1 and disable WiFi power-saving modes to stabilize the signal.
- Overheating (Hot to the touch): Servos draw maximum current when they are stalled or fighting a static load near their torque limit. If a servo is holding a heavy arm statically, it will overheat and potentially melt the internal plastic casing or burn out the DC motor windings. If your application requires holding a heavy static load for minutes at a time, use a mechanical brake, a worm-gear drive, or switch to a stepper motor.
- Stall and Stripped Gears: If the servo hums loudly but the output shaft doesn't move, it has exceeded its stall torque. In hobby servos, the final drive gear is often the weak point. Upgrading to "full metal gear" servos prevents stripping, but transfers the shock load directly to the motor shaft and internal mounts, which can crack under severe impacts.
Frequently Asked Questions
What's a servo motor's difference from a continuous rotation motor?
A continuous rotation "servo" is mechanically identical to a standard servo, but the internal potentiometer has been disconnected and the physical hard stops removed. Instead of interpreting the 1.5ms PWM pulse as "center/hold", it interprets it as "stop". Pulses shorter than 1.5ms spin it one direction, and longer pulses spin it the other. It loses all absolute positional awareness and functions essentially as a standard DC motor with an integrated H-bridge and gearbox.
What's a servo motor's PWM frequency and pulse width requirement?
Standard analog and digital RC servos require a 50Hz frequency (one pulse every 20 milliseconds). The pulse width typically ranges from 500 microseconds (0.5ms) for 0 degrees, to 1500 microseconds (1.5ms) for 90 degrees, up to 2500 microseconds (2.5ms) for 180 degrees. Note that some manufacturers calibrate their 0-180° range to 1.0ms–2.0ms; always test the physical limits in code before assembling your mechanism to avoid driving the servo into its internal hard stops.
What's a servo motor's lifespan when used in heavy-load robotics?
Under continuous heavy load (operating at >70% of rated torque), a standard brushed hobby servo (like the MG996R) will typically last 100 to 300 hours before the carbon brushes wear out or the potentiometer track degrades, causing position drift. For high-cycle industrial or advanced robotics applications, you must upgrade to brushless smart servos (like the Dynamixel or Herkulex lines), which use magnetic encoders and brushless DC motors, pushing lifespans into the thousands of hours, albeit at 5x to 10x the cost.
What's a servo motor's smart alternative for multi-drop bus wiring?
If you are wiring more than four servos to a single microcontroller, standard PWM becomes a wiring nightmare and suffers from signal degradation. The alternative is a UART-based "smart servo" (e.g., Dynamixel, LewanSoul LX-16A, or Feetech SCS series). These servos feature built-in PID controllers, temperature/voltage sensors, and compliance margins. They communicate over a single half-duplex serial bus (TTL UART), allowing you to daisy-chain dozens of servos on just one hardware serial TX/RX pair, drastically reducing cable bulk and offloading PID calculations from your ESP32 or Raspberry Pi.






