Project showcase
Arm Robot Automatic Conveyor Container On Tea Factory

Arm Robot Automatic Conveyor Container On Tea Factory © GPL3+

Line follower made of infrared, photodiode and ultrasonic sensors readout for the tea pack has go down, processing by Arduino.

  • 1,928 views
  • 1 comment
  • 9 respects

Components and supplies

Apps and online services

About this project

A development of computer technology in order to facilitate the work of a human is a robot. Of the many types of robots, line followers are the most popular. Line follower robots can be developed into robotic arms, a robot that can follow a line and put packs on a conveyor.

The use of a robotic arm in industry can be applied as a means of sorting objects. Robot arm objects sorter by distance does the job automatically classify objects by distance then arrange according to a prearranged place. There are ways of operation, namely by way of automatic. With the robot arm automatic system will work according to the readings of the sensor. Used sensors line followers made of infrared and photodiode and ultrasonic sensor readout for malware the tea pack has go down, processing by the Arduino. Then the robot arm and gripper as appropriate actuators do the task of sensor readings.

Code

Arm Robot Automatic Conveyor Containet On Tea FactoryArduino
Arduino IDE
// *****************************
// Arm Robot Automatic Conveyor Containet On Tea Factory
// Abraham Patria Yudha Krisnanda
// 2137200777
// Program Studi Sistem Komputer
// STMIK AUB Surakarta
// *****************************
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);

// Depending on your servo make, the pulse width min and max may vary, you 
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have!
#define SERVOMIN  125 // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX  575 // this is the 'maximum' pulse length count (out of 4096)

// our servo # counter
uint8_t servonum = 1;
#include <AFMotor.h>
#define ECHOPIN A2                           
#define TRIGPIN A0
int jarak,timer;
char val;
AF_DCMotor motor1(3, MOTOR12_64KHZ); //Jadikan motor 2, 64KHz
AF_DCMotor motor2(2, MOTOR12_64KHZ); //Jadikan motor 2, 64KHz

void setup() {
  Serial.begin(9600);
  Serial.println("16 channel Servo test!");

  pwm.begin();
  
  pwm.setPWMFreq(60);  // Analog servos run at ~60 Hz updates
  motor1.setSpeed(225); //Set kecepatan motor 240 (Range 0-255)
  motor2.setSpeed(225); //Set kecepatan motor 240 (Range 0-255)
  Serial.begin(9600); //Kecepatan komunikasi serial

  pinMode(ECHOPIN, INPUT);
  pinMode(TRIGPIN, OUTPUT);
  //yield();
}
void maju()
{
   motor1.run(FORWARD); //Motor kiri maju
    motor2.run(FORWARD); //Motor kiri maju
}
void mundur()
{
   motor1.run(BACKWARD); //Motor kiri maju
    motor2.run(BACKWARD); //Motor kiri maju
}
void kiri()
{
   motor1.run(FORWARD); //Motor kiri maju
    motor2.run(BACKWARD); //Motor kiri maju
}
void kanan()
{
   motor1.run(BACKWARD); //Motor kiri maju
    motor2.run(FORWARD); //Motor kiri maju
     
}
void mati()
{
   motor1.run(RELEASE); //Motor kiri maju
    motor2.run(RELEASE); 
}
// the code inside loop() has been updated by Robojax
void loop() {

// tengah -20 tegak
// capit 60-100
// bawah 0 tegak
     digitalWrite(TRIGPIN, LOW);                   
  delayMicroseconds(2);
  digitalWrite(TRIGPIN, HIGH);                  
  delayMicroseconds(10);
  digitalWrite(TRIGPIN, LOW);  
  timer=0;  
  while(!ECHOPIN);  
  timer = pulseIn(ECHOPIN, HIGH);        
  jarak= timer/58; 
  Serial.println(jarak);
  
  if ( jarak < 15 )
{
  mati();
 delay(500);
pwm.setPWM(4, 1, angleToPulse(150) );
    delay(2000);
    pwm.setPWM(3, 1, angleToPulse(120) );
     pwm.setPWM(2, 1, angleToPulse(20) );
delay(12000); 
pwm.setPWM(4, 1, angleToPulse(60) );
delay(3000); 
//posisi mengambil
 pwm.setPWM(3, 1, angleToPulse(80) );
     pwm.setPWM(2, 1, angleToPulse(35) ); 
delay(3000); 
     pwm.setPWM(1, 1, angleToPulse(100) );
     pwm.setPWM(0, 1, angleToPulse(60) );    
delay(3000); 
     pwm.setPWM(0, 1, angleToPulse(100) );
     pwm.setPWM(1, 1, angleToPulse(60) );

    delay(500);
    pwm.setPWM(3, 1, angleToPulse(120) );
     pwm.setPWM(2, 1, angleToPulse(20) );

    delay(2000);
    pwm.setPWM(3, 1, angleToPulse(180) );
    delay(1000);
     pwm.setPWM(2, 1, angleToPulse(50) );
delay(1000); 
     pwm.setPWM(1, 1, angleToPulse(100) );
     pwm.setPWM(0, 1, angleToPulse(60) );     
    delay(2000);  
    pwm.setPWM(4, 1, angleToPulse(150) );
    delay(2000);
    pwm.setPWM(3, 1, angleToPulse(120) );
     pwm.setPWM(2, 1, angleToPulse(20) );
     delay(2000);
}
 else if ( (digitalRead(2) > 0)&& (digitalRead(0) > 0))
{
  maju();
}
else if ( (digitalRead(2) < 1)&& (digitalRead(0) > 0))
{
  kanan();
}
else if ( (digitalRead(2) > 0)&& (digitalRead(0) < 1))
{
  kiri();
}

 }


/*
 * angleToPulse(int ang)
 * gets angle in degree and returns the pulse width
 * also prints the value on seial monitor
 * written by Ahmad Nejrabi for Robojax, Robojax.com
 */
int angleToPulse(int ang){
   int pulse = map(ang,0, 180, SERVOMIN,SERVOMAX);// map angle of 0 to 180 to Servo min and Servo max 
   Serial.print("Angle: ");Serial.print(ang);
   Serial.print(" pulse: ");Serial.println(pulse);
   return pulse;
}

Schematics

schematic block diagram
Schematic block diagram 9yd81lstl6

Comments

Similar projects you might like

MeArm Robot Arm - Your Robot - V1.0

Project tutorial by Benjamin Gray

  • 19,302 views
  • 3 comments
  • 34 respects

LittleArm: Arduino Robot Arm

Project showcase by Slant Concepts

  • 16,828 views
  • 1 comment
  • 75 respects

Control Arduino Robot Arm with Android App

Project tutorial by Slant Concepts

  • 9,013 views
  • 7 comments
  • 26 respects

Burn-E Paper Craft Robot

Project showcase by Team Ahmed Azouz

  • 1,720 views
  • 0 comments
  • 12 respects

Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

  • 11,942 views
  • 41 comments
  • 100 respects
Add projectSign up / Login