ProjectsRobotics

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.

video of the design

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

1 Arduino board

4 sg90 Servo motors

4 Potentiometers

Bunch of jumper wires

5 volts 5 Amperes power supply

1 Breadboard

 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:

robotic arm side view
figure 1: robotic arm side view
robotic arm front view
figure 2: robotic arm front view
robotic arm top view
figure 3: robotic arm top view

Below is the circuit diagram for the design:

circuit diagram for the robotic arm design
figure 4: circuit diagram for the robotic arm design

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

v
figure 5: robotic arm connection

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.

Tags

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close