Project showcase
Omicron - Arduino Robot Arm

Omicron - Arduino Robot Arm © GPL3+

Omicron is a robot arm based on Arduino UNO.

  • 3,762 views
  • 7 comments
  • 10 respects

About this project

Overview

I built this robot for my final project in secondary technical school (mechatronics). I decided to make a robot arm because it's very interesting field and I am very interested in Arduino and electronics.

You can also check my models on GrabCAD.

https://grabcad.com/library/omicron-robot-arm-1

Step 1

This is a 4DOF robot based on Arduino UNO. For movement it uses four TowerPro MG995 servos, but aren't strong enough for harder operations. When arm is fully extended it lifts just 150g heavy object. This robot arm uses suction cup to lift objects. Vacuum creates an air pump which is turned on by relay module because it needs 12V to operate. Construction of robot is made by aluminum and some plastic I found at home. Suction cup holder was made on 3D printer.

Step 2

Controlling this robot is very easy. All you need to do is that you move two joysticks to move the robot. You can set speed that you want with potentiometer and activate vacuum with pushbutton. Omicron has also two modes, auto and manual. In manual mode you can move robot as you want. But when you choose auto mode with switch on control panel you start operation with simple push on the right joystick. Operation is written in arduino sketch and can't be changed without computer and Arduino IDE. To change manual operation you need to write positions of servos in arduino sketch and use for loop to program movements of robot.

Step 3

For power I used an old PC power supply that I get from an old computer which I wasn't using it anymore. You need to press the switch on the back of the base to turn on power supply. You also need PC power supply cable.

All components are hidden inside the base. For easier wiring I used terminal blocks that are glued to the wooden plate. Air pump is screwed and secured with nut.

Wiring in control panel was little harder because there was no place to work.

Step 4

After all the work which lasted few weeks and after assembly robot looked like this. Pretty awesome right?

And at the end I need to do a little photoshooting. :)

Code

Omicron codeArduino
//Made by Tine Logar (2017)

#include <Servo.h>
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;

//Starting position of servos
int pos1 = 90;
int pos2 = 23;
int pos3 = 111;
int pos4 = 146;

//Joysticks
int VRx1 = 0;
int VRy1 = 0;
int VRx2 = 0;
int VRy2 = 0;

//Potentiometer
int pot = 0;
int servoSpeed = 0;

//Button
const int button1 = 2;
int state1;
int lastState = LOW;
long lastDebounce = 0;
long delayDebounce = 50;
const int ledPump = 7;
int reading;
int pumpState;
const int relay = 12;

//Switch
const int modeSwitch = 4;
int switchState;

//LEDs
const int ledManual = 8;
const int ledAuto = 13;
const int ledOperation = 3;

const int buttonStart = 11;
int stateStart;

void setup() {

  Serial.begin(9600);

  servo1.attach(5);
  servo2.attach(6);
  servo3.attach(9);
  servo4.attach(10);

  servo1.write(pos1);
  servo2.write(pos2);
  servo3.write(pos3);
  servo4.write(pos4);

  pinMode(button1, INPUT_PULLUP);
  pinMode(ledPump, OUTPUT);
  pinMode(relay, OUTPUT);
  digitalWrite(relay, LOW);

  pinMode(modeSwitch, INPUT_PULLUP);

  pinMode(ledManual, OUTPUT);
  pinMode(ledAuto, OUTPUT);
  pinMode(ledOperation, OUTPUT);

  pinMode(buttonStart, INPUT_PULLUP);

}

