Building a 6-DOF robot arm with servo motors and Arduino is one of the most rewarding robotics projects you can undertake. A six degree-of-freedom arm can reach any point in its workspace and orient its gripper in any direction, mimicking the capabilities of industrial robotic arms. This guide walks you through the complete build process — from selecting servos and printing or buying the frame, to wiring, programming inverse kinematics basics, and creating pick-and-place routines.
Understanding Degrees of Freedom
Each degree of freedom (DOF) represents one axis of independent motion. A 6-DOF arm has six joints, each controlled by its own servo motor:
- Joint 1 — Base Rotation: Rotates the entire arm left and right (yaw). Uses the strongest servo as it bears the weight of the entire arm.
- Joint 2 — Shoulder: Tilts the upper arm forward and backward. Second-heaviest load bearing joint.
- Joint 3 — Elbow: Bends the forearm up and down. Moderate torque requirement.
- Joint 4 — Wrist Rotation: Rotates the wrist assembly. Lower torque needed.
- Joint 5 — Wrist Pitch: Tilts the gripper up and down. Lower torque needed.
- Joint 6 — Gripper: Opens and closes to grasp objects. Smallest servo is sufficient.
Components and Tools Needed
Electronics
- Arduino Uno or Mega
- PCA9685 16-channel servo driver board
- 6 servo motors (see selection guide below)
- 5V 5A power supply for servos
- Jumper wires
- 2x potentiometers (for manual control)
- Joystick module (optional, for intuitive control)
Mechanical
- Robot arm frame kit (acrylic, aluminium, or 3D printed)
- Servo mounting brackets and horns
- M3 screws, nuts, and standoffs
- Gripper mechanism
Servo Selection for Each Joint
The most critical decision in building a robot arm is choosing the right servo for each joint. Torque requirements decrease from the base to the gripper.
| Joint | Min Torque | Recommended Servo | Why |
|---|---|---|---|
| Base Rotation | 15+ kg-cm | 20KG or 25KG Digital Servo | Supports entire arm weight |
| Shoulder | 15+ kg-cm | 20KG Digital Servo | Lifts the forearm and payload |
| Elbow | 10+ kg-cm | MG996R (13 kg-cm) | Bends forearm with payload |
| Wrist Rotation | 5+ kg-cm | MG996R or MG995 | Rotates light wrist assembly |
| Wrist Pitch | 3+ kg-cm | MG90S or MG996R | Tilts gripper |
| Gripper | 1+ kg-cm | SG90 or MG90S | Open/close only, light load |
Assembly and Mechanical Build
Whether you are using a kit or 3D printing your own parts, follow these assembly principles:
- Start from the base. Mount the base rotation servo firmly on a heavy, stable platform. A wooden board or aluminium plate works well.
- Build upward joint by joint. Attach each servo bracket and link before moving to the next joint.
- Centre all servos before assembly. Send a 90-degree command to each servo before attaching the horns. This ensures you have equal range in both directions.
- Use metal servo horns for the base and shoulder joints. Plastic horns strip under load.
- Secure all screws with threadlocker to prevent loosening from vibration.
- Route wires neatly along the arm links using cable ties. Ensure wires have enough slack to accommodate full joint movement without snagging.
Wiring with PCA9685
Wiring Diagram Description
- Arduino SDA (A4) → PCA9685 SDA
- Arduino SCL (A5) → PCA9685 SCL
- Arduino 5V → PCA9685 VCC
- Arduino GND → PCA9685 GND
- External 5-6V power supply → PCA9685 V+ terminal (servo power)
- External PSU ground → PCA9685 GND terminal
- Base servo signal → PCA9685 channel 0
- Shoulder servo → channel 1
- Elbow servo → channel 2
- Wrist rotation → channel 3
- Wrist pitch → channel 4
- Gripper servo → channel 5
Basic Joint Control Code
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// Servo pulse range (calibrate for your servos)
#define SERVOMIN 125
#define SERVOMAX 575
// Joint channels on PCA9685
#define BASE 0
#define SHOULDER 1
#define ELBOW 2
#define WRIST_R 3
#define WRIST_P 4
#define GRIPPER 5
// Convert angle (0-180) to PCA9685 pulse
int angleToPulse(int angle) {
return map(angle, 0, 180, SERVOMIN, SERVOMAX);
}
void setJoint(int channel, int angle) {
pwm.setPWM(channel, 0, angleToPulse(angle));
}
// Smooth movement function
void moveSmooth(int channel, int startAngle, int endAngle, int stepDelay) {
if (startAngle < endAngle) {
for (int a = startAngle; a = endAngle; a--) {
setJoint(channel, a);
delay(stepDelay);
}
}
}
void setup() {
pwm.begin();
pwm.setPWMFreq(50);
Serial.begin(9600);
// Home position
setJoint(BASE, 90);
setJoint(SHOULDER, 90);
setJoint(ELBOW, 90);
setJoint(WRIST_R, 90);
setJoint(WRIST_P, 90);
setJoint(GRIPPER, 90); // Open
delay(1000);
}
void loop() {
// Simple pick-and-place sequence
Serial.println("Moving to pick position...");
moveSmooth(BASE, 90, 45, 15);
moveSmooth(SHOULDER, 90, 60, 15);
moveSmooth(ELBOW, 90, 120, 15);
moveSmooth(WRIST_P, 90, 110, 15);
// Close gripper
Serial.println("Gripping...");
moveSmooth(GRIPPER, 90, 30, 10);
delay(500);
// Lift
moveSmooth(SHOULDER, 60, 90, 15);
moveSmooth(ELBOW, 120, 90, 15);
// Rotate to place position
moveSmooth(BASE, 45, 135, 15);
// Lower
moveSmooth(SHOULDER, 90, 60, 15);
moveSmooth(ELBOW, 90, 120, 15);
// Release
Serial.println("Releasing...");
moveSmooth(GRIPPER, 30, 90, 10);
delay(500);
// Return home
moveSmooth(SHOULDER, 60, 90, 15);
moveSmooth(ELBOW, 120, 90, 15);
moveSmooth(BASE, 135, 90, 15);
delay(3000);
}
Inverse Kinematics Basics
Inverse kinematics (IK) is the mathematical process of calculating joint angles from a desired end-effector (gripper) position. Instead of manually setting each joint angle, you specify “move the gripper to X=15, Y=10, Z=20 centimetres” and the IK solver computes the required angles.
Simplified 2D IK for a 2-Link Arm
For a two-link planar arm (shoulder + elbow), the IK equations use basic trigonometry:
// 2D Inverse Kinematics for shoulder + elbow
// L1 = upper arm length (cm), L2 = forearm length (cm)
// x, y = target position relative to shoulder
float L1 = 15.0; // Upper arm length in cm
float L2 = 15.0; // Forearm length in cm
void calculateIK(float x, float y, float &shoulderAngle, float &elbowAngle) {
float dist = sqrt(x * x + y * y);
// Check if target is reachable
if (dist > (L1 + L2) || dist < abs(L1 - L2)) {
Serial.println("Target unreachable!");
return;
}
// Elbow angle using law of cosines
float cosElbow = (L1*L1 + L2*L2 - dist*dist) / (2 * L1 * L2);
elbowAngle = acos(cosElbow) * 180.0 / PI;
// Shoulder angle
float alpha = atan2(y, x);
float beta = acos((L1*L1 + dist*dist - L2*L2) / (2 * L1 * dist));
shoulderAngle = (alpha + beta) * 180.0 / PI;
}
Full 6-DOF IK is more complex and typically uses the Denavit-Hartenberg convention or iterative solvers. For hobby projects, the fabrik (Forward And Backward Reaching Inverse Kinematics) algorithm is popular as it is intuitive and easy to implement.
Frequently Asked Questions
How much weight can a 6-DOF servo robot arm lift?
With standard hobby servos (MG996R + 20KG servos), expect a payload capacity of 100-300 grams at full arm extension. The closer the object is to the base, the more weight the arm can handle. Industrial robot arms lift kilograms to tonnes, but they use much more powerful actuators.
Can I control the arm with a joystick?
Yes. Use two joystick modules — one for X/Y positioning (base rotation and forward/back reach) and one for Z height and gripper control. Map joystick analog values to servo angles or use inverse kinematics for cartesian control.
Why do my servos jitter when the arm is under load?
Insufficient power supply is the most common cause. Multiple high-torque servos under load can draw 5-10A combined. Use a dedicated 5-6V power supply rated for at least 2A per servo. Never power servos from the Arduino’s 5V pin.
Should I use Arduino Uno or Mega for a robot arm?
With a PCA9685 servo driver, an Arduino Uno is sufficient since all servo control happens over I2C (just two pins). Use an Arduino Mega if you also need many sensors, a display, and Bluetooth/WiFi modules connected simultaneously.
Is 3D printing or buying a kit better for the arm frame?
Buying a kit is faster and more consistent. 3D printing gives you full customisation. For beginners, a kit is recommended. Once you understand the mechanics, design your own arm for specific applications.
Conclusion
A 6-DOF robot arm is a fantastic project that teaches servo control, mechanical design, kinematics, and programming. Start with basic joint-by-joint control, then progress to coordinated movements and inverse kinematics. The combination of high-torque servos, a PCA9685 driver, and Arduino makes this project accessible and affordable in India.
Find all the servos, brackets, and electronics you need at Zbotic.in and start building your robot arm today.
Add comment