i
ABSTRAK
ii
Universitas Kristen Maranatha
ABSTRACT
iii
DAFTAR ISI
ABSTRAK ... i
ABSTRACT... ii
DAFTAR ISI... iii
DAFTAR GAMBAR ... iv
DAFTAR TABEL ... vii
BAB I PENDAHULUAN... 1
1.1 Latar Belakang ... 1
1.2 Identifikasi Masalah ... 1
1.3 Tujuan Masalah... 2
1.4 Pembatasan Masalah... 2
1.5 Sistematika Penelitian... 2
BAB II LANDASAN TEORI ... 4
2.1 Motor ... 4
2.2 Arduino ... 5
2.2.1 Terminal pada Arduino ... 6
2.2.2 Pemrograman ... 8
2.2.4 Bahasa Pemrograman Arduino... 10
2.3 Mikrokontroler ... 19
2.4 Input/Output shield... 20
2.5 ATMega 328 ... 21
2.6 Bluetooth module V3 ... 22
2.7 Roda ... 23
iv
Universitas Kristen Maranatha
2.9 Kamera IP ... 26
2.10 Microsoft Visual Studio 2010 ... 32
BAB III PENELITIAN ... 34
3.1 Perangkat Keras ... 34
3.2 Flowchart ... 35
3.3 Skematik Rangkaian ... 38
3.4 Struktur Robot ... 40
3.5 Program Pengendali ... 41
BAB IV IMPLEMENTASI ... 46
4.1 Rangkaian Secara Menyeluruh ... 45
4.1.1 Rangkaian Arudino ... 45
4.1.2 Rangkaian I/O shield... 46
4.1.3 Modul Bluetooth... 46
4.1.4 Motor DC ... 46
4.1.5 Rangkaian Motor Driver ... 48
4.2 Hasil Akhir ... 49
BAB V KESIMPULAN DAN SARAN ... 52
5.1 Kesimpulan ... 53
5.2 Saran ... 53
DAFTAR PUSTAKA... 54
Lampiran program robot ... A-1
v
DAFTAR GAMBAR
Gambar 2.1 Motor DC ... 4
Gambar 2.2 Arduino ... 6
Gambar 2.3 Tampilan Arduino 022 ... 8
Gambar 2.4 New Project ... 9
Gambar 2.5 Board Select... 9
Gambar 2.6 Serial Port Select... 10
Gambar 2.7 I/O Shield ... 20
Gambar 2.8 Modul Bluetooth... 22
Gambar 2.9 L293D... 24
Gambar 2.10 L293D datasheet ... 24
Gambar 2.11 Blok Diagram L293D ... 26
Gambar 2.12 IC-3005 IP Camera ... 27
Gambar 2.13 Setup Network Connection ... 28
Gambar 2.14 Choose Connection Option ... 29
Gambar 2.15 Give Network Name and Seciruty... 30
Gambar 2.16 IP address... 30
Gambar 2.17 Camera Home... 31
vi
Universitas Kristen Maranatha
Gambar 2.19 Tampilan Awal ... 32
Gambar 2.20 Tampilan Utama ... 33
Gambar 3.1 Blok Diagram ... 34
Gambar 3.2 Flowchart 1 ... 35
Gambar 3.3 Flowchart 2 ... 36
Gambar 3.4 Flowchart 3 ... 37
Gambar 3.5 Skematik Rangkaian ... 39
Gambar 3.6 Tampak Samping ... 40
Gambar 3.7 Tampak Depan dan Belakang... 40
Gambar 3.8 flowchart 1 ... 41
Gambar 3.9 flowchart 2 ... 42
Gambar 3.10 flowchart 3 ... 43
Gambar 3.11 program pengendali ... 44
Gambar 4.1 Arduino ... 45
Gambar 4.2 I/O Shield ... 46
Gambar 4.3 Motor DC ... 47
Gambar 4.4 Rangkaian motor driver ... 48
vii
DAFTAR TABEL
Tabel 3.1 Konfigurasi Pin ... 39
A-1
Universitas Kristen Maranatha
Lampiran A
Program robot
int motorPin1 = 2;
int motorPin2 = 3;
int motorPin3 = 4;
int motorPin4 = 7;
int motorPin5 = 8;
int motorPin6 = 9;
/*variabel untuk pin*/
int motorPin7 = 12;
int motorPin8 = 13;
int enable1 = 5;
int enable2 = 6;
int enable3 = 10;
int enable4 = 11;
int v = 255;
char val;
void setup() {
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
pinMode(motorPin5, OUTPUT);
pinMode(motorPin6, OUTPUT);
pinMode(motorPin7, OUTPUT);
pinMode(motorPin8, OUTPUT);
pinMode(enable1, OUTPUT);
pinMode(enable2, OUTPUT); /*insialisasi pin sebagai output*/
pinMode(enable3, OUTPUT);
pinMode(enable4, OUTPUT);
analogWrite(enable1,v);
A-2
analogWrite(enable4,v);
Serial.begin(9600);
/*buka port serial untuk komunikasi serial
Serial.print("speed = "); dengan baud rate 9600*/
Serial.println(v);
/*kirim data ke serial port*/
}
void loop() {
if(Serial.available())
/*deteksi data dari serial port*/
{
val = Serial.read();
/*menerima data dari serial port*/
}
if(val == 'r')
{
v = v + 1;
/*jika data r ta bah ilai v da beri ilai
analogWrite(A0,v);
pwm pada pin sesuai dengan nilai v*/
analogWrite(A1,v);
analogWrite(A2,v);
analogWrite(A3,v);
Serial.print("speed = ");
Serial.println(v);
}
if(val == 'f')
{
v = v - 1;
/*jika data f kura gi ilai v da beri ilai
analogWrite(A0,v);
pwm pada pin sesuai dengan nilai v*/
analogWrite(A1,v);
analogWrite(A2,v);
analogWrite(A3,v);
Serial.print("speed = ");
Serial.println(v);
}
if(val == 'a')
{
digitalWrite(motorPin1, HIGH);
A-3 Universitas Kristen Marnatha
digitalWrite(motorPin5, LOW);
,7*/
digitalWrite(motorPin6, HIGH);
digitalWrite(motorPin7, LOW);
digitalWrite(motorPin8, HIGH);
} else if(val == 'd')
{
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
/*jika data d beri ilai HIGH
digitalWrite(motorPin3, LOW);
pada motor pin 2,4,5,7 dan
digitalWrite(motorPin4, HIGH);
nilai LOW pada pin 1,3,6,8*/
digitalWrite(motorPin5, HIGH);
digitalWrite(motorPin6, LOW);
digitalWrite(motorPin7, HIGH);
digitalWrite(motorPin8, LOW);
}
else if(val == 'w')
{
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
digitalWrite(motorPin5, HIGH);
digitalWrite(motorPin6, LOW);
digitalWrite(motorPin7, LOW);
digitalWrite(motorPin8, HIGH);
}else if(val == 'x')
{
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
digitalWrite(motorPin5, LOW);
digitalWrite(motorPin6, LOW);
digitalWrite(motorPin7, LOW);
digitalWrite(motorPin8, LOW);
}else if(val == 's')
A-4
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
digitalWrite(motorPin5, LOW);
digitalWrite(motorPin6, HIGH);
digitalWrite(motorPin7, HIGH);
digitalWrite(motorPin8, LOW);
}
B-1
Universitas Kristen Marnatha
Lampiran B
Program pengendali
#pragmaonce
namespace serial {
usingnamespace System;
usingnamespace System::ComponentModel;
usingnamespace System::Collections;
usingnamespace System::Windows::Forms;
usingnamespace System::Data;
usingnamespace System::Drawing;
/// <summary>
/// Summary for Form1 ///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form.
/// </summary>
publicrefclass Form1 : public System::Windows::Forms::Form {
public:
Form1(void) {
InitializeComponent(); //
//TODO: Add the constructor code here //
}
protected:
/// <summary>
B-2
~Form1() {
if (components) {
delete components; }
}
private: System::IO::Ports::SerialPort^ serialPort1;
protected:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
private: System::Windows::Forms::Button^ button7;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Required designer variable. /// </summary>
#pragmaregion Windows Form Designer generated code /// <summary>
/// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary>
void InitializeComponent(void) {
this->components = (gcnew
System::ComponentModel::Container());
this->serialPort1 = (gcnew
System::IO::Ports::SerialPort(this->components));
this->button1 = (gcnew
System::Windows::Forms::Button());
this->button2 = (gcnew
System::Windows::Forms::Button());
this->button3 = (gcnew
System::Windows::Forms::Button());
this->button4 = (gcnew
B-3
Universitas Kristen Marnatha
this->button5 = (gcnew
System::Windows::Forms::Button());
this->button6 = (gcnew
System::Windows::Forms::Button());
this->button7 = (gcnew
System::Windows::Forms::Button());
this->SuspendLayout(); //
// serialPort1 //
this->serialPort1->PortName = L"COM9";
this->serialPort1->WriteBufferSize = 128; //
// button1 //
this->button1->Location = System::Drawing::Point(193, 63);
this->button1->Margin = System::Windows::Forms::Padding(2);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(61, 37);
this->button1->TabIndex = 0;
this->button1->Text = L"Maju";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// button2 //
this->button2->Location = System::Drawing::Point(191, 205);
this->button2->Margin = System::Windows::Forms::Padding(2);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(63, 35);
this->button2->TabIndex = 1;
this->button2->Text = L"Mundur";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
B-4
this->button3->Location = System::Drawing::Point(69, 147);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(75, 23);
this->button3->TabIndex = 2;
this->button3->Text = L"Kiri";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
//
// button4 //
this->button4->Location = System::Drawing::Point(299, 147);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(75, 23);
this->button4->TabIndex = 3;
this->button4->Text = L"Kanan";
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
//
// button5 //
this->button5->Location = System::Drawing::Point(191, 144);
this->button5->Name = L"button5";
this->button5->Size = System::Drawing::Size(65, 28);
this->button5->TabIndex = 4;
this->button5->Text = L"stop";
this->button5->UseVisualStyleBackColor = true; //
// button6 //
this->button6->Location = System::Drawing::Point(12, 70);
this->button6->Name = L"button6";
this->button6->Size = System::Drawing::Size(39, 23);
this->button6->TabIndex = 5;
this->button6->Text = L"+";
this->button6->UseVisualStyleBackColor = true;
this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
B-5
Universitas Kristen Marnatha // button7
//
this->button7->Location = System::Drawing::Point(12, 241);
this->button7->Name = L"button7";
this->button7->Size = System::Drawing::Size(39, 23);
this->button7->TabIndex = 6;
this->button7->Text = L"-";
this->button7->UseVisualStyleBackColor = true;
this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click);
// // Form1 //
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(451, 370);
this->Controls->Add(this->button7);
this->Controls->Add(this->button6);
this->Controls->Add(this->button5);
this->Controls->Add(this->button4);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Margin = System::Windows::Forms::Padding(2);
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->Leave += gcnew System::EventHandler(this, &Form1::Form1_Leave);
this->ResumeLayout(false);
}
#pragmaendregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
serialPort1->Open(); }
B-6
serialPort1->Write("w"); }
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
serialPort1->Write("s"); }
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
serialPort1->Write("d"); }
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
serialPort1->Write("a"); }
private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
serialPort1->Write("r"); }
private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) {
serialPort1->Write("f"); }
private: System::Void Form1_Leave(System::Object^ sender, System::EventArgs^ e) {
//serialPort1->Close(); }
1
Universitas Kristen Maranatha
BAB I
PENDAHULUAN
1.1 Latar Belakang
Robot adalah sebagai sebuah mesin yang dapat bekerja secara terus
menerus baik secara otomatis maupun terkendali. Robot digunakan untuk
membantu tugas-tugas manusia mengerjakan hal-hal yang sulit atau tidak
bisa dilakukan manusia secara langsung. Misalnya untuk menangani material
radio aktif, merakit mobil dalam industri perakitan mobil, menjelajah planet
lain, sebagai media pertahanan atau perang, dan sebagainya. Selain itu
dengan berkembangnya pengetahuan dan teknologi kini orang berlomba
-lomba untuk menciptakan robot.
Salah satu robot yang saat ini sering digunakan oleh militer adalah robot
surveillance. Dengan robot ini para tentara tidak perlu mengintai suatu lokasi
yang berbahaya secara langsung, sebagai penggantinya robot digunakan
untuk melakukan tugas itu sehingga tidak perlu membahayakan nyawa
manusia.
Prinsip dasar dari robot ini adalah sebuah sistem penggerak nirkabel
dengan teknologi bluetooth yang dikontrol dengan menggunakan komputer
dan sebuah kamera IP yang diletakan di atas robot. Kamera tersebut akan
mentransmisikan video secara langsung ke komputer sehingga pengguna
dapat melihat objek yang dilihat oleh robot
1.2 Identifikasi Masalah
1. Bagaimana cara merancang dan membuat robot surveillance ?
2
1.3 Tujuan
1. Membuat robot surveillance yang dapat dikontrol jarak jauh
dengan menggunakan Bluetooth.
2. Membuat program untuk robot surveillance agar dapat
menerima perintah dari user dan program untuk mengirimkan
perintah ke robot surveillance
1.4 Pembatasan Masalah
Berikut adalah hal-hal yang menjadi batasan masalah pembuatan Kerja
Praktek ini:
1. Robot ini menggunakan modul microcontroller arduino
duemillanov dengan AT mega 328
2. Robot ini dikontrol secara wireless dengan teknologi
Bluetooth
3. Robot ini menerima perintah dari komputer user
4. Robot menggunakan kamera IP
1.5 Sistematika Penelitian
Bab 1 : Pendahuluan
Bab ini membahas tentang latar belakang, identifikasi masalah,
tujuan masalah, pembatasan masalah, dan sistematika
penelitian.
Bab 2 : Landasan Teori
Bab ini membahas tentang teori-teori dasar dari
komponen-komponen yang digunakan pada robot surveillance.
3
Universitas Kristen Maranatha
Bab ini berisi perancangan perangkat keras dan perangkat lunak.
Bab 4 : Implementasi
Bab ini membahas tentang pengamatan dan pengujian dari robot
surveillance.
Bab 5 : Kesimpulan dan saran
Bab ini merupakan bab penutup yang memuat tentang
52
BAB V
KESIMPULAN DAN SARAN
5.1 Kesimpulan
Dari hasil perancangan dan pembuatan robot Surveillance
ini, dapat disimpulkan bahwa :
1. Robot Surveillance telah berhasil dibuat dengan
menggunakan modul Arduino, modul Bluetooth, dan IP
camera.
2. jarak jelajah pada robot terbatas, hanya sekitar 30 meter.
3. Robot berhasil mengikuti perintah yang dikirimkan oleh
user
5.2 Saran
Setelah merancang, membuat dan mengevaluasikan robot
surveillance maka harapan ke depan robot ini dapat
dikembangkan lagi:
1. Membuat dengan ukuran yang lebih ringkas.
2. Membuat dengan sistem yang lebih baik (rangkaian robot
dan sistem kamera yang tidak terpisah).
3. Menggunakan teknologi wireless yang lebih baik (jarak
53
Universitas Kristen Marnatha
Daftar Pustaka
Darmawan, Aan, Modul Pelatihan Arduino Teknik Elektro Universitas Kristen
Marnatha, Teknik Elektro UKM, 2011.
Andrianto, Heri, Pemrograman Mikrokontroler AVR ATMEGA16 menggunakan
Bahasa C (CodeVision AVR), Penerbit Informatika, Bandung , 2008
Tim Pustena ITB, Jurus Kilat Jago membuat Robot, Penerbit Dunia Komputer,
Bekasi, 2011
Tim Lab Mikroprosesor, Pemrograman Mikrokontroler AT89S51 dengan C/C++
dan Assembler, Penerbit Andi, Yogyakarta, 2007
Wahyudi, Didin, Belajar Mudah Mikrokontroler AT89S52 dengan Bahasa BASIC
Menggunakan BASCOM-8051, Penerbit Andi, Yogyakarta, 2007
http://pentriloquist.wordpress.com/2009/01/09/membuat-robot-line-follower-sederhana/
http://www.kmitl.ac.th/~kswichit/ROBOT/Follower.pdf
http://www.robotindonesia.com/article/an0020.pdf