Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Robotics & DIY

Robotic Arm Control with Servo Motors & Joystick Tutorial

Robotic Arm Control with Servo Motors & Joystick Tutorial

March 11, 2026 /Posted byJayesh Jain / 0

Building a robotic arm servo joystick arduino project is one of the most satisfying ways to learn about multi-axis motion control, servo mechanics, and real-time input processing. A joystick-controlled robotic arm mimics industrial pick-and-place machines, delta robots, and even surgical robots — all at a fraction of the cost. This tutorial takes you from zero to a fully functional 4-DOF robotic arm you can control with two analog joysticks, all with components sourced from within India.

Table of Contents

  1. Understanding Degrees of Freedom (DOF)
  2. Components You Need
  3. Choosing the Right Servo Motors
  4. Assembling the Robotic Arm
  5. Joystick & Servo Wiring
  6. Arduino Code: Joystick to Servo Mapping
  7. Advanced Features: Position Memory & Smooth Motion
  8. Real-World Applications
  9. FAQ

Understanding Degrees of Freedom (DOF)

A robotic arm’s capability is defined by its degrees of freedom — the number of independent axes it can move along. More DOF means more flexibility in positioning the end effector (gripper) in 3D space:

  • 1-DOF: A simple rotating arm that sweeps in one plane. Like a boom gate.
  • 2-DOF: Shoulder + elbow. Reaches anywhere in a 2D plane at a fixed height.
  • 3-DOF: Adds a rotating base (waist). Now reaches anywhere in 3D space within its reach envelope.
  • 4-DOF: Adds wrist rotation or tilt. The gripper can approach an object from different angles.
  • 5-DOF and 6-DOF: Full industrial arm capability. Any position and orientation in space.

For this tutorial, we’ll build a 4-DOF arm: waist rotation + shoulder + elbow + wrist pitch. A gripper adds the 5th axis. Two analog joysticks (4 axes total) map directly to these 4 joints, making this an intuitive and satisfying build.

Components You Need

Component Qty Notes
Arduino Uno or Mega 1 Mega recommended for 6+ servos
MG996R Servo Motors (base, shoulder) 2 High torque for heavier joints
SG90 / MG90S Servo Motors (elbow, wrist) 2–3 Lighter joints need less torque
Acrylic Robotic Arm Kit or 3D printed frame 1 Pre-cut acrylic kits save hours
Analog Joystick Modules (KY-023) 2 Each gives X+Y axis + button
PCA9685 16-Channel PWM Driver 1 Offloads servo control from Arduino
5V 5A Power Supply (for servos) 1 Never power servos from Arduino 5V!
Servo Brackets / Horn Mounts 1 set For arm joint construction
DIY Acrylic Robot Manipulator Mechanical Arm Kit

DIY Acrylic Robot Manipulator Mechanical Arm Kit

A pre-cut acrylic kit for building a multi-DOF robot arm. Includes all structural pieces — just add your servo motors and Arduino. Saves hours of fabrication time.

View on Zbotic

Choosing the Right Servo Motors

Servo selection is the most important mechanical decision in a robotic arm build. The wrong servo creates a floppy, unreliable arm. Here’s how to choose:

Torque calculation: The torque required at each joint depends on the weight of all components beyond that joint and their distance from the joint (lever arm). For example, if your elbow joint must support a 200g forearm + wrist + gripper assembly at a 15cm lever arm:
Torque = 200g × 15cm = 3000 g-cm = 3 kg-cm

Always add a 2× safety margin. So the elbow servo needs at least 6 kg-cm of torque.

SG90 (9g, 1.8 kg-cm): Only for the lightest joints — wrist tilt, gripper finger. Do not use for shoulder or base on anything except the lightest foam/cardboard arms.

MG90S (13.4g, 2.2 kg-cm, metal gear): Suitable for elbow and wrist on medium arms. Metal gears are essential — plastic gears strip under load.

MG996R (55g, 10–13 kg-cm): The workhorse for robotic arms. Use for base (waist rotation) and shoulder on arms up to 500g total weight. Metal gears, ball bearings, robust.

DS3225 (25 kg-cm, 270° range): For larger arms or when working with heavier payloads. Extended rotation range is useful for base joints.

TowerPro SG90 Servo Motor

TowerPro SG90 180 Degree Rotation Servo Motor

The TowerPro SG90 is ideal for lightweight arm joints — wrist tilt and gripper control. 180° range, 9g weight, and direct Arduino compatibility via the Servo library.

View on Zbotic

Servo Mount Holder Bracket For SG90/MG90

Servo Mount Holder Bracket for SG90/MG90 – Pack of 2

Metal servo mount brackets for building robot arm joints. Compatible with SG90 and MG90S servos. Rigid construction prevents flex that causes arm instability.

View on Zbotic

Assembling the Robotic Arm

