The Direct Answer: What Are Servos Used For in Embedded Systems?
In embedded electronics and robotics, servos are used for precise angular or linear position control in closed-loop systems where the microcontroller needs to enforce an exact shaft angle without relying on external encoders. Unlike standard DC motors that spin continuously and freely, a standard hobby servo contains a DC motor, a gear train, a feedback sensor (usually a potentiometer or magnetic encoder), and an internal error amplifier.
When your Arduino or ESP32 sends a pulse-width modulation (PWM) signal commanding a 90-degree position, the servo's internal circuitry drives the motor until the feedback sensor reads exactly 90 degrees, then holds it there. This makes them the default choice for RC vehicle steering, robotic arm joints, camera gimbals, automated ball valves, and pan-tilt sensor mounts. If your project requires a shaft to move to a specific angle and hold that position against a moderate load, a servo is the correct component.
Servo vs. Stepper vs. DC: Matching the Motor to the Load Profile
A common mistake on the workbench is treating steppers and servos as interchangeable. They solve fundamentally different mechanical problems. To determine which motor type fits your load profile, you must look at the torque curve and the control architecture.
| Motor Type | Torque Curve Profile | Control & Feedback Needs | Typical Cost (2026) |
|---|---|---|---|
| Servo (Standard) | High stall torque; maintains holding torque at zero speed without external power limits. | Closed-loop internal. Requires 50Hz PWM (1000-2000µs). No external driver needed for basic hobby models. | $5 - $45 |
| Stepper (NEMA 17/23) | High holding torque, but torque drops off sharply as RPM increases. | Open-loop (usually). Requires a dedicated stepper driver (e.g., TMC2209, A4988) and step/dir pulses. | $15 - $60 |
| Brushed DC | Linear torque-speed curve; maximum torque at stall, zero torque at max no-load speed. | Open-loop. Requires an H-bridge for direction/speed. Needs an external optical/magnetic encoder for position. | $3 - $25 |
Sizing Rule of Thumb and Worked Load Example
The most frequent cause of stripped servo gears and burned-out internal H-bridges is sizing the motor based on its advertised 'stall torque.' Stall torque is the absolute maximum force the motor can exert right before it stops moving and the current spikes to destructive levels.
The Sizing Rule of Thumb: Never design a mechanism that requires more than 50% of the servo's rated stall torque for continuous operation. If your calculated load requires 5 kg-cm of torque, you must select a servo rated for at least 10 kg-cm stall.
Worked Load Example: Robotic Arm Gripper
Imagine you are building a robotic arm segment that is 15 cm long (from the servo spline to the center of mass of the payload). The payload (gripper + object) weighs 300 grams (0.3 kg). You need to hold this arm perfectly horizontal.
- Calculate Force: Force = mass × gravity. 0.3 kg × 9.81 m/s² = 2.94 Newtons.
- Calculate Required Torque: Torque = Force × Distance. 2.94 N × 0.15 m = 0.441 Newton-meters (Nm).
- Convert to Hobby Units: 0.441 Nm is roughly equivalent to 4.5 kg-cm.
- Apply the 50% Rule: 4.5 kg-cm × 2 = 9.0 kg-cm minimum required stall torque.
Based on this math, a standard 9g micro servo (rated ~1.8 kg-cm) will immediately strip its plastic gears. A TowerPro MG996R (rated ~13 kg-cm at 6V) provides a safe margin. If the arm will be moving dynamically (accelerating and decelerating), you must add an additional 20-30% margin to account for inertial forces, pushing you toward a 20 kg-cm model like the DS3218.
Wiring, Terminals, and Controller Demands
Standard hobby servos use a 3-pin connector (often JR or Futaba style). Correct terminal identification is critical, as reversing VCC and GND will instantly fry the internal error amplifier IC.
- Signal (Pin 1): Usually White, Yellow, or Orange. Carries the 50Hz PWM control signal.
- VCC (Pin 2): Always Red. Requires 4.8V to 6.0V DC for standard servos, or up to 8.4V for high-voltage (HV) models.
- GND (Pin 3): Usually Black or Brown. Must share a common ground with your microcontroller.
Standard servos expect a 50Hz PWM signal with a pulse width between 1000µs (0 degrees) and 2000µs (180 degrees). On an Arduino Uno, the built-in Servo library handles this timing automatically. On an ESP32, you must configure the LEDC (LED Control) peripheral or the newer MCPWM driver to output a 50Hz signal with the correct duty cycle resolution, as the ESP32 does not have native hardware servo timers like the ATmega328P.
Failure Signatures: Hum, Overheat, and Stall
When a servo system fails, it rarely does so silently. Recognizing these failure signatures on the bench will save you from burning out components.
- Humming and Jitter: If the servo vibrates or 'chatters' while holding still, you likely have a noisy power supply, a ground loop, or a worn internal potentiometer. On ESP32 projects, jitter is also a classic symptom of WiFi/Bluetooth radio transmission causing interrupt latency in the PWM timer. Fix this by using hardware-driven PWM (LEDC) rather than software bit-banging.
- Overheating (Hot to the touch): Servos draw maximum current when they are stalled (fighting a load they cannot move). If your mechanical linkage has a hard stop and the servo is continuously commanded to push past that stop, the internal motor will overheat and melt the plastic casing or desolder the internal brushes. Implement software limits to prevent commanding angles beyond your mechanical travel.
- Stall and Stripping: If you hear a loud grinding noise followed by the servo spinning freely without moving the load, the gears have stripped. Upgrading to 'metal gear' servos (like the MG996R) prevents the gears from stripping, but transfers that destructive force to the output spline or your 3D-printed mount. Always design a mechanical shear pin or clutch into high-load linkages.
Frequently Asked Questions
What are continuous rotation servos used for compared to standard servos?
Continuous rotation servos have had their internal potentiometer removed or disconnected, replacing the positional feedback with a fixed voltage divider. Instead of moving to a specific angle, the PWM pulse width now controls speed and direction (1000µs = full speed reverse, 1500µs = stop, 2000µs = full speed forward). They are used for simple drive wheels on lightweight rovers, conveyor belts, or rotating radar displays where exact angular positioning is not required, but the convenience of a 3-wire interface is desired.
What are digital servos used for that analog servos cannot do?
Digital servos use a microcontroller inside the casing to process the PWM signal and drive the motor with a much higher frequency internal PWM (often 300Hz to 500Hz, compared to the 50Hz of analog models). This allows them to deliver maximum torque instantly at the start of a movement and hold position much more rigidly. They are used in high-performance RC helicopters for rapid cyclic pitch changes and in competitive robotics where tight, zero-slop holding is required. The trade-off is that they draw significantly more continuous current and will drain batteries faster than analog equivalents.
Why is my ESP32 servo jittering when connected to WiFi?
The original ESP32 chip has a known hardware quirk where WiFi and Bluetooth radio interrupts can interfere with the software-based PWM timers, causing microsecond delays in the servo pulse width. Since a servo interprets a 10µs change in pulse width as a 1-degree shift, these interrupts manifest as visible jitter. The ESP-IDF LEDC peripheral solves this by offloading the PWM generation to dedicated hardware that is immune to CPU interrupts. If using the Arduino IDE, ensure you are using the ledcWrite() functions mapped to a 50Hz channel, rather than the legacy Servo.h library which may rely on software interrupts.






