STEMpedia
Published © CC BY

Pick and Place Robotic Arm

This is a four degree of freedom robotic arm capable of picking and placing small objects. With medium sized links, the robotic arm can fit

IntermediateFull instructions provided6 hours1,226
Pick and Place Robotic Arm

Things used in this project

Hardware components

evive
STEMpedia evive
×1
evive Robotic Arm Kit [Add-on]
STEMpedia evive Robotic Arm Kit [Add-on]
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram of Pick and Place Robotic Arm

Connect four motors according to the following:

Base Servo – Channel 1;
Link 1 Servo – Channel 2;
Gripper Servo – Digital Pin 10;
Link 2 Servo – Digital Pin 9.

Code

Pick and Place Robotic Arm Arduino Code

Arduino
In this program, we are controlling the robotic arm using potentiometers and slide switch.

Base Servo is controlled using potentiometer 1
Link 1 Servo is controlled using potentiometer 2
Link 2 Servo is controlled using slide switch 1
Gripper Servo is controlled using slide switch 2

This program also shows the variable voltage on the screen.
#include <evive.h> 

double angle_rad = PI/180.0;
double angle_deg = 180.0/PI;
double BaseServoAngle;
double Link1ServoAngle;
double VariableVoltage;
TFT_ST7735 lcd = TFT_ST7735();
Servo servo_44;
Servo servo_45;
Servo servo_9;
Servo servo_10;

void setup(){
    lcd.init(INITR_BLACKTAB);
    lcd.setRotation(1);
    lcd.fillScreen(0);
    
    pinMode(A0+9,INPUT);
    servo_44.attach(44); // init pin
    pinMode(A0+10,INPUT);
    servo_45.attach(45); // init pin
    pinMode(40,INPUT);
    servo_9.attach(9); // init pin
    pinMode(41,INPUT);
    pinMode(42,INPUT);
    servo_10.attach(10); // init pin
    pinMode(A0+7,INPUT);
}

void loop(){
    BaseServoAngle = analogRead(A0+9);
    BaseServoAngle = ((BaseServoAngle) * (180)) / (1023);
    BaseServoAngle = (180) - (BaseServoAngle);
    servo_44.write(BaseServoAngle); // write to servo
    Link1ServoAngle = analogRead(A0+10);
    Link1ServoAngle = ((Link1ServoAngle) * (180)) / (1023);
    Link1ServoAngle = (180) - (Link1ServoAngle);
    servo_45.write(Link1ServoAngle); // write to servo
    if(digitalRead(40)){
        servo_9.write(180); // write to servo
        lcd.setCursor(10, 55);
        lcd.print("Gripper Up        ");
    }else{
        if(digitalRead(41)){
            servo_9.write(0); // write to servo
            lcd.setCursor(10, 55);
            lcd.print("Gripper Down      ");
        }else{
            servo_9.write(90); // write to servo
            lcd.setCursor(10, 55);
            lcd.print("Gripper Straight  ");
        }
    }
    if(digitalRead(42)){
        servo_10.write(90); // write to servo
        lcd.setCursor(10, 70);
        lcd.print("Gripper Open ");
    }else{
        servo_10.write(0); // write to servo
        lcd.setCursor(10, 70);
        lcd.print("Gripper Close");
    }
    VariableVoltage = analogRead(A0+7);
    VariableVoltage = (VariableVoltage) * (0.0381);
    lcd.setCursor(10, 10);
    lcd.print("Voltage: ");
    lcd.print(VariableVoltage);
    lcd.print(" V   ");
    lcd.setCursor(10, 25);
    lcd.print("Base Servo: ");
    lcd.print(BaseServoAngle);
    lcd.print(" Deg   ");
    lcd.setCursor(10, 40);
    lcd.print("Link 1 Servo: ");
    lcd.print(Link1ServoAngle);
    lcd.print(" Deg   ");
}

evive Library

C/C++
Helps to access evive's librabry.
No preview (download only).

Credits

STEMpedia

STEMpedia

42 projects • 169 followers
STEMpedia blends theory with experiential learning by offering state-of-the-art technology, projects, tutorials, courses, and much more.

Comments