Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

instructables

Arduino Robot Arm (TfCD)

by TimoL7

This is just a simple robot arm made out of readily movements of the robot can be saved and repeated
available materials and instruments, such as micro in a loop. The project is just a start for more
servos, cardboard, and hot glue. With this technology understanding and knowledge about Arduino. So if
we want to show that with readily available products you want to add more movements or servo motors it
and materials we can make a working prototype of can easily be done.
automated technology. With 2 buttons the

Arduino Robot Arm (TfCD): Page 1


Arduino Robot Arm (TfCD): Page 2
Step 1: Getting the Right Instruments

The robot arm is controlled with an Arduino Uno, breadboard and a list of components which are shown in the list
below.

- knife - hot glue gun

- Arduino - Breadboard

- 3x servos

- 5x 221 Ohm resistance

- 2x 10K Ohm resistance

- 5x led

- 2x push button

- 3x potentiometer

- Jumpwires

Arduino Robot Arm (TfCD): Page 3


Arduino Robot Arm (TfCD): Page 4
Step 2: Lay-out Cardboard Parts

The servo motors are not the strongest motors that are available, so we use cardboard to make the robot arms,
because it’s a light and cheap material. So draw out the parts and cut them out.

Arduino Robot Arm (TfCD): Page 5


Step 3: Build the Arm

- placing the servo for the base Cut out some brackets out of the cardboard to keep the servo in its place on the
baseboard.

- cut out the other arms Use the other pieces of the cardboard to cut out the arms for the other 2 servo motors. And
place the motors in it.

- Assemble the 3 servos to create the motor arm. In this project we used only 3 servo motors, but it can be
improved by adding more servos.

Arduino Robot Arm (TfCD): Page 6


Arduino Robot Arm (TfCD): Page 7
Step 4: Build the Breadboard

In order to control the robot arm we just made we need to hook up the arduino system. Here we show you the
schematics for the breadboard, included with the list of materials needed.

Arduino Robot Arm (TfCD): Page 8


Step 5: Programming

The arduino code that we provide you with is for pot2Val = analogRead(pot2); pot2Angle =
controlling 3 servos and program 5 movements. The map(pot2Val, 0, 1023, 0, 179); pot3Val =
code is build in a way you can add more servos and analogRead(pot3); pot3Angle = map(pot3Val, 0,
also more movements. 1023, 0, 179); servo1.write(pot1Angle); // These will
make the servos move to the mapped angles
code: servo2.write(pot2Angle); servo3.write(pot3Angle);
if(digitalRead(button1) == HIGH){ // This will check
Servo servo1; //Servos Servo servo2; Servo servo3; how many times button1 is pressed and save the
positions to an array depending on how many times it
const int LED1 = 2; //LEDs const int LED2 = 3; const is pressed; switch/case works like a if statement
int LED3 = 4; const int LED4 = 7; const int LED5 = 8; button1Presses++; switch(button1Presses){ case 1:
servo1PosSaves[0] = pot1Angle; servo2PosSaves[0]
const int button1 = 12; //Buttons const int button2 = = pot2Angle; servo3PosSaves[0] = pot3Angle;
13; digitalWrite(LED1, HIGH); Serial.println("Pos 1
Saved"); break; case 2: servo1PosSaves[1] =
int button1Presses = 0; //Button values boolean pot1Angle; servo2PosSaves[1] = pot2Angle;
button2Pressed = false; servo3PosSaves[1] = pot3Angle; digitalWrite(LED2,
HIGH); Serial.println("Pos 2 Saved"); break; case 3:
const int pot1 = A0; //Potentimeters const int pot2 = servo1PosSaves[2] = pot1Angle; servo2PosSaves[2]
A1; const int pot3 = A2; = pot2Angle; servo3PosSaves[2] = pot3Angle;
digitalWrite(LED3, HIGH); Serial.println("Pos 3
int pot1Val; //Potentimeter values int pot2Val; int Saved"); break; case 4: servo1PosSaves[3] =
pot3Val; int pot1Angle; int pot2Angle; int pot3Angle; pot1Angle; servo2PosSaves[3] = pot2Angle;
servo3PosSaves[3] = pot3Angle; digitalWrite(LED4,
int servo1PosSaves[] = {1,1,1,1,1}; //position saves HIGH); Serial.println("Pos 4 Saved"); break; case 5:
int servo2PosSaves[] = {1,1,1,1,1}; int servo1PosSaves[4] = pot1Angle; servo2PosSaves[4]
servo3PosSaves[] = {1,1,1,1,1}; = pot2Angle; servo3PosSaves[4] = pot3Angle;
digitalWrite(LED5, HIGH); Serial.println("Pos 5
void setup() { servo1.attach(5); // Set up everything Saved"); break; } }
and will run once; attach servos and define the pin
modes servo2.attach(6); servo3.attach(9); if(digitalRead(button2) == HIGH){ // Pretty self-
pinMode(LED1, OUTPUT); pinMode(LED2, explnatory here button2Pressed = true; }
OUTPUT); pinMode(LED3, OUTPUT); if(button2Pressed){ // if the boolean button2Press is
pinMode(LED4, OUTPUT); pinMode(LED5, true, then the servos will run though all their saved
OUTPUT); pinMode(button1, INPUT); positions for(int i = 0; i < 5; i++){
pinMode(button2, INPUT); servo1.write(servo1PosSaves[i]);
servo2.write(servo2PosSaves[i]);
Serial.begin(9600); } servo3.write(servo3PosSaves[i]); Serial.println("
potentimeter Angles: ");
void loop() { // put your main code here, to run Serial.println(servo1PosSaves[i]);
repeatedly: pot1Val = analogRead(pot1); // This will Serial.println(servo2PosSaves[i]);
read the values from the potentimeters and store it... Serial.println(servo3PosSaves[i]); delay(1050); } }
pot1Angle = map(pot1Val, 0, 1023, 0, 179); // ... and delay(300); }
this will map the values from the potentiometers to
values the servos can use and store it for later use

Arduino Robot Arm (TfCD): Page 9


http://www.instructables.com/ORIG/FUE/51GT/JBGTZ50C/FUE51GTJBGTZ50C.ino
… Download (https://cdn.instructables.com/ORIG/FUE/51GT/JBGTZ50C/FUE51GTJBGTZ50C.ino)

(https://cdn.instructables.com/ORIG/FUE/51GT/JBGTZ50C/FUE51GTJBGTZ50C.ino)

Step 6: Installing the Movements

The left button is for saving a movement, the right one is to start the process after adding all the movements. With
the 3 different potentiometers you can control the 3 servo motors, by turning the potentiometers the servo to which
it’s connected will move. Save your movements and you have a working robot arm.

Arduino Robot Arm (TfCD): Page 10

You might also like