HOW TO MAKE A ROBOTIC ARM WITH ARDUINO #2
Previously, I made a tutorial, where I showed how to design an autonomous robotic arm with Arduino. In this tutorial, I will show you how to design a robotic arm that is controlled with knobs like a crane is being controlled by levers.
I made the previous robotic arm with wooden material, however, I made this one with acrylic material. The parts can be purchased from Amazon or AliExpress.
Materials
1 Acrylic robotic arm kit
4 Potentiometers
5 volts 5 Amperes power supply
The guide on how to connect the parts can be downloaded below.
Once you’ve connected the parts accurately, it should look like the images bellow:



Below is the circuit diagram for the design:

When you have made the connection, it would have a setup like the one shown below:

The code for the design is shown below:
#include <Servo.h>
Servo myservo1;
Servo myservo2;
Servo myservo3;
Servo myservo4;
int potpin1 = A1;
int potpin2 = A2;
int potpin3 = A3;
int potpin4 = A4;
int val1;
int val2;
int val3;
int val4;
void setup()
{
myservo1.attach(8);
myservo2.attach(9);
myservo3.attach(10);
myservo4.attach(11);
}
void loop()
{
val1 = analogRead(potpin1);
val1 = map(val1, 0, 1023, 0, 180);
myservo1.write(val1); val3 = analogRead(potpin3);
val3 = map(val3, 0, 1023, 0, 180);
myservo3.write(val3);
delay(15);
delay(15);
val2 = analogRead(potpin2);
val2 = map(val2, 0, 1023, 0, 180);
myservo2.write(val2);
delay(15);
val3 = analogRead(potpin3);
val3 = map(val3, 0, 1023, 0, 180);
myservo3.write(val3);
delay(15);
val4 = analogRead(potpin4);
val4 = map(val4, 0, 1023, 0, 180);
myservo4.write(val4);
delay(15);
}
I have other tutorials you can check out, feel free to let me know if you encountered any difficulties with the design.