gmel31
Published © GPL3+

Most Simple Robot Arm out There (Easy!)

Learn how to make a really easy and fun robot arm!

BeginnerFull instructions provided4,782
Most Simple Robot Arm out There (Easy!)

Things used in this project

Hardware components

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

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Robot Arm Schematic

This is the schematic for the robot arm

Code

Robot Arm Code

C/C++
The code for the robot arm.
// This includes the servo library so we can use servo moters and edit their values
#include<Servo.h>

// These are the names of all the servos
Servo myservo;  
Servo myservo2;
Servo myservo3;

// These are the potentiometers and the values of their angles
int potpin = 0;  
int val;    

int potpin2 = 2;
int val2;

int potpin3 = 4;
int val3;

// This happens as soon as the code starts running
void setup() {
  // This tells the program where the servos are plugged in
  myservo.attach(9);  
  myservo2.attach(6);
  myservo3.attach(3);
}

// This loops when the Arduino Uno is plugged into your computer
void loop() {
  // This tells the program where the potentiometer is plugged in on the Arduino Uno
  val = analogRead(potpin);
  val2 = analogRead(potpin2);
  val3 = analogRead(potpin3);
  // This converts the potentiometer angles into servo angles
  val = map(val, 0, 1023, 0, 180);
  val2 = map(val2, 0, 1023, 0, 180);
  val3 = map(val3, 0, 1023, 0, 180);
  // This sets the position of the servo where the potentiometer is located
  myservo.write(val);
  myservo2.write(val2);
  myservo3.write(val3);
  // This delays after every loop
  delay(15);
}

Credits

gmel31

gmel31

0 projects • 2 followers

Comments