Simple Programmable Robotic Arm

I'm AbelMathews from builderduino. I like to make electronic and robotic projects. I don't have money to buy Electronics and Robotics components for my new project. and i don't have money for paying fees for my studies. Dear viewers please donate minimum 1USD to my bank account. UPI: open.2001653339@icici

Robotic Arm.

About the project.

This is just a simple robot arm made out of readily available materials and instruments, such as micro servos, cardboard, and hot glue, designed for beginners. The code and circuit can be improved, so feel free to make changes and learn!


It can record and play five positions using potentiometers and buttons. (But you can add as many as you want).


Arm Assembly.

Pictures of the arm assembly can be found here:

Similar instructions can also be found at 0:18 in the Version 2 video below in the Update section

Everything should be able to run off of a power supply from a computer via the USB, but adding an external power supply is also possible, just make sure the servo can take it.

Schematic diagram.


#include <Servo.h>

Servo servo1; //Servos
Servo servo2;
Servo servo3;

const int LED1 = 2; //LEDs
const int LED2 = 3;
const int LED3 = 4;
const int LED4 = 7;
const int LED5 = 8;

const int button1 = 12; //Buttons
const int button2 = 13;

int button1Presses = 0; //Button values
boolean button2Pressed = false;

const int pot1 = A0; //Potentimeters
const int pot2 = A1; 
const int pot3 = A2;

int pot1Val; //Potentimeter values
int pot2Val;
int pot3Val;
int pot1Angle;
int pot2Angle;
int pot3Angle;

int servo1PosSaves[] = {1,1,1,1,1}; //position saves
int servo2PosSaves[] = {1,1,1,1,1};
int servo3PosSaves[] = {1,1,1,1,1};

void setup() {
  servo1.attach(5); // Set up everything and will run once; attach servos and define the pin modes
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED4, OUTPUT);
  pinMode(LED5, OUTPUT);
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);


void loop() {
  // put your main code here, to run repeatedly: 
  pot1Val = analogRead(pot1); // This will read the values from the potentimeters and store it...
  pot1Angle = map(pot1Val, 0, 1023, 0, 179); // ... and this will map the values from the potentiometers to values the servos can use and store it for later use
  pot2Val = analogRead(pot2); 
  pot2Angle = map(pot2Val, 0, 1023, 0, 179);
  pot3Val = analogRead(pot3);
  pot3Angle = map(pot3Val, 0, 1023, 0, 179);
  servo1.write(pot1Angle); // These will make the servos move to the mapped angles
  if(digitalRead(button1) == HIGH){ // This will check how many times button1 is pressed and save the positions to an array depending on how many times it is pressed; switch/case works like a if statement
      case 1:
        servo1PosSaves[0] = pot1Angle;
        servo2PosSaves[0] = pot2Angle;
        servo3PosSaves[0] = pot3Angle;
        digitalWrite(LED1, HIGH);
        Serial.println("Pos 1 Saved");
      case 2:
         servo1PosSaves[1] = pot1Angle;
         servo2PosSaves[1] = pot2Angle;
         servo3PosSaves[1] = pot3Angle;
         digitalWrite(LED2, HIGH);
         Serial.println("Pos 2 Saved");
      case 3:
         servo1PosSaves[2] = pot1Angle;
         servo2PosSaves[2] = pot2Angle;
         servo3PosSaves[2] = pot3Angle;
         digitalWrite(LED3, HIGH);
         Serial.println("Pos 3 Saved");
       case 4:
         servo1PosSaves[3] = pot1Angle;
         servo2PosSaves[3] = pot2Angle;
         servo3PosSaves[3] = pot3Angle;
         digitalWrite(LED4, HIGH);
         Serial.println("Pos 4 Saved");
       case 5:
         servo1PosSaves[4] = pot1Angle;
         servo2PosSaves[4] = pot2Angle;
         servo3PosSaves[4] = pot3Angle;
         digitalWrite(LED5, HIGH);
         Serial.println("Pos 5 Saved");

  if(digitalRead(button2) == HIGH){ // Pretty self-explnatory here
    button2Pressed = true;   
  if(button2Pressed){ // if the boolean button2Press is true, then the servos will run though all their saved positions
    for(int i = 0; i < 5; i++){
        Serial.println(" potentimeter Angles: ");

Apply for sponsorship >>
1600+ Projects Sponsored
Jul 10,2022
1,234 viewsReport item
  • Comments(2)
  • Likes(2)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000