Simple & Smart Robotic Arm Using Arduino !!!
by Harsh Dethe in Circuits > Robots
28226 Views, 89 Favorites, 0 Comments
Simple & Smart Robotic Arm Using Arduino !!!


In this instructable, I will be making a simple robotic arm. That will be controlled using a master arm. The arm will remember moves and play in sequence. The concept isn't new I got the Idea from "mini robotic arm -by Stoerpeak" I wanted to make this for a long time, but back then I was a noob and had no knowledge about programming. Now, finally, I am building one, keeping it simple, cheap and sharing it with you all.
So let's get started....
Things You'll Need :-



Here is a list of things you will need:-
1. Servo motors x 5 (Amazon International / Amazon India)
2. Potentiometers x 5 (Amazon International / Amazon India)
3. Arduino UNO. (Amazon International / Amazon India)
4. Breadboard. (Amazon International / Amazon India)
5. 5V 2A Adaptor. (Amazon International / Amazon India)
6. Cardboard, wood, sunboard, acrylic, or whatever is available or easy to find.
You will also need the Arduino IDE installed.
Tools that will be handy:
1. Hot Glue Gun (Amazon International / Amazon India)
2. Electric drill or Hand drill (Amazon International / Amazon India)
3. Soldering Station (Amazon International / Amazon India)
4. Screw driver set (Amazon International / Amazon India)
Making the Arm :-


Here I have used Popsicle sticks to make the arm. You can use any material that is available to you. And you can try different mechanical designs to make an even better arm. My design is not very stable.
I just used double-sided tape to stick the servos to the Popsicle stick and fasten them using screws.
For the Master arm, I glued potentiometers to popsicle sticks and made an arm.
Referring to the pictures will give you a better idea.
I have mounted everything on an A4-size canvas board used as a base.
Making Connections :-
.png)


In this step, we will make all the necessary connections. Refer to the pictures above.
- First, connect all the servos in parallel to the power supply ( The Red wire to +ve and the Black or Brown Wire to ground)
- Next, connect the signal wires, i.e Yellow or Orange wire, to the PWM pin of Arduino.
- Now connect the potentiometers to +5V and GND of Arduino in parallel.
- Connect the middle terminal to the Analog pin of Arduino.
Here, Digital Pins 3,5,6,9 & 10 are used for controlling the servos
Analogue Pins A0 to A4 are used for Input from Potentiometers.
The servo connected to pin 3 will be controlled by a potentiometer connected to A0
Servo connected to pin 5 will be controlled by pot on A1, and so on...
Note:- Even though Servos are not powered by Arduino, make sure to connect the GND of the servos to Arduino or else the arm won't work.
Coding :-
.png)
The Logic of this code is fairly simple. The values of potentiometers are stored in an array, the records are then traversed using a for loop, and the servos take the steps as per the values. You can check out this tutorial I used for reference, "Arduino Potentiometer Servo Control & Memory"
Code:- (Downloadable file attached below.)
- First, we will declare all the necessary variables globally so we can use them throughout the program. No special explanation is needed for this.
- Now we will write a setup function, where we set pins and their functions. This is the main function that executes first.
- Now we have to read the values of potentiometers using Analogue Input pins and map them to control servos. For this, we will define a function and name it Map_Pot(); you can name it anything you want, it is a user-defined function.
- Now we will write the loop function:
- Once the code is ready, upload it to the Arduino board.
The Smart arm is ready to work. The function is not yet as smooth as the one made by Stoerpeak.
If you can make the code better or have any suggestions for me, please let me know in the comments section.
With that being said, let's move on to testing...
Downloads
Testing :-
After uploading the code to the board successfully, Open 'Serial Monitor' you can find in the Tools option. When the Serial monitor starts, the Arduino will reset. Now you can control the robotic arm using the master arm. But nothing is being recorded.
To start recording, enter 'R' on the monitor. Now you can perform the moves you wish to record.
After the moves are done, you have to enter 'P' in order to play the recorded moves. The servos will continue to perform the moves as long as the board is not reset.
If you like this instructable, do follow for more. Also, check out more blogs on our website.