The Direct Answer: What's a Servo?

A servo is a packaged, closed-loop DC motor system that combines a brushed DC motor, a reduction gearbox, a feedback sensor (usually a potentiometer), and a control circuit into a single module. Unlike a standard DC motor that spins freely or a stepper motor that moves in open-loop discrete steps, a hobby servo actively monitors its output shaft angle and adjusts its internal motor drive to match a target position commanded by a microcontroller.

If you are asking what's a servo in the context of embedded projects, the practical answer is: it is your go-to actuator for precise, absolute angular positioning (typically 0° to 180°) without needing external encoders or complex homing routines. You send a 50Hz PWM pulse (1.0ms to 2.0ms width), and the internal H-bridge drives the motor until the internal potentiometer reads the matching voltage.

Motor Type Comparison: Servo vs. Stepper vs. DC

Choosing the right actuator prevents mechanical failure and controller resets. Never treat a stepper and a servo as interchangeable; a stepper will lose steps under unexpected dynamic loads without an external encoder, while a servo's closed-loop feedback will fight to maintain absolute position until it physically stalls or strips a gear.

Motor Type Torque Curve & Profile Control Needs Typical Cost (Hobby)
Hobby Servo High stall torque, drops at speed. Excellent for holding static loads at low speeds. 50Hz PWM (1-2ms pulse). Requires dedicated 5V/6V high-current supply. $5 - $25
Stepper (NEMA 17) High holding torque, drops sharply at high RPM. Best for CNC/3D printer linear motion. Step/Dir pulses via H-bridge driver (e.g., A4988, TMC2209). 12V-24V supply. $15 - $40
Brushed DC Gearmotor Low stall torque, linear speed/torque curve. Best for continuous rotation (wheels). Simple H-bridge for direction/speed. Needs external encoder for position tracking. $8 - $20

Sizing Rule of Thumb and Worked Load Example

The most common mistake makers make is sizing a servo based on static weight rather than dynamic torque. The rule of thumb is to calculate the required static torque (Force × Distance), then multiply by a 2.0 safety factor to account for dynamic acceleration, gearbox inefficiencies, and voltage sag under load.

Sizing Formula: Required Torque (kg·cm) = (Mass in kg × 9.81 m/s² × Lever Arm in meters) × 10.197 × 2.0 Safety Factor.

Worked Example: Robotic Arm Shoulder Joint

Suppose you are building a robotic arm. The shoulder joint must lift a 500g (0.5 kg) payload (including the weight of the forearm and gripper) at a maximum lever arm distance of 15 cm (0.15 m) from the motor shaft.

  • Force: 0.5 kg × 9.81 m/s² = 4.905 Newtons
  • Static Torque: 4.905 N × 0.15 m = 0.735 N·m
  • Convert to kg·cm: 0.735 N·m × 10.197 = 7.49 kg·cm
  • Apply 2.0 Safety Factor: 7.49 × 2.0 = 14.98 kg·cm

If you select a standard blue SG90 micro servo (rated at 1.8 kg·cm), it will immediately strip its plastic gears and fail. You need a metal-gear servo rated for at least 15 kg·cm, such as the DS3218 20kg-cm digital servo (typically $18-$22), to handle this load reliably at 6V.

Wiring, Terminals, and ESP32/Arduino Integration

Standard hobby servos use a universal 3-pin terminal layout. Miswiring will instantly destroy the internal control IC or your microcontroller.

Wire Color Terminal Function Connection Target Notes & Warnings
Brown or Black Ground (GND) Power Supply GND & MCU GND Must share a common ground with the ESP32/Arduino to complete the PWM reference circuit.
Red VCC (Power) 5.0V to 6.0V BEC / Buck Converter Never connect to the Arduino 5V pin. A stalled servo pulls 2.5A+, causing a brownout and resetting the MCU.
Orange, Yellow, or White Signal (PWM) MCU GPIO Pin (PWM capable) ESP32: Use an RTC-capable GPIO pin. Arduino: Use pins marked with '~'.

The Power Injection Rule

Microcontrollers cannot source servo current. You must use a dedicated Battery Eliminator Circuit (BEC) or a step-down buck converter (like the LM2596) to drop your main battery pack (e.g., 12V LiPo or 2S/3S) down to 6.0V for the servo VCC line. Connect the BEC's ground directly to both the servo ground and the ESP32 ground. For the Arduino Servo Library, standard `attach()` and `write()` functions handle the 50Hz timing, but on the ESP32, use the `ESP32Servo` library to leverage the hardware LEDC PWM channels for jitter-free operation.

Failure Signatures: Hum, Overheat, and Stall

When a servo fails, it rarely dies silently. Recognizing these signatures on the bench will save you from burning out your power supply or stripping your mechanical linkages.

  • The 'Hum' or 'Chatter' (Mechanical Bind or Undervoltage): If the servo vibrates rapidly without moving to the target angle, the internal potentiometer is oscillating around the target deadband. This is usually caused by a mechanical bind in your linkage, or the power supply voltage sagging below 4.8V under load, causing the internal IC to brownout and reset repeatedly.
  • Overheating (Hot Plastic/Ozone Smell): Servos draw continuous, high current to fight gravity when holding a static load. If your robotic arm is holding a weight extended horizontally for more than 30 seconds, the motor windings will overheat. Fix: Redesign the mechanics to include a physical brake, a worm-gear stage (which cannot be back-driven), or a counterweight.
  • Jittering at Rest (Ground Loop or Noisy PWM): If the servo twitches randomly when it should be holding still, you likely have a ground loop or noisy signal line. Ensure the PWM signal wire is not routed parallel to high-current motor wires, and verify that the MCU and servo share a single, star-grounded GND point.

The Decision Tree: Which Motor Should You Actually Buy?

Use this decision path to terminate your selection process and pick a concrete part number for your BOM.

If Your Load Profile Requires... Then Choose This Motor Type Concrete Part Recommendation
Continuous 360° rotation for drive wheels or conveyors. DC Gearmotor (Not a standard servo) Pololu 37D Metal Gearmotor (12V, 100:1 ratio)
High-precision linear motion (CNC, 3D printer axes) where missing a step is catastrophic. Stepper Motor with Closed-Loop Driver NEMA 17 Stepper + BigTreeTech TMC2209 Driver
Lightweight indicator dials, camera pans, or RC steering (< 2 kg·cm load). Standard Analog Micro Servo TowerPro SG90 (9g, 1.8 kg·cm) - approx. $3
Robotic arm joints, heavy payload gimbals, or high-stress dynamic linkages (10-25 kg·cm load). Digital Metal-Gear Servo DS3218 20kg-cm Digital Servo (270° or 180° variant) - approx. $20

The Default Recommendation

If you are building a mid-sized robotic arm, an automated pet feeder, or a heavy-duty camera gimbal and you are unsure where to start, buy the DS3218 20kg-cm digital servo. Digital servos use an internal microcontroller to process the PWM signal and drive the motor at a much higher frequency than analog servos. This results in vastly superior holding torque, faster response times, and a tighter deadband. While it draws slightly more resting current (requiring a robust 6V 3A BEC), the mechanical reliability and positional accuracy of the DS3218 make it the undisputed workhorse for serious embedded actuator projects. For deeper integration strategies and power scaling, refer to the Adafruit Motor Selection Guide to match your specific battery chemistry to the servo's stall current demands.