void loop() {

  //Reading of inputs
  switchState = digitalRead(modeSwitch);

  pot = analogRead(A4);
  servoSpeed = map(pot, 0, 1023, 100, 12);
  
  VRx1 = analogRead(A1);
  VRx1 = map(VRx1, 0, 1023, 0, 10);
  VRy1 = analogRead(A0);
  VRy1 = map(VRy1, 0, 1023, 10, 0);
  VRx2 = analogRead(A2);
  VRx2 = map(VRx2, 0, 1023, 0, 10);
  VRy2 = analogRead(A3);
  VRy2 = map(VRy2, 0, 1023, 0, 10);

  reading = digitalRead(button1);

  stateStart = digitalRead(buttonStart);

  //Manual mode  
  if (switchState == LOW) {

      digitalWrite(ledManual, HIGH);
      digitalWrite(ledAuto, LOW);
      
    if (VRx1 < 2 && pos1 > 0) {
      (pos1--);
      delay(servoSpeed);
    }
  
    if (VRx1 > 8 && pos1 <180) {
      (pos1++);
     delay(servoSpeed);
    }

    servo1.write(pos1);

    if (VRy1 < 2 && pos2 > 0) {
      (pos2--);
      delay(servoSpeed);
   }

   if (VRy1 > 8 && pos2 <180) {
     (pos2++);
     delay(servoSpeed);
   }

   servo2.write(pos2);

   if (VRx2 < 2 && pos3 > 0) {
     (pos3--);
     delay(servoSpeed);
   }

   if (VRx2 > 8 && pos3 < 180) {
     (pos3++);
      delay(servoSpeed);
    }

   servo3.write(pos3);  

   if (VRy2 < 2 && pos4 > 0) {
     (pos4--);
     delay(servoSpeed);
    }

    if (VRy2 > 8 && pos4 < 180) {
     (pos4++);
      delay(servoSpeed);
   }

    servo4.write(pos4);

  //Turn ON/OFF air pump
    if (reading != lastState) {
      lastDebounce = millis();
    }

    if ((millis() - lastDebounce) > delayDebounce) {
      if (reading != state1) {
       state1 = reading;
       if (state1 == LOW) {
          pumpState = ! pumpState;
       }
     }  
    }

   lastState = reading;

      digitalWrite(ledPump, pumpState);
      digitalWrite(relay, !pumpState);
  }

  //Home position  
  if (stateStart == LOW) {
    
    for (pos1; pos1 < 90; pos1++) {
        delay(servoSpeed);
        servo1.write(pos1);
      }

    for (pos1; pos1 > 90; pos1--) {
        delay(servoSpeed);
        servo1.write(pos1);
      }

    for (pos4; pos4 < 146; pos4++) {
      delay(servoSpeed);
      servo4.write(pos4);
     }

     for (pos4; pos4 > 146; pos4--) {
      delay(servoSpeed);
      servo4.write(pos4);
     }

    for (pos3; pos3 < 111; pos3++) {
      delay(servoSpeed);
      servo3.write(pos3);
    }

    for (pos3; pos3 > 111; pos3--) {
      delay(servoSpeed);
      servo3.write(pos3);
    }

    for (pos2; pos2 < 23; pos2++) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    for (pos2; pos2 > 23; pos2--) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

  }

  //Auto mode
  if (switchState == HIGH && pumpState == LOW) {

    digitalWrite(ledAuto, HIGH);
    digitalWrite(ledManual, LOW);

  //Start operation
    if (stateStart == LOW) {

      digitalWrite(ledOperation, HIGH);

    for (pos1; pos1 < 90; pos1++) {
        delay(servoSpeed);
        servo1.write(pos1);
      }

    for (pos1; pos1 > 90; pos1--) {
        delay(servoSpeed);
        servo1.write(pos1);
      }

    for (pos4; pos4 < 146; pos4++) {
      delay(servoSpeed);
      servo4.write(pos4);
     }

     for (pos4; pos4 > 146; pos4--) {
      delay(servoSpeed);
      servo4.write(pos4);
     }

    for (pos3; pos3 < 111; pos3++) {
      delay(servoSpeed);
      servo3.write(pos3);
    }

    for (pos3; pos3 > 111; pos3--) {
      delay(servoSpeed);
      servo3.write(pos3);
    }

    for (pos2; pos2 < 23; pos2++) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    for (pos2; pos2 > 23; pos2--) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    for (pos2; pos2 < 35; pos2++) {
      delay(servoSpeed);
      servo2.write(pos2);
    }
    
    for (pos1; pos1 > 60; pos1--) {
      delay(servoSpeed);
      servo1.write(pos1);
    }

    for (pos2; pos2 > 20; pos2--) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    delay(500);
    digitalWrite(relay, LOW);
    digitalWrite(ledPump, HIGH);
    delay(1000);

    for (pos2; pos2 < 35; pos2++) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    for (pos1; pos1 < 170; pos1++) {
      delay(servoSpeed);
      servo1.write(pos1);
    }

    for (pos2; pos2 < 80; pos2++) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    for (pos3; pos3 > 75; pos3--) {
      delay(servoSpeed);
      servo3.write(pos3);
    }

    for (pos4; pos4 > 70; pos4--) {
      delay(servoSpeed);
      servo4.write(pos4);
     }

     for (pos1; pos1 > 15; pos1--) {
      delay(servoSpeed);
      servo1.write(pos1);
    }

    for (pos4; pos4 < 146; pos4++) {
      delay(servoSpeed);
      servo4.write(pos4);
     }

     for (pos3; pos3 < 111; pos3++) {
      delay(servoSpeed);
      servo3.write(pos3);
    }

    for (pos1; pos1 < 120; pos1++) {
      delay(servoSpeed);
      servo1.write(pos1);
    }

    for (pos2; pos2 > 20; pos2--) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    delay(1000);
    digitalWrite(relay, HIGH);
    digitalWrite(ledPump, LOW);
    delay(500); 

    for (pos2; pos2 <35; pos2++) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

    for (pos1; pos1 > 90; pos1--) {
      delay(servoSpeed);
      servo1.write(pos1);
    }

    for(pos2; pos2 > 23; pos2--) {
      delay(servoSpeed);
      servo2.write(pos2);
    }

   digitalWrite(ledOperation, LOW); 
     
  }
 }
}

//Made by: Tine Logar (2017)

Schematics

Schematic
Shema pybqvzijxu

Comments

Similar projects you might like

MeArm Robot Arm - Your Robot - V1.0

Project tutorial by Benjamin Gray

  • 29,573 views
  • 4 comments
  • 42 respects

Tertiarm - 3d Printed Robot Arm

Project tutorial by Karagad

  • 9,545 views
  • 2 comments
  • 21 respects

Arduino - Control Arm Robot via Web

Project tutorial by phpoc_man

  • 19,967 views
  • 25 comments
  • 171 respects

Control Robot Arm with your Android Phone

Project tutorial by Ammar Atef Ali

  • 13,626 views
  • 0 comments
  • 25 respects
Add projectSign up / Login