thortheyeeter
Published © GPL3+

Simple robotic arm

A robotic arm that can be made with popsicle sticks, and regular servos. No soldering needed.

BeginnerShowcase (no instructions)924
Simple robotic arm

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×4
Arduino UNO
Arduino UNO
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

roboticarm

Arduino
#include <Servo.h>
Servo arm ;
Servo turn ;
Servo claw ;
Servo claw2 ;
 
 int potpin = 0;  // analog pin used to connect the potentiometer
int val;
int potpin2 = 1;  // analog pin used to connect the potentiometer
int val2;
int potpin3 = 2;  // analog pin used to connect the potentiometer
int val3;



void setup() {
  // put your setup code here, to run once:
turn.attach(13) ;
 arm.attach(12) ;
 claw.attach(11) ;
 claw2.attach(10) ;




}
void loop() {
  // put your main code here, to run repeatedly:
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)
  turn.write(val);                  // sets the servo position according to the scaled value
  delay(15);

  val2 = analogRead(potpin2);            // reads the value of the potentiometer (value between 0 and 1023)
  val2 = map(val2, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  arm.write(val2);                  // sets the servo position according to the scaled value
  delay(15);
  
  val3 = analogRead(potpin3);            // reads the value of the potentiometer (value between 0 and 1023)
  val3 = map(val3, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  
  delay(15);
  if(val3 < 90){
    claw.write(180);
  claw2.write(90); 
  }  
  else if(val3 > 90){
  claw.write(90);
  claw2.write(180); 
  }  
  }

Credits

thortheyeeter
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.