When building an Arduino for servo motor control, the most common bench mistake is treating the microcontroller as a power source. An Arduino Uno’s ATmega328P can only source about 20mA per GPIO pin, while a standard micro servo draws 10mA at idle and spikes past 700mA under stall conditions. The Arduino’s job is strictly to generate a precise 50Hz PWM signal; the heavy lifting requires an external power supply and, for arrays larger than two servos, a dedicated I2C PWM driver.
This guide breaks down exactly how to match your load profile to the right motor, size your power delivery, and read the physical failure signatures before you strip a nylon gear or brown out your microcontroller.
Motor Type Match: Why Servos Win for Angular Precision
Not all rotary actuators are interchangeable. Choosing between a servo, a stepper, or a DC motor depends entirely on your torque curve requirements and whether you need closed-loop position feedback without external sensors. Servos dominate in applications requiring high holding torque at zero speed and absolute angular positioning within a constrained arc (typically 180° or 270°).
| Motor Type | Torque Curve Profile | Control Needs | Typical Cost (Hobby Grade) |
|---|---|---|---|
| Standard RC Servo | High holding torque at zero speed; drops off at high RPM. | Closed-loop position via internal potentiometer; 50Hz PWM signal. | $10 - $30 |
| Continuous Rotation Servo | Constant torque across speed range; zero holding torque. | Open-loop speed/direction control; 50Hz PWM signal. | $12 - $25 |
| NEMA 17 Stepper | High holding torque; drops sharply as step rate increases. | Open-loop position via step pulses; requires homing switch for absolute reference. | $15 - $40 |
| Brushed DC Motor | Low starting torque; peaks at mid-RPM; zero holding torque. | Requires external quadrature encoder and PID loop for position control. | $8 - $20 |
If your load profile demands moving a joint to a specific degree and holding it there against gravity (like a robotic arm or a pan-tilt camera mount), the standard RC servo is the correct choice. Steppers are better suited for continuous high-precision linear motion (like 3D printer axes) where missed steps can be mitigated by physical end-stops.
Sizing Your Servo: Load Profiles and Worked Examples
Servo torque is universally rated in hobbyist datasheets as kg-cm (kilogram-centimeters) or oz-in, while industrial specs use Newton-meters (Nm). The golden rule of servo sizing is to calculate your static stall torque requirement, then apply a 50% safety margin to account for dynamic loads, friction, and inertia.
Worked Load Example: Robotic Arm Joint
Imagine you are designing a shoulder joint for a desktop robotic arm. The forearm assembly (including the payload) weighs 200g (0.2 kg), and the center of mass is 15 cm away from the shoulder joint axis.
- Calculate Force: Mass × Gravity = 0.2 kg × 9.81 m/s² = 1.96 N.
- Calculate Static Torque: Force × Distance = 1.96 N × 0.15 m = 0.294 Nm.
- Convert to kg-cm: 0.294 Nm × 10.197 = 3.0 kg-cm.
- Apply 50% Dynamic Margin: 3.0 kg-cm × 1.5 = 4.5 kg-cm minimum requirement.
For this load, a standard SG90 micro servo (rated at 1.8 kg-cm) will instantly stall and strip its nylon gears. You need a mid-range actuator like the TowerPro MG996R (rated 10-13 kg-cm, ~$12) or the higher-end DS3218 (rated 20 kg-cm, ~$25 with metal gears). According to Pololu's RC servo guidelines, always verify the stall current of your chosen model to size your power supply correctly; the MG996R can pull up to 2.5A at stall.
Wiring, Terminals, and Controller Demands
Because an Arduino cannot supply the current for multiple servos, you must separate the logic power from the actuator power. For projects driving three or more servos, the industry standard is the PCA9685 16-Channel I2C PWM Driver. This chip offloads the precise 50Hz timing from the Arduino’s hardware timers, communicating instead over the I2C bus.
Terminal Identification and Wiring
Standard hobby servos use a 3-pin JST connector. The wire colors are almost universally standardized, though the signal wire color can vary slightly by manufacturer.
- Brown or Black (GND): Connects to the common ground of both your external power supply and your Arduino.
- Red (VCC): Connects to the external 5V to 7.4V power supply. Never connect this to the Arduino's 5V pin.
- Orange, White, or Yellow (Signal): Carries the 50Hz PWM pulse. Connects to the PCA9685 output pins.
PCA9685 to Arduino Pin Mapping
| PCA9685 Shield Pin | Arduino Uno (ATmega328P) | ESP32 DevKit V1 | Function |
|---|---|---|---|
| VCC | 5V | 3.3V | Logic power for the I2C chip |
| GND | GND | GND | Common logic ground |
| SDA | A4 | GPIO 21 | I2C Data line |
| SCL | A5 | GPIO 22 | I2C Clock line |
| V+ (Screw Terminal) | External 5V PSU (+) | External 5V PSU (+) | Motor power (up to 10A) |
| GND (Screw Terminal) | External PSU (-) & Arduino GND | External PSU (-) & ESP32 GND | Motor ground (Must share with logic) |
Reading Failure Signatures: Hum, Overheat, and Stall
Servos communicate their distress physically before they fail catastrophically. Learning to read these signatures will save you from burning out driver boards and stripping gearboxes.
1. The 'Hum' or Jitter
Symptom: The servo vibrates audibly and oscillates ±2 degrees around the target position, even when the Arduino code commands a static angle.
Cause: Power supply ripple, inadequate PSU capacitance, or a missing common ground. When multiple servos move, they create massive transient voltage drops on the 5V rail. If the voltage dips below 4.5V, the servo's internal control board resets, causing it to hunt for its position.
Fix: Solder a 1000µF to 2200µF electrolytic capacitor directly across the V+ and GND screw terminals on your PCA9685 board to smooth out transient current spikes.
2. Overheat (Casing > 60°C)
Symptom: The servo casing is too hot to touch, and it may emit a faint smell of hot plastic or ozone.
Cause: Sending a PWM pulse width that exceeds the servo's physical travel limits, or holding a heavy load at stall for extended periods. The NXP PCA9685 datasheet notes that the chip outputs exact pulse widths; if your code commands a 2500µs pulse to a servo mechanically limited to 2000µs, the internal DC motor will drive hard against the mechanical end-stop, drawing stall current continuously.
Fix: Calibrate your minimum and maximum pulse widths in code. For most standard servos, 500µs is 0° and 2500µs is 180°, but always test with 10° increments to find the exact physical limits before writing your final array bounds.
3. Stall and Clicking
Symptom: A rhythmic clicking sound from the gearbox, followed by a loss of positional accuracy.
Cause: Mechanical binding in your linkage, or the load exceeding the breakaway torque of the gears. In nylon-gear servos (like the SG90), this strips the teeth off the output shaft gear. In metal-gear servos (like the MG996R), the gears will survive, but the internal potentiometer wiper will slip or the DC motor brushes will burn out.
Fix: If the load requires more than 80% of the servo's rated torque, you must either redesign the mechanical linkage to reduce the moment arm, or step up to a higher-torque, higher-voltage (7.4V LiPo) servo system. Never rely on software current-limiting to save a mechanical gearbox.






