Servo-Controlled Robot Arm
A three-joint arm you steer with knobs — base, elbow and gripper.
What You'll Build
You will build a small robot arm with three moving joints, each controlled by turning a knob. Twist the first knob and the base rotates, the second lifts the arm, the third opens and closes the gripper. Once it works you can record a sequence of positions and let the arm repeat the movement by itself.
What You Need
- ✓Arduino Uno
- ✓3 × SG90 servo
- ✓3 × potentiometer
- ✓External 5V supply
- ✓Breadboard
How It Works
A servo is a motor that knows its own angle. You tell it 'go to 90 degrees' and it gets there and holds. Each potentiometer gives the Arduino a number from 0 to 1023 as you turn it, and the map() function converts that range into an angle from 0 to 180. Read, map, write — repeated many times a second, that feels like smooth remote control.
Wiring
- 1Servo signals → pins 9, 10, 11.
- 2All servo power from an external 5V supply, never the Arduino's 5V pin.
- 3Join the external supply ground to Arduino GND.
- 4Potentiometer outer legs to 5V and GND, middle legs to A0, A1, A2.
Step-by-Step Instructions
- 1
Assemble the joints
Build from the bottom up: base servo, then shoulder, then the gripper. Centre every servo at 90° before you screw its horn on, or the arm will hit its own limits.
- 2
Power the servos properly
Three servos moving together can pull well over an amp. A separate 5V supply keeps the Arduino from browning out and resetting mid-move.
- 3
Wire the knobs
Each potentiometer is a voltage divider you can turn. The middle pin carries the changing voltage to an analog input.
- 4
Add smoothing
Raw analog readings jitter slightly, which makes servos buzz. Average a few readings or ignore changes smaller than two degrees.
- 5
Record a routine
Once you enjoy driving it manually, store a list of angles in arrays and play them back to automate a pick-and-place move.
Arduino Code
#include <Servo.h>
Servo base, elbow, grip;
int smooth(int pin) {
long total = 0;
for (int i = 0; i < 8; i++) total += analogRead(pin);
return total / 8;
}
void setup() {
base.attach(9);
elbow.attach(10);
grip.attach(11);
}
void loop() {
base.write(map(smooth(A0), 0, 1023, 0, 180));
elbow.write(map(smooth(A1), 0, 1023, 15, 165));
grip.write(map(smooth(A2), 0, 1023, 30, 110));
delay(15);
}Understanding the Code
int smooth(int pin)Reads the knob eight times and averages the result, which removes most of the jitter.
map(value, 0, 1023, 0, 180)Stretches one range onto another. Knob all the way left becomes 0°, all the way right becomes 180°.
elbow.write(map(..., 15, 165))Limits the elbow to a safe range so the arm cannot bend into itself.
delay(15)About 60 updates per second — smooth to the eye, gentle on the servos.
Challenges & Upgrades
Troubleshooting
😖 Servos twitch constantly
Fix: Add the averaging function and give the servos their own power supply.
😖 Arm collapses under its own weight
Fix: SG90 servos are weak. Shorten the arm segments or move up to MG996R metal-gear servos.
Up next
🎵 LED Music Visualizer