Whether you’re using a pre-cut acrylic kit or 3D-printed parts, the assembly logic is the same. Start from the base and work upward:

  1. Base plate: Mount the first MG996R servo vertically at the center of the base plate. Its horn will rotate the entire arm. Use M3 bolts and lock nuts — vibration will loosen screws over time.
  2. Waist link: Attach the arm’s first link to the base servo horn. This link connects the base rotation servo to the shoulder servo.
  3. Shoulder joint: Mount the second MG996R horizontally on the waist link. Its horn connects to the upper arm link. Keep the servo axis aligned exactly with the joint center — misalignment causes binding.
  4. Upper arm + elbow: The upper arm link spans from shoulder to elbow. The elbow servo (MG90S or SG90) is at the far end, connecting to the forearm link.
  5. Forearm + wrist: The wrist servo provides pitch (up/down tilt of the end effector). For wrist roll (rotation), you need a 5th servo.
  6. Gripper: A simple servo-driven parallel gripper is the easiest to implement. One servo moves both fingers symmetrically via a linkage or directly via servo horn.

Pro tip: Before tightening any servo into its bracket, power it up and move it to its center position (90°) first. Then mount it. This ensures the servo horn is centered in the joint’s movement range, preventing mechanical limits from cutting off half your range of motion.

Joystick & Servo Wiring

Joystick module (KY-023) pins:

  • GND → Arduino GND
  • +5V → Arduino 5V
  • VRX → Arduino A0 (X-axis, analog 0–1023)
  • VRY → Arduino A1 (Y-axis, analog 0–1023)
  • SW → Arduino Digital Pin 2 (push button, active LOW)

For two joysticks: second joystick to A2 (VRX) and A3 (VRY).

Servo power — critical warning: Never power more than one small servo from the Arduino 5V pin. For a 4-servo arm, servos draw 500mA–2A each at stall. Use a dedicated 5V 3A–5A power supply or a BEC (Battery Eliminator Circuit). Connect the servo power supply GND to Arduino GND (common ground), but connect the servo signal wires directly to Arduino digital pins 3, 5, 6, 9 (PWM-capable pins).

PCA9685 driver (recommended for 4+ servos):

  • VCC → Arduino 3.3V
  • GND → Arduino GND
  • SDA → Arduino A4
  • SCL → Arduino A5
  • V+ (power terminal) → 5V 5A supply positive
  • GND (power terminal) → Supply negative + Arduino GND

Arduino Code: Joystick to Servo Mapping

#include <Servo.h>

Servo waist, shoulder, elbow, wrist;

int waistAngle = 90, shoulderAngle = 90;
int elbowAngle = 90, wristAngle = 90;

void setup() {
  waist.attach(3);
  shoulder.attach(5);
  elbow.attach(6);
  wrist.attach(9);
  waist.write(waistAngle);
  shoulder.write(shoulderAngle);
  elbow.write(elbowAngle);
  wrist.write(wristAngle);
  delay(1000);
}

int mapJoystick(int raw) {
  // Dead zone in center, returns -1, 0, or +1
  if (raw < 400) return -1;
  if (raw > 600) return 1;
  return 0;
}

void loop() {
  int j1x = mapJoystick(analogRead(A0)); // Joystick 1 X → Waist
  int j1y = mapJoystick(analogRead(A1)); // Joystick 1 Y → Shoulder
  int j2x = mapJoystick(analogRead(A2)); // Joystick 2 X → Elbow
  int j2y = mapJoystick(analogRead(A3)); // Joystick 2 Y → Wrist

  waistAngle    = constrain(waistAngle    + j1x, 0, 180);
  shoulderAngle = constrain(shoulderAngle + j1y, 30, 150);
  elbowAngle    = constrain(elbowAngle    + j2x, 0, 180);
  wristAngle    = constrain(wristAngle    + j2y, 0, 180);

  waist.write(waistAngle);
  shoulder.write(shoulderAngle);
  elbow.write(elbowAngle);
  wrist.write(wristAngle);

  delay(15); // ~67Hz update rate
}

The joystick dead zone (400–600) prevents the arm from drifting when the joystick is at rest center. The constrain() calls enforce mechanical limits to protect the arm structure.

ACEBOTT ESP32 5-DOF Robot Arm Kit

ACEBOTT ESP32 5-DOF Robot Arm Kit Expansion Pack – QD007

A 5-DOF robot arm kit powered by ESP32 with full servo control support. Great for learning inverse kinematics and advanced arm control with Bluetooth or Wi-Fi.

View on Zbotic

Advanced Features: Position Memory & Smooth Motion

Position memory (teach and playback): Add a button (joystick SW pin) that saves the current position of all four servos into an array. A second button triggers playback of the saved positions in sequence. This is how industrial robot arms are “taught” their movements.

int positions[20][4]; // 20 positions, 4 joints each
int posCount = 0;
// On button press: positions[posCount++][0..3] = current angles
// On play: for each position, move servos there with delay

