Mirko Pavleski
Published © GPL3+

Arduino 3D-Printed Robotic Arm

A relatively easy to build and quite cheap robotic arm.

AdvancedFull instructions provided45,231
Arduino 3D-Printed Robotic Arm

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×4
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

3Dparts

Schematics

schematic

Code

code

Arduino
#include <Servo.h>

Servo myservo;  // create servo object to control a servo
Servo myservo1;
Servo myservo2;
Servo myservo3;

int potpin = 0;// analog pin used to connect the potentiometer
int potpin1 = 1;
int potpin2 = 2;
int potpin3 = 3;

int val;    // variable to read the value from the analog pin
int val1;
int val2;
int val3;

void setup() {
  myservo.attach(8);  // attaches the servo on pin 8 to the servo object
  myservo.attach(9);
  myservo.attach(10);
  myservo.attach(11);
}

void loop() {
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  myservo.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there

  val1 = analogRead(potpin1);            
  val1 = map(val1, 0, 1023, 0, 180);     
  myservo1.write(val1);
  delay(15);  


  val2 = analogRead(potpin2);            
  val2 = map(val2, 0, 1023, 0, 180);     
  myservo2.write(val2);
  delay(15);    


  val3 = analogRead(potpin3);            
  val2 = map(val3, 0, 1023, 0, 180);     
  myservo3.write(val3); 
  delay(15);
                            
}

Credits

Mirko Pavleski

Mirko Pavleski

113 projects • 1151 followers

Comments