Robotic Arm Project
Robotic Arm Project
Robotic Arm
In this project you are going to make and Arduino based robotic arm using four servos controlled by four
Potentiometer attached to it; each potentiometer is used to control each servo. You can move these
servos by rotating the pots to pick an object.
We provide variable voltage at the ADC channels of Arduino UNO using the potentiometer. So, the digital
values of Arduino are under control of the user. These digital values are mapped to adjust the servo motor
position; hence the servo position is in control of user and by rotating these Pots user can move the joints
of Robotic arm.
Materials Needed:
Connect the Servos and Potentiometers as indicated in the diagram. Carefully place them in the
breadboard and use connecting wires to connect the components to your Arduino Uno.
CPE-PC 411 - Embedded Systems Robotic Arm Project
#include <Servo.h>
void setup()
{
ser0.attach(7); // attaches the servo on pin 9 to the servo object
ser1.attach(6);
ser2.attach(5);
ser3.attach(4);
}
void loop()
{
val = analogRead(con1); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
val1 = analogRead(con2);
val1 = map(val1, 0, 1023, 0, 179);
val2 = analogRead(con3);
val2 = map(val2, 0, 1023, 0, 179);\
val3 = analogRead(con4);
val3 = map(val3, 0, 1023, 0, 179);