Introduction: DIY Robotic Arm

About: Mechatronics engineer. I'm a Fab Lab Egypt team member.

you can control Robotic Arm remotely using many wire and wireless methods to do many tasks such as holding things and can be used in a lot of medical applications like surgery and holding micro tools which can't be controlled with human arm, what gives a great accuracy, and similarly in industrial and agricultural applications.

If you think to buy a robotic arm, it costs you about $300, but if you try to make it yourself in addition to gain more experience in fabrication, it'll cost you about $150, which means you provide almost the half, and its fabrication isn't a very hard process, so what's your choice ?

This instructable is talking about the main concept to make a robotic arm.

Let's begin and explain the steps !

Step 1: Required Components

  • 2 sheets of acrylic or wood with dimensions 30*50 cm.
  • 6 potentiometers 10k.
  • 12 push buttons.
  • 12 resistors 10k as pull down resistors.
  • Arduino UNO.
  • Breadboard.
  • Power supply in the PC.
  • some connectors.
  • Screws with diameter 3mm.
  • Gripper.

Step 2: Designing the Parts

You can design the robotic arm at any mechanical CAD software and this design at Autodesk Inventor.

First, you design each part solo to make it using some fabrication machines (laser cutter - 3D printer).

Then the assembly process to produce the final shape of the Arm.

And these are the designed parts.

The wooden parts will be made on laser cutter, and red parts on 3D printer.

These are the parts files that will be inserted in the machines from here.

Of course you can make any other design suitable for your need.

Step 3: Assembly

In this step, the construction of the body by assembling all parts installing them together to get the final shape.

The pictures explain the assembly process step by step.

Step 4: Motor Selection

There are three types of direct current motors can be used (standard DC motor - Stepper motor - Servo motor), but the best of them in this application is Servo motor because it gives a great accurate angle of rotation due to the encoder in servo that measures the difference between reference and required angle and go to the position with great accuracy, and if there is an Inertia during motion it returns to the required angle so it's a closed loop with a feedback system, in addition to its suitable price according to its torque.

When using standard DC motor, you will face two problems, (angle controlling - speed controlling), if you give the motor maximum voltage it will be very fast but unable to control the angle of rotation, and if you give small voltage to decrease the speed to overcome angle control problem the torque will be small and unable to move the required load.

When using stepper motors, the theory of its motion is to move step by step through poles, but it's not having a feedback system so if there is a lag because of inertia it won't go back to its right position.

So it's better to use servo motors in this application.

Step 5: Torque Analysis

The torque law is T=F.L and the affecting force on the robotic arm is its weight W=m.g

but when buying the motors you will find the torque unit in (kg.cm) so the law used in calculate the torque is T=m.L ,where m is the mass the part and L is the perpendicular distance from rotation axis of motor to center of gravity of the body.

To determine the required torque we choose the critical case which the weight of the body causes the biggest torque and choose motor equal to this torque, and it's preferred to give safety factor equal to 1.5 for smooth motion without vibrations.

The critical case is in horizontal position that gives the biggest perpendicular distance as shown in picture 1 and it's obvious that L3 is the biggest distance in horizontal position.

The robot arm must be in this case when calculating the torque of motors as shown in picture 2

Thenwe start to calculate the torque at each motor like picture 3 and the equations of this picture is:

T1=L1.A1+0.5L1.W1

T2=L5.A1+L4.W1+L3.A2+L6.W2

In this method we consider each motor as lumped mass and its weight is A and perpendicular distance is L , so the torque caused by motor is T=L.A

And for the torque caused by each link that has length L and mass W is T=0.5L.W , and the final torque for motor is the sum of two torques and everything that preceding of weights ( T=L.A+0.5L.W+........)

The final results of motors torques when using the wood for this design is as shown in picture 4.

Step 6: Wiring

-For controlling with potentiometers:

We use arduino UNO to control the motors to make the functionality we want.

We use potentiometers to simulate the motion of motors with the axis of shaft of potentiometer.

In wiring potentiometer connect the middle pin with input analog pin of the arduino and other pins with power (VCC - GND).

And servo motor wiring is as in picture 5

The wiring of all component with each other is as picture 6


-For controlling with push buttons:

It's preferred to use arduino Mega or two arduino UNO

We will use two push buttons for each motor, one for clockwise rotation and another for counter clockwise.

The wiring of push buttons is as picture 6 , we use pull down resistor to avoid noise.

The wiring of push buttons and motor with arduino is as picture 7 and by the same way connect the other motors and push buttons.

-Important notes:

You must connect all motors with an external power source like PC power supply because the motors consume current more than arduino board current to avoid the damage of the board.

