MisterBotBreak
Published

How to Make a Robotic Arm

This project will show you how to make a robotic arm using four servos.

BeginnerFull instructions provided12 minutes5,042
How to Make a Robotic Arm

Things used in this project

Hardware components

Jumper wires (generic)
Jumper wires (generic)
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×4
SG90 Micro-servo motor
SG90 Micro-servo motor
×4
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Robotic Arm - schematics

Code

4 Servo

Arduino
#include <Servo.h>

Servo my1Servo;  
Servo my2Servo;
Servo my3Servo;
Servo my4Servo;

void setup()
{
  pinMode(13,OUTPUT);
  Serial.begin(115200);
  my1Servo.attach(3); 
  my2Servo.attach(5); 
  my3Servo.attach(6); 
  my4Servo.attach(9);
}
 
void loop()
{
  int valcomfrom1pot = analogRead(A0);           
  int degree1 = map(valcomfrom1pot, 0, 1023, 0, 180);     
  my1Servo.write(degree1);              
  Serial.println("Angle (Servo 1) : ");
  Serial.println(degree1);
  
  int valcomfrom2pot = analogRead(A1);           
  int degree2 = map(valcomfrom2pot, 0, 1023, 20, 70);     
  my2Servo.write(degree2);                          
  Serial.println("Angle (Servo 2) : ");
  Serial.println(degree2);
  
  int valcomfrom3pot = analogRead(A2);           
  int degree3 = map(valcomfrom3pot, 0, 1023, 0, 90);     
  my3Servo.write(degree3); 
  Serial.println("Angle (Servo 3) : ");
  Serial.println(degree3);
  
  int valcomfrom4pot = analogRead(A3);           
  int degree4 = map(valcomfrom4pot, 0, 1023, 0, 90);     
  my4Servo.write(degree4);
  Serial.println("Angle (Servo 4) : ");
  Serial.println(degree4);
  
  Serial.println("");
  Serial.println("");
  Serial.println("");
  Serial.println("");
  Serial.println("");
  Serial.println("");
  Serial.println("");
 
  delay(40);
}

Credits

MisterBotBreak

MisterBotBreak

37 projects • 66 followers
I love electronic and I make explanatory project on how to control sensors.

Comments