Introduction: Cheap Programmable Arduino Robotic Arm

This is meant to be a beginner's guide to how to build an Arduino robotic arm. Its concept is to be cheap and easy to build. This is only a prototype to optimize my code, but it's perfect to get started with Arduino robotics. It is controlled by a hacked joypad, and can be programmed to repeat a sequence you set. If you aren't experienced in programming, you can make it as a hardware project, you can put in my code and use it to learn from. I repeat, it is very easy to build.

Here's a demo of my robot:

Step 1: Bill of Materials

Ok, bill of materials, what do we need?

1. Arduino board, I used UNO, but really any will do the job. Don't hesitate on buying Arduino copies. They work really well!

2. Servo motors, four of the cheapest ones you can get. Here's what I bought.

3. Something to cut out the body from. It can be wood, plastic, metal, cardboard...you name it. Mine is made out of an old notebook, so everything will do the job.

4. Unless you are planning on making your own custom PCB, you will need a breadboard. A small one will do the job, but you can get them for really cheap, so i suggest getting a large one. Here's one like mine. It comes with plenty of jumper cables and a power supply, yay!


5. Something for the base. I used and old Nescafe tin. Not the best solution, but the only one I had lying around, as I live in a new apartment. I miss my old junk.

6. Some thin thread, for the arm mechanism, and a needle to make a hole.

7. Glue and tape, to put it all together. There is no problem that can't be fixed with duct tape and hot glue!

7. Three 10k resistors. If you don't have any lying around, there is a workaround, there are instructions in the code, but it would be ideal with the resistors and I strongly recommend them.

And that's it!

Step 2: How Does It Work?

The drawing shows the principle. Let me explain how the arm works. Both sides of the arm are attached to a thin thread. The middle of the thread is then connected to the servo of the arm. When the servo pulls the rope, the arm squeezes. Easy! I also added a small spring from a ball pen, but if you have another, more flexible material, you can use that.

Step 3: Hacking the Joypad

Assuming that you have finished your mechanical build, now we can move on.

For this project I used an old joypad, but you can also use any other buttons. The analogs (mushrooms) of the joypad are used for controlling the servos, as they are really potentiometers. If you don't have a joypad, you can use these, or simply 3 linear potentiometers. You can also use any other buttons instead the ones on the joypad.

But, if you have one, this is what I did.

I traced the potentiometer lines on the PCB. The pots have 3 pins. You connect one of the end pins to GND, the other to +5V of the Arduino, and the middle one to a input we will define later. We won't use the Y axis of the left pot, so we only need the pot above the joystick.

As for the switches. You connect +5V to one end of the switch, and the wire that will go to another Arduino input at the other end. My joypad had a common for all the switches +5V line. I connected only 2 buttons, but ended up adding another external button, as I needed it.

It's also important that you cut the lines that go to the chip (the black circle).

When you finish all of that, you are ready to do the wiring.

Step 4: Wiring

Here's the wiring diagram. The pots represent the joysticks. Elbow is right Y-axis, Base is right X-axis and Shoulder is left X-axis. If you'd like the change the direction of movement of the servo, just flip the +5V and GND wires on the corresponding potentiometer.

Step 5: Uploading the Code.

Now you have to download the code that i posted and upload it to your arduino. Here's how!

Note: if you have already uploaded codes before and you know how to do this, you can skip this and continue below. Nothing fancy in here.

1. Open the Arduino IDE and paste the code

2. From Tools/Board select your board

3. In Tools/Serial Port select the port your board is connected to. Yo will probably have just one choice.

4. Click on the upload button.

You can modify the ranges of your servos, i left notes on how to do it. You probably won't need to change anything else except for the arm servo. It depends on how you set up the string, so I recommend fine tuning this.

If you aren't using the resistors, you will also have to edit the code in places i have written notes to do so.

Step 6: Running

You control the robot by moving the joysticks, the arm is squeezed and released with the Arm button. The demo below shows the movements:

Here's how to program it:

1. Open the Serial Monitor in Arudino IDE, it will make the monitoring easier.

2. Save the starting position by clicking save

3. Move only one servo at a time, for example just the elbow up, and press save.

4. Also, activate the arm on it's own step. Activate and then save. When you deactivate do it also on a sepparate step and save it again.

5. When you finish your sequence, press the play button, the robot will move to the first position and then start moving.

6. When you want to stop it, unplug the cable or press the reset button on the Arduino board.

If you've done everything right, it should work like this!

I hope the lesson was somewhat useful to you. If there are any grammar mistakes, excuse me, I am from Serbia.

If you have any questions post them in the comment section below, I will try to answer them all.

Comments

author
MojtabaK8 made it! (author)2017-08-05

Hi, thank you so much for sharing this project free. I edit some part of the code for the better function and better default positions. after all your code was awesome and a master piece. I found a free arm design in http://geekswithblogs.net/kobush/archive/2012/04/0... and made the hardware of arm with laser cut and plexiglass. That was really precise. I add the laser cut file below. I appreciate again.

good luck

ax2.jpgax1.jpgrobot body.svg
author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
AleksandarT2 (author)ROBO HUB2016-11-23

What exactly do you mean with teach in? It has a form of it, you memorize the positions and then recall them.

author
ROBO HUB (author)AleksandarT22016-11-23

Ya with some micro servos and push buttons,it can perform pick and place work such as in industries

author
hjalte (author)2016-11-07

Could the gripper be wired to the 4 axis of the potentiometers rather than a button?

author
AleksandarT2 (author)hjalte2016-11-23

It sure could, with minimal code editing.

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
ROBO HUB (author)2016-11-21

Can u build one with teach-in function

author
leo1970 (author)2016-10-15

Can you help me to add a pause buttom

best regards

author
AleksandarT2 (author)leo19702016-10-17

Actually, it would be pretty hard to implement, it would require editing the entire code and working principle in order to make that happen.

author
leo1970 (author)2016-10-10

Thanks so much

author
AleksandarT2 (author)leo19702016-10-10

You're welcome :)

author
arnaudcn68 (author)2016-04-13

I love that idea can you help me please i have a problem ==) !! my problem is : when i want to uplod the code but the arduino program say that in the code they are error during compilation can you fix the problem please ?? :) Otherwise this is a great project !!:)

the error :



:1:10: error: #include expects "FILENAME" or <FILENAME>

2:10: error: #include expects "FILENAME" or <FILENAME>

:43:3: error: missing terminating ' character

:45:14: error: invalid suffix "armState" on integer constant

:45:24: error: invalid suffix "armState" on integer constant

:214:3: error: missing terminating ' character

:220:3: error: missing terminating ' character

:8:46: error: 'Servo' has not been declared

:9:36: error: 'Servo' has not been declared

:5:1: error: 'Servo' does not name a type

:6:1: error: 'Servo' does not name a type

:7:1: error: 'Servo' does not name a type

:8:1: error: 'Servo' does not name a type

12:1: error: 'servo' does not name a type

:15:16: error: 'LONG_MAX' was not declared in this scope

: In function 'void setup()':

27:3: error: 'servo_elbow' was not declared in this scope

28:3: error: 'servo_base' was not declared in this scope

:

29:3: error: 'servo_shoulder' was not declared in this scope

: error: 'servo_arm' was not declared in this scope

:32:18: error: 'System' was not declared in this scope

: In function 'void read_val()':

:37:3: error: 'elbow' was not declared in this scope

:38:3: error: 'base' was not declared in this scope

:39:3: error: 'shoulder' was not declared in this scope

:43:52: error: lvalue required as left operand of assignment

:43:57: error: 'If' was not declared in this scope

:43:60: error: expected ';' before 'you'

: At global scope:

:50:17: error: expected initializer before 'sends'

:77:42: error: expected initializer before 'blinks'