Smooth motion interpolation: Instead of jumping directly to a new angle (which causes jerky, motor-stressing movement), interpolate between current and target angles over multiple steps:

void smoothMove(Servo &servo, int &current, int target, int steps) {
  float delta = (target - current) / (float)steps;
  for (int i = 0; i < steps; i++) {
    current += delta;
    servo.write(current);
    delay(20);
  }
}

Inverse kinematics (IK): Instead of controlling each joint individually with a joystick axis, IK allows you to control the gripper’s X/Y/Z position directly. The Arduino calculates the required joint angles mathematically. For a 2-link planar arm (shoulder + elbow), the IK equations are straightforward trigonometry. 3D IK for a 4-DOF arm requires more complex math but is achievable on an Arduino Mega.

Real-World Applications

Joystick-controlled robotic arms built with Arduino are not just hobby projects — they demonstrate real engineering principles used in industry:

  • Pick and place automation: Small robotic arms sort components on PCB assembly lines. Your Arduino arm can sort lightweight objects (LEDs, small bolts) in a similar manner.
  • Remote handling (teleoperation): In nuclear plants and deep-sea exploration, human operators control arms remotely. Joystick control with position feedback is the foundation of this technology.
  • Medical robotics: Surgical robots like the da Vinci system use master-slave joystick control with scale-down motion for precision. Your project teaches the same principle.
  • Educational lab demonstrations: Many engineering colleges in India use robotic arm kits for lab experiments in mechatronics and control systems courses.
  • Competitions: Events like e-Yantra, Technoxian, and Smart India Hackathon regularly feature robotic arm challenges where teams build pick-and-place or sorting robots.

Frequently Asked Questions

How many servos do I need for a robotic arm?

A minimum of 3 servos (base, shoulder, elbow) gives you a functional 3-DOF arm. Adding wrist pitch and a gripper brings you to 5 servos. Most DIY project arms use 4–6 servos. Industrial arms use 6 for full 6-DOF capability.

Why does my servo twitch or jitter?

Servo jitter is usually caused by insufficient power supply, electrical noise on the signal wire, or PWM signal interference. Use a dedicated 5V supply for servos, add a 100µF capacitor across the servo power terminals, and keep signal wires short and away from motor power cables.

Can I control the arm with my smartphone instead of a joystick?

Yes. Replace the joystick input with Bluetooth (HC-05) or Wi-Fi (ESP8266/ESP32) and create a mobile app using MIT App Inventor or Flutter. You can even use phone accelerometer data to control the arm by tilting the phone.

What is the difference between SG90 and MG90S?

Both have similar dimensions and 1.8–2.2 kg-cm torque, but the MG90S has metal gears versus SG90’s plastic gears. For any joint that experiences significant load, always use MG90S. Plastic gears in the SG90 strip under repeated stress.

Can I use stepper motors instead of servos for a robotic arm?

Stepper motors offer better position accuracy (no feedback needed) and can hold position without power. However, they are heavier, require stepper drivers (A4988, DRV8825), and the code is more complex. For most DIY arms, servos are simpler and lighter — stepper motors are better for CNC and 3D printer axes.

Build Your Robotic Arm with Zbotic
All servo motors, brackets, arm kits, and joystick modules are available at Zbotic.in. We stock TowerPro, MG90S, MG996R, and premium acrylic arm kits — everything you need to build a capable joystick-controlled robot arm. Shop robot arm components now.
Tags: arduino servo project, DIY robot arm India, robotic arm arduino, servo joystick control, SG90 servo arm
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
SH1106 vs SSD1306: Difference ...
blog sh1106 vs ssd1306 difference between 128x64 oled drivers 597789
blog raspberry pi rover autonomous navigation with python opencv 597795
Raspberry Pi Rover: Autonomous...

Related posts

Svg%3E
Read more

Caterpillar Track Robot: Tank-Drive Build for All Terrain

April 1, 2026 0
When wheels lose grip on sand, gravel, grass, or loose surfaces, caterpillar tracks keep moving. A tank-track robot distributes its... Continue reading
Svg%3E
Read more

RC Car to Robot: Convert a Toy Car into an Autonomous Robot

April 1, 2026 0
That old RC toy car gathering dust can be transformed into an Arduino-controlled autonomous robot with just a few electronic... Continue reading
Svg%3E
Read more

Robotic Arm Kit India: Best Options for Students and Hobbyists

April 1, 2026 0
If you are a student or hobbyist looking to get into robotics, a robotic arm kit is one of the... Continue reading
Svg%3E
Read more

Sumo Robot: Competition Build Guide India

April 1, 2026 0
Sumo robot competitions are among the most exciting events in Indian robotics, pitting small autonomous robots against each other in... Continue reading
Svg%3E
Read more

Robot Arm Build: 6-DOF Servo Arm with Arduino Control

April 1, 2026 0
Building a 6-DOF robot arm with servo motors and Arduino is one of the most rewarding robotics projects you can... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now