Four-servo robot arm with record and playback on Arduino: design worksheet and code

A ₹2,200 design worksheet for a four-servo arm you pose with potentiometers, record as poses and play back smoothly, with the memory maths, interpolation timing and power budget set out.

About the author · Editorial & verification standards

  • Parts₹2,200
  • Bench time8–12 h
  • LevelIntermediate
  • ReviewedNov 2026

A ₹2,200 small robot arm you can teach by example. Four potentiometers move the four servos live. A button stores the current pose, and a second button plays all the stored poses back, blending smoothly from one to the next. It teaches servo control, memory budgeting and the idea of a taught sequence, which is how many real arms are programmed.

Scope: intermediate. This is a design worksheet with illustrative costs. It has not been bench-tested by this site. The memory and timing figures were computed by script. Small hobby servos are weak and the load you can lift with an acrylic arm is small, a few tens of grams at most. Keep fingers clear of the arm, and plan the power supply carefully: four servos can pull a few amps when they stall.

How it works

The arm has four joints: base, shoulder, elbow and gripper. In live mode each servo follows its potentiometer. Pressing the record button stores the four angles as one pose. Each angle fits in a single byte (0 to 180), so a pose is 4 bytes and 50 poses use 200 bytes, a tenth of the Uno’s 2,048 bytes of RAM. The Uno’s 1,024 bytes of EEPROM could keep up to 255 poses if you want them to survive power-off.

On playback the sketch does not jump between poses. It blends from the current angles to the next pose in 20 steps of 15 ms, so each move takes 300 ms, and a servo that has to travel 90 degrees moves 4.5 degrees per step.

Bill of materials

PartQtyUnitTotal
Arduino Uno R3 (or compatible)1₹550₹550
MG90S metal-gear micro servo4₹180₹720
Acrylic robot arm frame for micro servos1₹450₹450
10 kilohm potentiometers4₹20₹80
Push buttons2₹10₹20
5 V 3 A power supply1₹250₹250
1000 µF capacitor1₹20₹20
Breadboard1₹60₹60
Jumper wires1₹50₹50
Parts total₹2,200

Scroll the table sideways to see every column.

Prices checked Nov 2026. Shipping and tools are not included.

Prices are illustrative figures for Indian sellers in November 2026, before shipping, and have not been checked against current listings.

The numbers

ItemValue
Bytes per pose4
50 poses in RAM200 bytes
Poses that fit EEPROM (1,024 bytes)up to 255
Blend steps between poses20 × 15 ms = 300 ms
Movement for a 90° change4.5° per step
Playback of 10 posesabout 3 seconds
These are design choices. Servo speed under load and the arm’s own inertia may make real moves slower.

Servo current is the real limit. Small servos are often listed with stall currents in the hundreds of milliamps each, so four of them stalling together could demand a few amps. A 3 A supply gives headroom. Add a large capacitor across the servo supply to smooth the spikes, and never power the servos from the Uno.

Power and wiring

PartConnects toNote
Potentiometers (middle pins)A0, A1, A2, A3Base, shoulder, elbow, gripper; outer pins to 5V and GND
Servos signalD3, D5, D6, D9
Record buttonD2 to GNDInternal pull-up
Play buttonD4 to GNDInternal pull-up
Servo power5 V 3 A supply with 1000 µF across itCommon GND with the Uno
Join the supply ground, the Uno ground and the potentiometer ground at one point.

The sketch

// Four-servo arm with record and playback: Uno + 4 servos + 4 pots
// Design worksheet: keep fingers clear; test with the arm unloaded.

#include <Servo.h>

const int N_SERVO = 4;
const int SERVO_PINS[N_SERVO] = {3, 5, 6, 9};
const int POT_PINS[N_SERVO] = {A0, A1, A2, A3};
const int REC_BTN = 2, PLAY_BTN = 4;
const int MAX_POSES = 50;
const int STEPS = 20;
const int STEP_MS = 15;

Servo servos[N_SERVO];
byte poses[MAX_POSES][N_SERVO];
int nPoses = 0;
int current[N_SERVO];

int potAngle(int i) { return map(analogRead(POT_PINS[i]), 0, 1023, 10, 170); }

