The Direct Answer: What Is a Servo Motor?

A servo motor is a closed-loop rotary actuator that uses internal positional feedback to precisely control angular or linear position. Unlike a standard DC motor that spins freely when voltage is applied, a servo contains a DC motor, a gear train, a feedback sensor (typically a potentiometer in hobby models or a magnetic encoder in industrial models), and a control circuit. You command a specific angle, and the internal circuitry drives the motor until the feedback sensor confirms the output shaft has reached that exact position, actively fighting external forces to hold it there.

In the maker and embedded space, "servo" almost always refers to the standard hobby RC servo. These are ubiquitous in robotic arms, camera gimbals, and automated valves because they bundle the motor, gearbox, and driver into a single, easily mounted package.

Wiring and Terminal Identification

Standard hobby servos use a 3-wire interface. While color codes vary slightly by manufacturer (Futaba, Hitec, TowerPro), the pinout remains universal:

  • Ground (GND): Usually Brown or Black. This must be shared with your microcontroller's ground to establish a common reference for the control signal.
  • Power (VCC): Usually Red. Nominally 4.8V to 6.0V for standard servos, though high-voltage (HV) servos can tolerate up to 8.4V.
  • Signal (PWM): Usually Orange, White, or Yellow. This receives the pulse-width modulation (PWM) command from your microcontroller.
Power Supply Warning: Never power more than one micro-servo (like an SG90) directly from an Arduino's 5V pin. A standard servo like the MG996R can draw 2.5A at stall. This will instantly brownout your microcontroller's voltage regulator, causing random resets and potential hardware damage. Always use a dedicated 5V/6V BEC (Battery Eliminator Circuit) or a buck converter (like an LM2596 module) for servo power, and tie the grounds together.

Servo vs. Stepper vs. DC: Which Motor Fits Your Load?

A common mistake in embedded design is treating steppers and servos as interchangeable because both can achieve precise positioning. They operate on fundamentally different principles. Steppers rely on open-loop magnetic detents (steps) and assume the motor has moved exactly as commanded. Servos use closed-loop feedback; if a physical obstruction prevents a servo from reaching its target, the controller knows and pushes harder (until it hits current limits).

Motor Type Comparison for Embedded Positioning
Motor Type Torque Curve Control Needs Cost (USD) Best Load Profile
Hobby Servo (e.g., MG996R) High torque at zero speed; drops off at max angular velocity. 50Hz PWM (1-2ms pulse). Simple GPIO. $5 - $18 Low-speed, high-torque articulating joints (robotic arms, pan/tilt).
Stepper Motor (e.g., NEMA 17) High holding torque; drops significantly as speed increases. Step/Direction pulses via dedicated driver (A4988, TMC2209). $12 - $35 Continuous precision movement where holding position against a load is required (3D printers, CNC).
Brushed DC Motor Low torque at zero speed; peaks at mid-range RPM. H-Bridge for direction; requires external encoder for position control. $3 - $10 High-speed continuous rotation (wheels, conveyors) where exact angular holding is not needed.
Smart Servo (e.g., Dynamixel XL430) Flat, consistent torque curve across operating range. UART/RS485 serial bus. Daisy-chainable. $45 - $150+ Advanced humanoid robotics requiring real-time telemetry (temp, load, position) and PID tuning.

Which motor type fits this load profile? If your application requires moving a heavy lever arm slowly, holding it at specific discrete angles against gravity, and you want minimal wiring, choose a servo. If you need continuous rotation with high precision and the ability to hold position indefinitely without overheating, choose a stepper.

Sizing Rule of Thumb and Worked Load Example

Servo torque is typically rated in kilogram-centimeters (kg-cm) or ounce-inches (oz-in) at a specific voltage (usually 4.8V and 6.0V). This rating represents the stall torque—the maximum force the servo can exert at a specific distance from the output shaft center before it stops moving.

The Sizing Rule of Thumb: Calculate your static load torque, then apply a 2x to 3x safety factor. Hobby servo potentiometers suffer from deadbands, and gear trains have friction. Furthermore, accelerating a mass requires significantly more torque than simply holding it static. Sizing at 3x your static calculation ensures reliable operation and prevents gear stripping.

Worked Load Example: Robotic Arm Joint

Suppose you are designing the shoulder joint for a desktop robotic arm. The arm segment is 15 cm long from the pivot point, and the total weight of the arm segment plus the maximum payload at the gripper is 250 grams (0.25 kg).

  1. Calculate Force: F = mass × gravity = 0.25 kg × 9.81 m/s² = 2.45 Newtons.
  2. Calculate Static Torque: Torque = Force × Distance = 2.45 N × 0.15 m = 0.3675 Newton-meters (Nm).
  3. Convert to kg-cm: 0.3675 Nm is approximately 3.75 kg-cm. (This is the absolute minimum torque required just to hold the arm horizontal against gravity).
  4. Apply Safety Factor: 3.75 kg-cm × 3 = 11.25 kg-cm.

