
Surely many of you have seen in science fiction movies how the scientist or geek has a robotic arm that controls everything and that can pick up objects or perform functions as if it were a human person. Something that is becoming more and more possible thanks to Free Hardware and the Arduino Project. But what is a robotic arm? What functions does this gadget have? How is a robotic arm built? Next we are going to answer all these questions.
What is a robotic arm
A robotic arm is a mechanical arm with an electronic base that allows it to be fully programmable . This type of arm can be a standalone device or part of a robot or other robotic system. The key difference between a robotic arm and other mechanical components is its programmability. This capability allows a single robotic arm to perform a variety of operations and tasks, which can be accomplished using electronic boards such as Arduino boards.
Functions of a robotic arm
Possibly the most basic function of a robotic arm is the auxiliary arm function. In some operations we will need a third arm that supports some element so that a person can build or create something. For this function no special programming is needed and we will only need to turn off the device itself.
Robotic arms can be constructed from a variety of materials, allowing us to use them as a substitute for performing hazardous operations such as handling hazardous chemicals. A robotic arm can also assist us in carrying out heavy tasks or those requiring specific pressure, provided it is built from a strong and durable material.
Materials needed for its construction
Next, we'll show you how to build a robotic arm quickly, easily, and affordably. However, this robotic arm won't be as powerful or useful as the ones we see in movies; instead, it will serve as a learning tool for understanding how they work and how to build them. The materials you'll need to build this device are :
- A plate Arduino UNO REV3 or higher.
- Two development boards.
- Two axis servos in parallel
- Two micro servos
- Two analog controls in parallel
- Jumper cables for development boards.
- Tape
- Cardboard or foam board for the stand.
- A cutter and scissors.
- Much patience.
Assembly
The assembly of this robotic arm is quite simple. First we have to cut out two rectangles with the foam; each of these rectangles will be parts of the robotic arm. As you can see in the images, these rectangles will have to be the size we want, although it is recommended that the size of one of them is 16,50 x 3,80 cm. and the second rectangle has the following size 11,40 x 3,80 cm.
Once we have the rectangles, we'll tape each servo motor to one end of each rectangle or strip. After doing this, we'll cut a "U" shape out of foam . This will serve as the attachment point or end piece of the arm, which would be the hand for a human. We'll attach this piece to the servo motor on the smaller rectangle.
Now we need to make the bottom part or base. To do this, we will follow the same procedure: we will cut out a square of foam and place the two parallel-axis servomotors as shown in the following image :
Now we need to connect all the motors to the Arduino board. But first, we need to connect the connections to the development board and then connect the development board to the Arduino. We'll connect the black wire to the GND pin, the red wire to the 5V pin, and the yellow wires to -11, -10, 4, and -3 . We'll also connect the joysticks or controls for the robotic arm to the Arduino board, as shown in the image:
Once everything is connected and assembled, we need to transfer the program to the Arduino board. To do this, we'll need to connect the Arduino board to the computer or laptop. After transferring the program to the Arduino board, we must ensure the wires are connected. However, we can always continue with the development board and disassemble everything , especially if we only want to learn.
Software required for operation
Although it seems that we have finished building a robotic arm, the truth is that there is still a lot ahead and the most important thing. Creating or developing a program that gives life to our robotic arm since without it, the servomotors would not stop being simple clock mechanisms that spin without meaning.
This is solved by connecting the Arduino board to our computer and opening the Arduino IDE program , connecting the computer to the board and writing the following code in a blank file:
#include <Servo.h>
const int servo1 = 3; // first servo
const int servo2 = 10; // second servo
const int servo3 = 5; // third servo
const int servo4 = 11; // fourth servo
const int servo5 = 9; // fifth servo
const int joyH = 2; // L/R Parallax Thumbstick
const int joyV = 3; // U/D Parallax Thumbstick
const int joyX = 4; // L/R Parallax Thumbstick
const int joyP = 5; // U/D Parallax Thumbstick
const int potpin = 0; // O/C potentiometer
int servoVal; // variable to read the value from the analog pin
Servo myservo1; // create servo object to control a servo
Servo myservo2; // create servo object to control a servo
Servo myservo3; // create servo object to control a servo
Servo myservo4; // create servo object to control a servo
Servo myservo5; // create servo object to control a servo
void setup() {
// Servo
myservo1.attach(servo1); // attaches the servo
myservo2.attach(servo2); // attaches the servo
myservo3.attach(servo3); // attaches the servo
myservo4.attach(servo4); // attaches the servo
myservo5.attach(servo5); // attaches the servo
// Inizialize Serial
Serial.begin(9600);
}
void loop(){
servoVal = analogRead(potpin);
servoVal = map(servoVal, 0, 1023, 0, 179);
myservo5.write(servoVal);
delay(15);
// Display Joystick values using the serial monitor
outputJoystick();
// Read the horizontal joystick value (value between 0 and 1023)
servoVal = analogRead(joyH);
servoVal = map(servoVal, 0, 1023, 0, 180); // scale it to use it with the servo (result between 0 and 180)
myservo2.write(servoVal); // sets the servo position according to the scaled value
// Read the horizontal joystick value (value between 0 and 1023)
servoVal = analogRead(joyV);
servoVal = map(servoVal, 0, 1023, 70, 180); // scale it to use it with the servo (result between 70 and 180)
myservo1.write(servoVal); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
// Read the horizontal joystick value (value between 0 and 1023)
servoVal = analogRead(joyP);
servoVal = map(servoVal, 0, 1023, 70, 180); // scale it to use it with the servo (result between 70 and 180)
myservo4.write(servoVal); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
// Read the horizontal joystick value (value between 0 and 1023)
servoVal = analogRead(joyX);
servoVal = map(servoVal, 0, 1023, 70, 180); // scale it to use it with the servo (result between 70 and 180)
myservo3.write(servoVal); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
/**
* Display joystick values
*/
void outputJoystick(){
Serial.print(analogRead(joyH));
Serial.print ("---");
Serial.print(analogRead(joyV));
Serial.println ("----------------");
Serial.print(analogRead(joyP));
Serial.println ("----------------");
Serial.print(analogRead(joyX));
Serial.println ("----------------");
}
We save it and after that we send it to the plate Arduino UNO. Before finishing with the code we will carry out the pertinent tests to verify that the joysticks work and that the code does not present any errors.
I already have it mounted, now what?
Many of you probably weren't expecting this type of robotic arm, but it's ideal because of its simplicity, low cost, and the way it teaches you how to build a robot. From there, it's all up to your imagination. You can change the materials, the servomotors, and even customize the programming code. Needless to say, you can also replace the Arduino board with a more powerful and complete model that allows you to connect a remote control or operate it with a smartphone. In short, open-source hardware and robotic arms offer a wide range of possibilities.
More Information – Instructables
Table of Contents