void setAll() { for (int i = 0; i < N_SERVO; i++) servos[i].write(current[i]); }

void blendTo(const byte *target) {
  int start[N_SERVO];
  for (int i = 0; i < N_SERVO; i++) start[i] = current[i];
  for (int s = 1; s <= STEPS; s++) {
    for (int i = 0; i < N_SERVO; i++)
      current[i] = start[i] + (int)(((long)target[i] - start[i]) * s / STEPS);
    setAll();
    delay(STEP_MS);
  }
}

void setup() {
  pinMode(REC_BTN, INPUT_PULLUP);
  pinMode(PLAY_BTN, INPUT_PULLUP);
  for (int i = 0; i < N_SERVO; i++) {
    current[i] = potAngle(i);
    servos[i].write(current[i]);         // set the start angle before attaching
    servos[i].attach(SERVO_PINS[i]);
  }
}

void loop() {
  if (digitalRead(REC_BTN) == LOW) {
    delay(30);
    if (digitalRead(REC_BTN) == LOW && nPoses < MAX_POSES) {
      for (int i = 0; i < N_SERVO; i++) poses[nPoses][i] = current[i];
      nPoses++;
      while (digitalRead(REC_BTN) == LOW) {}
    }
  } else if (digitalRead(PLAY_BTN) == LOW) {
    delay(30);
    if (digitalRead(PLAY_BTN) == LOW) {
      while (digitalRead(PLAY_BTN) == LOW) {}
      for (int p = 0; p < nPoses; p++) blendTo(poses[p]);
    }
  } else {
    for (int i = 0; i < N_SERVO; i++) current[i] = potAngle(i);
    setAll();
    delay(15);
  }
}

Writing the starting angle before attaching each servo stops the arm lurching at power-up. After playback the arm stays at the last pose and live mode takes over with a jump to the potentiometer positions, so line the pots up with the last pose or expect a quick move. The sketch has been proofread but not compiled on this site.

Test plan

  1. One servo at a time: run each joint alone with the horn off, to set the centre and range.
  2. Calibration: mark safe angle limits for each joint so the arm never hits its own frame.
  3. Record and replay: record three poses, replay them, and compare where the arm ends up with where you left it.
  4. Smoothness: change STEPS and STEP_MS and feel how the motion changes.
  5. Load: try small weights and note where the shoulder starts to sag.
  6. Power: watch for brown-outs when several joints move at once.

What usually goes wrong

SymptomLikely causeFix
Uno resets during movesServos on the Uno 5 VUse the separate 3 A supply
Arm jumps at start-upServos attached before a starting angle was writtenWrite the angle first, then attach
Shoulder cannot liftToo much load or a weak servoLighten the load or use a stronger servo
Playback differs from the recorded poseServo lag under loadSlow the blend or add a pause per pose
Gripper buzzesSqueezing against a stopLimit the gripper range

Upgrades

  • Save poses in EEPROM: keep a sequence through power-off.
  • Inverse kinematics: move to coordinates instead of angles, as in the two-link arm worksheet.
  • Speed per pose: store a speed value with each pose.
  • Serial control: send poses from a PC.

Cost and parts notes

The ₹2,200 total is an illustration and does not include shipping. Use the cost calculator to compare sellers.

Common questions

How is this like industrial teaching?

Many industrial robots are taught by moving them to positions and recording each as a pose. This does the same on a very small scale.

How much can it lift?

Very little. A small servo arm usually manages a few tens of grams.

Why blend between poses?

Jumping would be violent and could strip the gears.

Can poses survive a restart?

Not as written; the upgrades list shows how to store them in EEPROM.

Last reviewed: November 2026. This is a design worksheet with illustrative costs. It has not been bench-tested by this site; library names, pins and limits must be checked against your board and the current library versions, and measurements from your build are welcome.

More builds

Next builds to try

Free: the final-year project pack

A shortlist with BOMs, a report outline that matches the usual chapter scheme, a costing sheet and 40 viva questions. Built for the February–April submission season.

The Build Note

One short email when something is worth your bench time.

A new build sheet, a part price that moved, or a mistake worth avoiding. No daily drip, no recycled news.

One short email when a build or a price is worth your time. Unsubscribe in one click.