Robotic Arm - mako

Mako
Mako
nome
Go to content
Arduino > Projects

Arduino Robotic Arm

About the project


The ARA (Arduino Robotic Arm) is an initial project, a first phase, of one of the most popular project carried out by the Arduino community. It is made up of salvaged pieces of wood and four servo motors (and an Arduino board obviously), controlled via eight buttons to control the angles of the servos.

Let's start from the structure:
A few pices of a porouse and light wood were used for the structure of the arm. The servos are really small (9g) and the load that they can move is limited, so the arm needs to be light and contained.
A dremmel to create the joints to embed the servos into the wood tablets, and some glue to fix everything.

Now the most intresting part: the plier!
A thin wire is tied at one end to the last servo and the other to a cable tie. The wire reaches both ends of the cable tie and when the servo turns on the latter bends to create a plier.
Is racommended to put a pice of a ahdesive material on the ends of the cable tie in order to have a better grip.

Circuit Diagram
The schematic is a bit confusing, but really simple when understood. The buttons are connected to the pins 2, 3, 4, 5, 6, 7, 10, 11. Every servo has two buttons, one to move right, one to move left. The servos accurancy is 5 degrees, so if you push the left button, the servo moves left 5 degrees. This angle step can be changed in the 3rd block of the sketch (angle step = 5) by changing the number after the variable.
Every button has also a 1000 ohm resistor, this resistor is for better accurancy, accidentally touches or interferences will not be detected, the servos move only when the buttons are pressed.

Conclusions
This first version of the Arduino Robotic Arm is just a beginner version, it is really cheap and inaccurate. The method used to move the arm is unconfortable and it doesnot allow to for good control of the arm. However it was really fun and satisfyng build, assemby and program it. There will probably be a more accurate and advanced version of the same project soon, stay tuned!


The sketch

#include <Servo.h>

Servo myservo;   // create 4 servo objects to control the servos
Servo myservo1;
Servo myservo2;
Servo myservo3;

int angle = 90; // initial angle  for servo
int angle1 = 90;
int angle2 = 90;
int angle3 = 90;
int angleStep = 5;

#define LEFT 10   // pin 10 is connected to left button
#define RIGHT  11  // pin 11 is connected to right button
#define LEFT1 2 // pin 2 is connected to right button
#define RIGHT1 3 // pin 3 is connected to right button
#define LEFT2 6 // pin 6 is connected to right button
#define RIGHT2 7 // pin 7 is connected to right button
#define RIGHT3 4 // pin 4 is connected to right button
#define LEFT3 5 // pin 5 is connected to right button

void setup() {
 Serial.begin(9600);  //  setup serial
 myservo.attach(8);  // attaches the servo on pin 9 to the servo object
 myservo1.attach(9);
 myservo2.attach(12);
 myservo3.attach(13);
 pinMode(LEFT, INPUT_PULLUP); // assign pins as input left button
pinMode(RIGHT, INPUT_PULLUP); // assing pins as input for right button
pinMode(LEFT1, INPUT_PULLUP);
pinMode(RIGHT1, INPUT_PULLUP);
pinMode(LEFT2, INPUT_PULLUP);
pinMode(RIGHT2, INPUT_PULLUP);
pinMode(LEFT3, INPUT_PULLUP);
pinMode(RIGHT3, INPUT_PULLUP);
 
myservo.write(angle); // send servo to the middle at 90 degrees
myservo1.write(angle1); // send servo to the middle at 90 degrees
myservo1.write(angle2); // send servo to the middle at 90 degrees
myservo1.write(angle3); // send servo to the middle at 90 degrees
    
}

void loop() {
////////////////////////////////////////////////////////////////////////
 while(digitalRead(RIGHT) == LOW){

   if (angle > 0 && angle <= 180) {
     angle = angle - angleStep;
      if(angle < 0){
       angle = 0;
      }
else{
     myservo.write(angle); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
while(digitalRead(LEFT) == LOW){
   if (angle >= 0 && angle <= 180) {
     angle = angle + angleStep;
     if(angle >180){
       angle =180;
      }
 else{
     myservo.write(angle); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
 while(digitalRead(RIGHT1) == LOW){

   if (angle1 > 0 && angle1 <= 180) {
     angle1 = angle1 - angleStep;
      if(angle1 < 0){
       angle1 = 0;
      }else{
     myservo1.write(angle1); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
 while(digitalRead(LEFT1) == LOW){

   if (angle1 >= 0 && angle1 <= 180) {
     angle1 = angle1 + angleStep;
     if(angle1 >180){
       angle =180;
      }else{
     myservo1.write(angle1); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
 while(digitalRead(RIGHT2) == LOW){

   if (angle2 > 0 && angle2 <= 180) {
     angle2 = angle2 - angleStep;
      if(angle2 < 0){
       angle2 = 0;
      }
 else{
     myservo2.write(angle2); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
 while(digitalRead(LEFT2) == LOW){

   if (angle2 >= 0 && angle2 <= 180) {
     angle2 = angle2 + angleStep;
     if(angle2 >180){
       angle =180;
      }
 else{
     myservo2.write(angle2); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
 while(digitalRead(RIGHT3) == LOW){

   if (angle3 > 0 && angle3 <= 180) {
     angle3 = angle3 - angleStep;
      if(angle3 < 0){
       angle3 = 0;
      }
 else{
     myservo3.write(angle3); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
////////////////////////////////////////////////////////////////////////
 while(digitalRead(LEFT3) == LOW){

   if (angle3 >= 0 && angle3 <= 180) {
     angle3 = angle3 + angleStep;
     if(angle3 >180){
       angle =180;
      }
 else{
     myservo3.write(angle3); // move the servo to desired angle
      }
   }
   
 delay(50); // waits for the servo to get there
 }
}
3.5 / 5
2 reviews
1
0
0
1
0

Andy Van Bloom
28 Feb 2021
Very nice!!
1 2 Next
Back to content