Error during compilation

author
AleksandarT2 (author)arnaudcn682016-04-13

The code got corrupted somehow, now it's alright. Sorry for the inconvenience!

author
arnaudcn68 (author)AleksandarT22016-04-15

thanks you a lot !! :) Have a nice day!

author
AleksandarT2 (author)arnaudcn682016-04-15

You're welcome! :)

author
arnaudcn68 (author)AleksandarT22016-04-15

thanks you a lot !! :) Have a nice day!

author
-Mr.A (author)2016-04-03

Would a ps2 controller work ? Anyway, Great project !!:)

author
AleksandarT2 (author)-Mr.A2016-04-03

Sure, any controller will work.

author
ロドリゴb made it! (author)2015-12-22

así me quedo , funciona bien.

DSC_0194.JPGDSC_0195.JPG
author

Excellent! I like how you usled the Legos.

author
jan.wouter.5 (author)2015-12-08

I love this idea. Simple and effective. Will try to find some time to play around with it during the Christmas holidays.

Will also share my findings and suggestions.

author
stefan dorcol (author)2015-12-05

Svaka cast legendo, moram ovo da napravim :) odusevljen sam :D

author

Hvala, ako zatreba neka pomoc tu sam :)

author

Hvala :)

author
ayushprd (author)2015-12-05

where is the third potentiometer for controlling the arm?

author
AleksandarT2 (author)ayushprd2015-12-05

Each of the joysticks has 2 potentiometers, one for x and the other for y axis.

author
yellapu ganesh (author)2015-12-04

can we make an automatically working arm without controlling them by joystick or something else ......,can it work automatically like an industrial robotic arm

author

The industrial robots are also programmed. There are autonomous robots with optical recognition, it's also doable, even with Arduino, but it's much more complicated. Search on Arduino Kinect optical recognition.

author
NoseyNick (author)2015-12-04

Nice! simple, cheap, elegant, functional, love it!

Quick tip if I may: Look up PinMode INPUT_PULLUP on the Arduino, connect your buttons between the pin and GND. You may need to flip the logic in your code as the inputs are then be pulled LOW instead of HIGH when pressed, but you no longer need your external resistors. Hardly need the breadboard then either - at most you're using it as power/GND bars.

https://www.arduino.cc/en/Tutorial/DigitalPins

author
AleksandarT2 (author)NoseyNick2015-12-04

Sure, that's the way I would do it, great workaround but I wanted this project to be beginner friendly, so i didn't want to use INT_PULLUP, but well noticed! Cheers! :)

author
stefanpetraru (author)2015-12-03

Nice, I will try to make this with my son

author

Great! :)

author
YafetH (author)2015-12-01

This Is awesome ! I've been looking for something like this and you posted yours just in time. I have this project at college and I would love to make this and I'm asking you for permission to use your guide and maybe some assistance from you if I need any.Very much appreciated :)

author
AleksandarT2 (author)YafetH2015-12-01

Sure, no problem!

author
JayWeeks (author)2015-11-30

This is fantastic! I really like how you did the gripper.

author
AleksandarT2 (author)JayWeeks2015-11-30

Thanks! :) It's really a makeshift solution, used stuff that was laying around :)

author
JayWeeks (author)AleksandarT22015-11-30

Yes it is! I think cardboard is really fantastic! It's plentiful, easy to work with, and surprisingly strong.

Honestly, I think your gripper is a beautifully elegant, compact, and effective solution to a difficult problem! I wish I'd thought of it!

author
AleksandarT2 (author)JayWeeks2015-12-01

Thanks again :)

author
AleksandarT2 (author)JayWeeks2015-11-30

I see cardboard is out material of choice :D

author
pj200 (author)2015-11-28

Very nice project.
Did you use any motor driver for the project

author
AleksandarT2 (author)pj2002015-11-28

No, the small servos I listed in the bill of materials work perfectly with just the Arduino.