loading

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.

Can u build one with teach-in function
What exactly do you mean with teach in? It has a form of it, you memorize the positions and then recall them.
Ya with some micro servos and push buttons,it can perform pick and place work such as in industries
<p>Could the gripper be wired to the 4 axis of the potentiometers rather than a button?</p>
It sure could, with minimal code editing.
Can u build one with teach-in function
Can u build one with teach-in function
Can u build one with teach-in function
Can u build one with teach-in function
Can u build one with teach-in function
Can u build one with teach-in function
Can u build one with teach-in function
Can u build one with teach-in function
<p>Can you help me to add a pause buttom</p><p>best regards</p>
<p>Actually, it would be pretty hard to implement, it would require editing the entire code and working principle in order to make that happen.</p>
<p>Thanks so much</p>
You're welcome :)
<p>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 !!:) </p><p>the error : </p><p><br><br>:1:10: error: #include expects &quot;FILENAME&quot; or &lt;FILENAME&gt;</p><p>2:10: error: #include expects &quot;FILENAME&quot; or &lt;FILENAME&gt;<br><br>:43:3: error: missing terminating ' character<br><br>:45:14: error: invalid suffix &quot;armState&quot; on integer constant<br><br> :45:24: error: invalid suffix &quot;armState&quot; on integer constant<br><br> :214:3: error: missing terminating ' character<br><br> :220:3: error: missing terminating ' character<br><br> :8:46: error: 'Servo' has not been declared<br><br> :9:36: error: 'Servo' has not been declared<br><br> :5:1: error: 'Servo' does not name a type<br><br> :6:1: error: 'Servo' does not name a type<br><br> :7:1: error: 'Servo' does not name a type<br><br> :8:1: error: 'Servo' does not name a type<br><br> 12:1: error: 'servo' does not name a type<br><br> :15:16: error: 'LONG_MAX' was not declared in this scope<br><br> : In function 'void setup()':<br><br>27:3: error: 'servo_elbow' was not declared in this scope<br><br>28:3: error: 'servo_base' was not declared in this scope</p><p>:</p><p>29:3: error: 'servo_shoulder' was not declared in this scope</p><p>: error: 'servo_arm' was not declared in this scope<br><br> :32:18: error: 'System' was not declared in this scope<br> </p><p>: In function 'void read_val()':<br><br>:37:3: error: 'elbow' was not declared in this scope<br><br>:38:3: error: 'base' was not declared in this scope</p><p>:39:3: error: 'shoulder' was not declared in this scope<br><br>:43:52: error: lvalue required as left operand of assignment<br><br>:43:57: error: 'If' was not declared in this scope<br><br>:43:60: error: expected ';' before 'you'<br><br>: At global scope:<br><br>:50:17: error: expected initializer before 'sends'<br><br> :77:42: error: expected initializer before 'blinks'<br><br>Error during compilation<br></p>
<p>The code got corrupted somehow, now it's alright. Sorry for the inconvenience!</p>
<p>thanks you a lot !! :) Have a nice day!</p>
<p>You're welcome! :)</p>
<p>thanks you a lot !! :) Have a nice day!</p>
<p>Would a ps2 controller work ? Anyway, Great project !!:)</p>
Sure, any controller will work.
<p>as&iacute; me quedo , funciona bien.</p>
Excellent! I like how you usled the Legos.
<p>I love this idea. Simple and effective. Will try to find some time to play around with it during the Christmas holidays.</p><p>Will also share my findings and suggestions.</p>
Svaka cast legendo, moram ovo da napravim :) odusevljen sam :D
<p>Hvala, ako zatreba neka pomoc tu sam :) </p>
<p>Hvala :)</p>
<p>where is the third potentiometer for controlling the arm?</p>
Each of the joysticks has 2 potentiometers, one for x and the other for y axis.
<p>can we make an automatically working arm without controlling them by joystick or something else ......,can it work automatically like an industrial robotic arm</p>
<p>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. </p>
<p>Nice! simple, cheap, elegant, functional, love it!</p><p>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.</p><p>https://www.arduino.cc/en/Tutorial/DigitalPins</p>
<p>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! :)</p>
<p>Nice, I will try to make this with my son</p>
Great! :)
<p>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 :)</p>
Sure, no problem!
<p>This is fantastic! I really like how you did the gripper.</p>
<p>Thanks! :) It's really a makeshift solution, used stuff that was laying around :)</p>
<p>Yes it is! I think cardboard is really fantastic! It's plentiful, easy to work with, and surprisingly strong.</p><p>Honestly, I think your gripper is a beautifully elegant, compact, and effective solution to a difficult problem! I wish I'd thought of it!</p>
<p>Thanks again :)</p>
<p>I see cardboard is out material of choice :D</p>
Very nice project.<br>Did you use any motor driver for the project<br>
<p>No, the small servos I listed in the bill of materials work perfectly with just the Arduino.</p>

About This Instructable

22,611views

281favorites

License:

More by AleksandarT2:Simple Cheap Arduino Oscilloscope Cheap programmable Arduino robotic arm 
Add instructable to: