The Arduino robotic arm is the canonical DIY robotics build — cheap, well understood, and a perfect introduction to motors, power and motion control. This guide builds a 4-DOF arm (base rotation, shoulder, elbow, gripper) you can control by hand with potentiometers or from your computer over serial.
New to the whole idea? Read how to build a robotic arm first.
Parts list
| Part | Notes |
|---|---|
| Arduino Uno / Nano | Any AVR board works; ESP32 if you want WiFi later |
| 4 hobby servos | Use MG996R (metal gear) for base + shoulder, SG90 for elbow + gripper |
| 5–6V power supply, 3A+ | A UBEC or bench PSU. Not the Arduino 5V pin |
| Potentiometers ×4 | Optional, for manual control |
| Breadboard + jumpers | For wiring |
| Frame | 3D-printed, laser-cut, or kit brackets |
Total cost is roughly $35–$60 depending on servo quality. See servo motors for robotic arms for how to choose.
Wiring: the one rule that matters
The number one beginner mistake is powering servos from the Arduino. Do this instead:
- Each servo signal wire → a PWM pin (3, 5, 6, 9).
- All servo V+ → the + of your 5–6V supply.
- All servo GND → the – of the supply and an Arduino GND pin (common ground — this is essential).
Add a 470–1000µF capacitor across the servo power rails. It absorbs the current spikes when servos start moving and kills most jitter and resets.
Test sketch: sweep every joint
Upload this first to confirm wiring and direction before assembly:
#include <Servo.h>
Servo base, shoulder, elbow, gripper;
void setup() {
base.attach(3);
shoulder.attach(5);
elbow.attach(6);
gripper.attach(9);
}
void loop() {
for (int a = 30; a <= 150; a++) { // sweep up
base.write(a); shoulder.write(a);
elbow.write(a); gripper.write(a);
delay(15);
}
for (int a = 150; a >= 30; a--) { // sweep back
base.write(a); shoulder.write(a);
elbow.write(a); gripper.write(a);
delay(15);
}
}
If a joint runs the wrong way, flip its angle in code (180 - a) rather than
re-mounting the servo.
Manual control with potentiometers
Map four potentiometers to the four joints for intuitive, no-PC control:
#include <Servo.h>
Servo joints[4];
const int pins[4] = {3, 5, 6, 9};
const int pots[4] = {A0, A1, A2, A3};
// Per-joint safe limits {min, max} so the arm can't hit itself
const int lo[4] = {0, 20, 10, 30};
const int hi[4] = {180, 160, 170, 110};
void setup() {
for (int i = 0; i < 4; i++) joints[i].attach(pins[i]);
}
void loop() {
for (int i = 0; i < 4; i++) {
int raw = analogRead(pots[i]); // 0–1023
int ang = map(raw, 0, 1023, lo[i], hi[i]);
joints[i].write(ang);
}
delay(15);
}
Control from your computer over serial
Send commands like 0:90 (joint 0 to 90°) from the Arduino Serial Monitor:
#include <Servo.h>
Servo joints[4];
const int pins[4] = {3, 5, 6, 9};
void setup() {
Serial.begin(9600);
for (int i = 0; i < 4; i++) joints[i].attach(pins[i]);
Serial.println("Send joint:angle e.g. 2:120");
}
void loop() {
if (Serial.available()) {
int j = Serial.parseInt();
if (Serial.read() == ':') {
int a = constrain(Serial.parseInt(), 0, 180);
if (j >= 0 && j < 4) { joints[j].write(a);
Serial.print("joint "); Serial.print(j);
Serial.print(" -> "); Serial.println(a);
}
}
}
}
Smoother motion and more servos
Two upgrades make a big difference:
- PCA9685 driver. A 16-channel I2C PWM board offloads servo timing from the Arduino, giving smoother motion and freeing pins. Essential past ~6 servos.
- Eased moves. Instead of
write(target), step toward the target a few degrees per loop so joints accelerate instead of snapping.
Where to go next
- Want the arm to reach a point in space automatically? Add inverse kinematics.
- Want a rigid, precise frame? Print a 3D-printed arm.
- Want camera vision or a web interface? Add a Raspberry Pi as the brain.
Frequently asked questions
Can an Arduino Uno power servos directly?
No. The Uno's onboard 5V regulator can't supply the current several servos draw, especially under load — it will brown out and reset. Use a separate 5–6V supply (a 3A UBEC or a bench supply) and share grounds with the Arduino.
How many servos can an Arduino control?
An Arduino Uno can drive up to 12 servos with the Servo library (8 on some boards while keeping serial). For more, or for smoother simultaneous motion, use a PCA9685 16-channel PWM driver over I2C — it offloads timing from the Arduino.
Why does my robotic arm jitter?
Servo jitter is almost always a power problem: an under-rated supply, a missing common ground, or long/noisy signal wires. Add a large capacitor (470–1000µF) across the servo supply rails and keep signal wires short.