The Direct Answer: Servo to Arduino Pin Mapping

Wiring a standard RC hobby servo (like the ubiquitous TowerPro SG90 or MG996R) to an Arduino requires exactly three connections: Ground, Power (VCC), and a PWM Signal. The physical connector on the servo is a standard 3-pin JR/Futaba plug. Looking directly at the connector from the bottom (where the wires enter the plastic housing), the pinout from left to right is Ground, VCC, and Signal.

Servo Wire Color (Standard JR) Function Arduino Uno / Nano Pin Physical Connector Position (Bottom View)
Brown (or Black) Ground (GND) Any GND pin Left (Edge)
Red Power (VCC / +5V) 5V pin (or external BEC) Center
Orange (or Yellow/White) PWM Control Signal Pin 9 (or any PWM-capable pin) Right (Edge)
Wire Color Warning: While Brown/Red/Orange is the modern JR standard, older Futaba servos use Black/Red/White. Always trace the wires to the internal PCB if you are salvaging servos: the outermost wire on the connector latch side is almost always Ground.

Node-by-Node Wiring Trace & Diagram Symbols

When reading a schematic or wiring diagram for this circuit, you will encounter three specific symbols. Here is what they mean and how the current actually flows through your physical build.

Diagram Symbols in this Drawing

  • PWM Square Wave Symbol (~): Represents the 50Hz digital pulse train generated by the Arduino's ATmega328P timer. It tells the servo's internal microcontroller what angle to hold.
  • DC Motor Symbol (M in a circle): Represents the brushed DC motor inside the servo housing. This is the actual inductive load drawing the heavy current.
  • Chassis Ground Symbol (Horizontal lines decreasing in width): Represents the common return path. In our DC circuit, this is the 0V reference shared by the Arduino and the servo.

The Node-by-Node Trace

  1. Source to VCC: Current originates from your power supply (USB or external BEC). It enters the Arduino's 5V rail, travels through the red jumper wire, and enters the servo's VCC pin.
  2. VCC to Load: Inside the servo, the 5V rail powers the internal H-bridge motor driver and the potentiometer feedback loop.
  3. Signal Path: Simultaneously, the Arduino outputs a 5V logic pulse from Pin 9. This travels via the orange wire to the servo's internal MCU, which compares the pulse width (1ms to 2ms) against the potentiometer's physical position.
  4. The Ground Return (Crucial): After passing through the motor and logic circuits, the current exits the servo via the brown wire. It travels back to the Arduino's GND pin, completing the circuit back to the power supply's negative terminal. If this ground path is broken or shared with a high-current load causing a ground loop, the servo will jitter violently or the Arduino will reset.

Power Decision Tree: Sizing the 5V Rail

The most common mistake when learning how to connect a servo to an Arduino is powering the servo directly from the Arduino's onboard 5V pin. A standard SG90 micro servo draws ~50mA at idle but spikes to 750mA during a stall. An MG996R metal-gear servo can spike to 2.5A. The Arduino Uno's linear voltage regulator will thermally shut down around 150°C, and the USB polyfuse trips at 500mA. Use this decision tree to select your power topology.

Your Hardware Load Power Source Choice Why?
1x Micro Servo (SG90) Arduino 5V Pin (USB powered) 750mA stall is brief; USB 500mA limit usually survives short stalls without tripping the polyfuse.
2x Micro Servos (SG90) Arduino 5V Pin (Barrel Jack 7-12V) Onboard regulator can handle ~800mA continuous, but will get hot. Add a heatsink to the NCP1117 regulator.
1x Standard/Metal Servo (MG996R) OR 3+ Micro Servos External 5V BEC (Battery Eliminator Circuit) Stall currents exceed 1.5A. The Arduino's onboard traces and regulator cannot handle this and will cause a brownout reset.
Concrete Pick (Default Recommendation): If you are building a robotic arm, a pan-tilt camera mount, or using metal-gear servos, do not rely on the Arduino's 5V pin. Buy the Pololu 5V, 3A Step-Down Voltage Regulator D24V30F5 (approx. $12). Wire your main battery pack (e.g., 2S LiPo at 7.4V) into the BEC, run the BEC's 5V output directly to the servo's red wire, and tie the BEC's ground to the Arduino's ground. This guarantees clean, high-current 5V power while keeping the Arduino's logic isolated from motor noise.

Verifying Your Connections with a Multimeter

Before uploading code and risking a stripped servo gear or a bricked microcontroller, grab your digital multimeter (DMM) and verify the physical layer.

  1. Verify the Ground Path (Continuity): Set your DMM to continuity mode (the beep symbol). Unplug the power. Place one probe on the Arduino's GND pin and the other on the servo connector's Ground pin (the brown/black wire side). You must hear a solid beep with a reading of < 1.0 ohm. If it reads 'OL' (Open Loop), your ground jumper is broken or mis-seated.
  2. Verify VCC Voltage: Power the circuit. Set the DMM to DC Voltage. Place the black probe on GND and the red probe on the servo's Red VCC wire. You should read between 4.8V and 5.2V. If you read 4.5V or lower while the servo is moving, your power supply is browning out and you need to upgrade to the external BEC mentioned above.
  3. Verify the PWM Signal: Set the DMM to DC Voltage. Back-probe the orange signal wire while the Arduino is running the sweep code. A standard DMM cannot read the 50Hz frequency accurately; instead, it will display the average DC voltage. As the servo sweeps from 0 to 180 degrees (1ms to 2ms pulse width on a 20ms period), your meter should show a fluctuating average voltage between roughly 0.25V and 0.50V. If you see a steady 5V or 0V, your Arduino pin is stuck HIGH or LOW (check your code pin definitions).

Complete Code & Test Sequence

Once your wiring is verified, use the built-in Arduino Servo library to test the mechanical limits. This code safely sweeps the servo without slamming it into the physical hard stops, which can strip the internal plastic gears on an SG90.

#include <Servo.h>

// Define the exact pin wired to the orange/yellow servo wire
const int SERVO_PIN = 9;

// Create servo object
Servo myServo;

void setup() {
  // Attach the servo to the defined pin
  // The min/max pulse widths (544 and 2400) are standard for most hobby servos
  myServo.attach(SERVO_PIN, 544, 2400);
  
  // Move to a safe center position immediately on boot to prevent startup jitter
  myServo.write(90);
  delay(1000);
}

void loop() {
  // Sweep from 10 to 170 degrees (avoids grinding against 0 and 180 hard stops)
  for (int pos = 10; pos <= 170; pos += 1) {
    myServo.write(pos);
    delay(15); // 15ms delay allows the motor to physically catch up to the command
  }
  
  // Sweep back
  for (int pos = 170; pos >= 10; pos -= 1) {
    myServo.write(pos);
    delay(15);
  }
}

Test Sequence & Troubleshooting

  • Step 1: Upload the code. The servo should smoothly sweep back and forth.
  • Step 2: If the servo vibrates in place without sweeping, your power supply is failing under load (brownout). Switch to the external BEC topology.
  • Step 3: If the servo moves erratically or 'runs away' to 180 degrees and stalls, you have a missing ground connection. The servo's internal MCU is reading noise on the signal line because it lacks a shared 0V reference with the Arduino. Re-check your DMM continuity test.
  • Step 4: For deeper analysis on motor types and stall currents, consult the Adafruit Motor Selection Guide to ensure your chosen servo matches your mechanical torque requirements.