The circuit must have a common GROUND to work correctly, that means you have to connect the ground of arduino with the ground of external source.

Step 7: The Programming

you must download Arduino IDE software to write the code and upload it to the board.

-For controlling with potentiometers:

Before programming you must know that the range of rotation of potentiometer is 250 degree so when ADC(analog to digital convert) we convert the range of analog input (0:1023) to potentiometer range (0:250) (not to motor range) to run the motor correctly.

And the cod is:

#include <Servo.h>

Servo myservo1; Servo myservo2; Servo myservo3; Servo myservo4; Servo myservo5; Servo myservo6;

int potpin = A0; int potpin1 = A1; int potpin2 = A2; int potpin3 = A3; int potpin4 = A4; int potpin5 = A5; int val;

void setup() { myservo1.attach(3); myservo2.attach(5); myservo3.attach(9); myservo4.attach(10); myservo5.attach(11); myservo6.attach(6); }

void loop() { val = analogRead(potpin); val = map(val, 0, 1023, 0, 250); myservo1.write(val); delay(15);

val = analogRead(potpin1); val = map(val, 0, 1023, 0, 250); myservo2.write(val); delay(15);

val = analogRead(potpin2); val = map(val, 0, 1023, 0, 250); myservo3.write(val); delay(15);

val = analogRead(potpin3); val = map(val, 0, 1023, 0, 250); myservo4.write(val); delay(15);

val = analogRead(potpin4); val = map(val, 0, 1023, 0, 250); myservo5.write(val); delay(15);

val = analogRead(potpin5); val = map(val, 0, 1023, 0, 250); myservo6.write(val); delay(15); }

-For controlling with push buttons:

The code is:

// Written By: Ahmad Saeed
#include <Servo.h> Servo baseYaw; Servo basePitch; Servo elbow; Servo wristPitch; Servo wristRoll;

int valBaseYaw = 90 ; //Initial angle int valBasePitch = 90; //Initial angle int valelbow = 90; //Initial angle int valwristPitch = 90; //Initial angle int valwristRoll = 90; //Initial angle

void setup() { baseYaw.attach(2); //Servo Pin pinMode (22, INPUT); //Clockwise pin pinMode(23, INPUT); //Counterclockwise pin

basePitch.attach(3); //Servo Pin pinMode (24, INPUT); //Clockwise pin pinMode(25, INPUT); //Counterclockwise pin

elbow.attach(4); //Servo Pin pinMode (26, INPUT); //Clockwise pin pinMode(27, INPUT); //Counterclockwise pin

wristPitch.attach(5); //Servo Pin pinMode (28, INPUT); //Clockwise pin pinMode(29, INPUT); //Counterclockwise pin

wristRoll.attach(6); //Servo Pin pinMode (30, INPUT); //Clockwise pin pinMode(31, INPUT); //Counterclockwise pin }

void loop() {

if ((digitalRead(22) == HIGH) && (valBaseYaw != 175)) { valBaseYaw = valBaseYaw + 1; //For Clockwise button } if ((digitalRead(23) == HIGH) && (valBaseYaw != 0)) { valBaseYaw = valBaseYaw - 1; //For Counterclockwise button } baseYaw.write(valBaseYaw); //Let the magic works!

if ((digitalRead(24) == HIGH) && (valBasePitch != 175)) { valBasePitch = valBasePitch + 1; //For Clockwise button } if ((digitalRead(25) == HIGH) && (valBasePitch != 0)) { valBasePitch = valBasePitch - 1; //For Counterclockwise button } basePitch.write(valBasePitch); //Let the magic works!

if ((digitalRead(26) == HIGH) && (valelbow != 175)) { valelbow = valelbow + 1; //For Clockwise button } if ((digitalRead(27) == HIGH) && (valelbow != 0)) { valelbow = valelbow - 1; //For Counterclockwise button } elbow.write(valelbow); //Let the magic works!

if ((digitalRead(28) == HIGH) && (valwristPitch != 175)) { valwristPitch = valwristPitch + 1; //For Clockwise button } if ((digitalRead(29) == HIGH) && (valwristPitch != 0)) { valwristPitch = valwristPitch - 1; //For Counterclockwise button } wristPitch.write(valwristPitch); //Let the magic works!

if ((digitalRead(30) == HIGH) && (valwristRoll != 175)) { valwristRoll = valwristRoll + 1; //For Clockwise button } if ((digitalRead(31) == HIGH) && (valwristRoll != 0)) { valwristRoll = valwristRoll - 1; //For Counterclockwise button } wristRoll.write(valwristRoll); //Let the magic works!

delay(10); // General Speed }

Step 8: The Final Shape

Have fun with your Robotic Arm.