Robot Arm |
Robot Arm atau bisa disebut juga robot manipulator adalah perangkat yang digunakan untuk memanipulasi bahan tanpa kontak langsung. Awalnya robot ini dikembangkan untuk berurusan dengan bahan radioaktif atau bahan beracun dan berbahaya, atau tempat yang susah dijangkau. Namun dalam perkembangannya banyak industri yang memanfaatkan robot arm untuk memproduksi suatu produk. Kita ambil contoh, dalam industri otomatif, robot arm digunakan untuk merakit mobil.
Industri assembly mobil. |
Kami menggunakan driver relay untuk menggatur putaran motor. Penulis menggunakan 8 relay untuk mengaktifkan motor robot arm. Untuk mengontrol pergerakan motor robot arm kita membutuhkan 8 pin arduino.
Rangkaian Driver Relay |
Pada postingan kali ini, kita akan mengulas tentang mengotrol robot arm menggunakan arduino dan visual basic.NET secara sederhana jadi untuk pengembangannya dapat kita kembangkan sendiri, misalkan kita tambahkan sensor yang bisa mendeteksi benda dan robot arm secara otomatis akan mengambil benda tersebut.
Langkah pertama yang kita lakukan adalah melakukan pemprogaman arduino, kita akan menggunakan fasilitas serial untuk mengirim data dan menerima data. Kita menggunakan pin 6 sampai 13 untuk menggontrol relay. berikut listing program arduino
const int led1 = 6;
const int led2 = 7;
const int led3 = 8;
const int led4 = 9;
const int led5 = 10;
const int led6 = 11;
const int led7 = 12;
const int led8 = 13;
String datamasukkan;
void setup() {
Serial.begin(9600);
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
pinMode(led5,OUTPUT);
pinMode(led6,OUTPUT);
pinMode(led7,OUTPUT);
pinMode(led8,OUTPUT);
}
void loop() {
if(Serial.available()>0) {
datamasukkan = Serial.readStringUntil('\n');
Serial.print("anda mengetikkan: ");
Serial.print(datamasukkan);
if(datamasukkan =="a"){
digitalWrite(led1,HIGH);
}
if(datamasukkan =="A"){
digitalWrite(led1,LOW);
}
if(datamasukkan =="b"){
digitalWrite(led2,HIGH);}
if(datamasukkan =="B"){
digitalWrite(led2,LOW);};
if(datamasukkan =="c"){
digitalWrite(led3,HIGH);};
if(datamasukkan =="C"){
digitalWrite(led3,LOW);};
if(datamasukkan =="d"){
digitalWrite(led4,HIGH);};
if(datamasukkan =="D"){
digitalWrite(led4,LOW);};
if(datamasukkan =="e"){
digitalWrite(led4,HIGH);};
if(datamasukkan =="E"){
digitalWrite(led4,LOW);};
if(datamasukkan =="f"){
digitalWrite(led4,HIGH);};
if(datamasukkan =="F"){
digitalWrite(led4,LOW);};
if(datamasukkan =="g"){
digitalWrite(led4,HIGH);};
if(datamasukkan =="G"){
digitalWrite(led4,LOW);};
if(datamasukkan =="h"){
digitalWrite(led4,HIGH);};
if(datamasukkan =="H"){
digitalWrite(led4,LOW);};
}}
Download program arduino disini.
Langkah kedua yang harus kita lakukan adalah membuat interface visual basic 2010 seperti dibawah ini.
Berikut listing program vb.Net
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'SerialPort1.write ("a" +Chr(13))
SerialPort1.Write("a")
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
SerialPort1.PortName = "COM6"
SerialPort1.Baudrate = 9600
SErialPort1.Parity = IO.Ports.Parity.None
SerialPort1.StopBits = IO.Ports.StopBits.One
SerialPort1.DataBits = 8 'open serial port
SerialPort1.Open()
If SerialPort1.IsOpen = False Then
MsgBox("Cek koneksi", vbCritical)
Else
Button8.Enabled = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SerialPort1.Write("A")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
SerialPort1.Write("b")
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
SerialPort1.Write("B")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
SerialPort1.Write("c")
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
SerialPort1.Write("C")
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
SerialPort1.Write("d")
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
SerialPort1.Write("e")
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
SerialPort1.Write("g")
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
SerialPort1.Write("D")
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
SerialPort1.Write("E")
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
SerialPort1.Write("f")
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
SerialPort1.Write("F")
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
SerialPort1.Write("G")
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
SerialPort1.Write("h")
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
SerialPort1.Write("H")
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
SerialPort1.Close()
Button1.Enabled = True
End Sub
End Class
Download program interface disini.