Selection: A micro servo like the SG90 (1.8 kg-cm) will instantly stall and strip its nylon gears. A standard TowerPro MG996R (rated at 13 kg-cm at 6.0V) is the correct choice here, providing just enough overhead for dynamic acceleration without oversizing the physical footprint.

Controller Demands and Failure Signatures

Hobby servos demand a 50Hz PWM signal (a pulse every 20 milliseconds). The width of the pulse dictates the position: typically, 1.0 ms commands 0°, 1.5 ms commands 90° (center), and 2.0 ms commands 180°. You can generate this using the standard Servo.h library on AVR-based Arduinos, or the ESP32Servo library for Espressif chips.

When debugging embedded servo circuits, the motor's physical behavior provides immediate diagnostic feedback. Recognizing these failure signatures will save hours of multimeter probing:

  • Humming and Jittering: The servo vibrates rapidly around the target position without settling. Cause: This is almost always a power or signal integrity issue. A shared ground wire that is too thin will introduce voltage spikes into the MCU's ground reference, corrupting the PWM timing. Alternatively, a dirty internal potentiometer in an aging servo will cause the control loop to hunt for a position it cannot resolve.
  • Overheating: The servo casing becomes too hot to touch within minutes. Cause: The servo is stalling against a mechanical hard stop, or the commanded position is outside its physical travel limits. When a servo cannot reach its target, it drives maximum current continuously. Unlike steppers, which can be configured to reduce holding current, standard hobby servos draw full stall current until the error is resolved or the internal thermal protection (if equipped) trips.
  • Stalling and Clicking: The motor hums, but the shaft doesn't move, accompanied by a rhythmic clicking sound. Cause: The load exceeds the stall torque, and the internal gears are skipping or stripping. If you hear this, immediately cut power. Upgrading from nylon to metal gears (e.g., moving from an MG995 to an MG996R) solves the stripping, but you must ensure the motor itself isn't burning out from the excessive current draw.

For advanced control, consider migrating from analog PWM servos to serial bus servos like the Dynamixel XL430. These utilize UART/RS485 communication, allowing you to daisy-chain dozens of motors on a single serial port, read real-time temperature and load data, and tune the internal PID controller to eliminate the jitter inherent in analog potentiometers.

Frequently Asked Questions

What is a servo motor used for in Arduino projects?

In Arduino and ESP32 projects, servos are primarily used for low-speed, high-torque angular positioning. Common applications include robotic arm joints, pan-and-tilt camera mounts, automated pet feeders, throttle actuators for RC vehicles, and valve controls. Because they require only a single digital PWM pin and an external power source, they are the most accessible actuator for beginners learning closed-loop control concepts.

What is the difference between a standard servo and a continuous rotation servo?

A standard servo is limited to a specific angular range (usually 180° or 270°) and uses a physical potentiometer linked to the output shaft to measure absolute position. A "continuous rotation servo" has had this physical stop and the potentiometer removed or bypassed. Instead of commanding an angle, the PWM pulse width commands speed and direction (1.0 ms = full speed reverse, 1.5 ms = stop, 2.0 ms = full speed forward). Continuous servos act like geared DC motors with built-in drivers, but they cannot hold a specific position.

Why is my servo twitching or jittering when connected to an ESP32?

The ESP32 handles PWM generation differently than the classic Arduino Uno. On the ESP32, standard PWM is often routed through the LEDC (LED Control) peripheral. If you are using the default Arduino Servo.h library alongside WiFi or Bluetooth, the radio interrupts can disrupt the software timers, causing microsecond variations in the PWM pulse width. Since a 10-microsecond jitter translates to a fraction of a degree of physical movement, the servo twitches. The fix is to use the dedicated ESP32Servo library, which properly allocates hardware LEDC channels and isolates the timing from wireless interrupts.

Can I use a 9V battery to power a high-torque servo?

No, for two reasons. First, standard hobby servos are rated for a maximum of 6.0V (or 7.4V for specific High-Voltage models). Applying 9V will instantly destroy the internal control PCB and likely burn out the DC motor. Second, standard rectangular 9V alkaline batteries have very high internal resistance and low current capacity (typically around 500mAh). A high-torque servo like the DS3218 can draw 3A or more at stall. The 9V battery's voltage will immediately collapse under this load, starving the servo and resetting your microcontroller. Always use a 2S LiPo battery with a 5V/6V BEC, or a high-current 5V USB power bank paired with a step-up/step-down buck converter.