DAFTAR PUSTAKA
Arduino RFID Library. https: //www.arduino.cc/en/Reference/RFID (diakses pada bulan April 2016)
Abidin, Zaenal. 2016. Miniatur Palang Pintu Otomatis Pada Perlintasan Kereta Api Menggunakan RFID, Skripsi Sarjana-1, Jurusan Teknik Elektro. Fakultas Teknik, Universitas Mercu Buana, Jakarta.
Hidajanto, Djamal. 2014. Radio Frequency Identification (RFID) dan
Aplikasinya. Jurnal TELA/VOL. 16/ NO. 1/ Maret 2014
Maulida, Inaki. 2009. Perancangan Simulator Modul Distribusi dengan Teknologi Rfid Pada Skala Laboratorium. Skripsi Sarjana-1, Jurusan Teknik Industri, Fakultas Teknik, Universitas Sebelas Maret, Surakarta.
Ricoh Z. Winerungan. dan sherwin R.U.A Sompie,ST, MT. 2014/ ISSN : 2301 - 8402 . Rancang Bangun alat identifikasi pada pintu portal menggunakan sistem RFID. Jurnal. Elektro FT. UNSRAT. Manado Sulawesi Utara.
xvii http://digilib.mercubuana.ac.id/
Lampiran 1 #include <SoftwareSerial.h> #include <Servo.h> #include
SoftwareSerial RFID(52, 53); // RX dan TX Servo gerbang_satu; Servo gerbang_dua; Servo gerbang_tiga; Servo gerbang_empat; LiquidCrystal lcd (7, 6, 5, 4, 3, 2);
int data1 = 0; int ok = -1; int pos_gerbang_satu = 0; int pos_gerbang_dua = 0; int pos_gerbang_tiga = 0; int pos_gerbang_empat = 0; int steps = 0; int iden = 0;
int ledjalur_satu = 24; int ledjalur_dua = 26; int weseljalur_masuk = 25; int weseljalur_keluar = 27;
int semboyankuning_satu = 32; int semboyanmerah_satu = 33; int semboyankuning_dua = 34; int semboyanmerah_dua = 35;
int sinyalhijau_satu = 40; int sinyalmerah_satu = 41;
http://digilib.mercubuana.ac.id/
int sinyalhijau_dua = 42; int sinyalmerah_dua = 43;
int buzzer_satu = 48; int buzzer_dua = 49;
int tag1[14] = {2, 48, 54, 48, 48, 66, 53, 49, 66, 49, 49, 66, 57, 3}; int tag2[14] = {2, 48, 54, 48, 48, 66, 53, 54, 48, 67, 66, 49, 56, 3}; int tag3[14] = {2, 48, 54, 48, 48, 66, 54, 54, 66, 68, 69, 48, 53, 3}; int tag4[14] = {2, 48, 54, 48, 48, 66, 54, 70, 57, 55, 68, 51, 52, 3}; int newtag[14] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
void setup() { RFID.begin(9600); Serial.begin(9600);
pinMode(ledjalur_satu, OUTPUT); pinMode(ledjalur_dua, OUTPUT); pinMode(weseljalur_masuk, OUTPUT); pinMode(weseljalur_keluar, OUTPUT); digitalWrite(ledjalur_satu, HIGH); digitalWrite(ledjalur_dua, HIGH); digitalWrite(weseljalur_masuk, HIGH); digitalWrite(weseljalur_keluar, HIGH);
gerbang_satu.attach(8); gerbang_dua.attach(9); gerbang_tiga.attach(10); gerbang_empat.attach(11); gerbang_satu.write(0); gerbang_dua.write(180); gerbang_tiga.write(180);
http://digilib.mercubuana.ac.id/
gerbang_empat.write(0);
pinMode(semboyankuning_satu, OUTPUT); pinMode(semboyanmerah_satu, OUTPUT); pinMode(semboyankuning_dua, OUTPUT); pinMode(semboyanmerah_dua, OUTPUT); digitalWrite(semboyanmerah_satu, HIGH); digitalWrite(semboyanmerah_dua, HIGH);
pinMode(sinyalhijau_satu, OUTPUT); pinMode(sinyalmerah_satu, OUTPUT); pinMode(sinyalhijau_dua, OUTPUT); pinMode(sinyalmerah_dua, OUTPUT); digitalWrite(sinyalmerah_satu, HIGH); digitalWrite(sinyalmerah_dua, HIGH);
pinMode(buzzer_satu, OUTPUT); pinMode(buzzer_dua, OUTPUT); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, LOW);
while (steps == 0) { lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("AKHMADI"); lcd.setCursor(0, 1); lcd.print("41412010015"); delay(3000); lcd.clear(); steps = 1; }
http://digilib.mercubuana.ac.id/
while (steps == 1) { lcd.setCursor(0, 0); lcd.print("FAKULTAS"); lcd.setCursor(0, 1); lcd.print("TEKNIK ELEKTRO"); delay(3000); lcd.clear(); steps = 2; }
while (steps == 2) { lcd.setCursor(0, 0); lcd.print("UNIVERSITAS"); lcd.setCursor(0, 1); lcd.print("MERCUBUANA"); delay(3000); lcd.clear(); steps = 0; } }
boolean comparetag(int aa[14], int bb[14]) { boolean ff = false; int fg = 0; for (int cc = 0 ; cc < 14 ; cc++) { if (aa[cc] == bb[cc]) { fg++; }
http://digilib.mercubuana.ac.id/
} if (fg == 14) { ff = true; } return ff; }
void checkmytags() { ok = 0; if (comparetag(newtag, tag2) == true) { ok = 1; } if (comparetag(newtag, tag1) == true) { ok = 2; } if (comparetag(newtag, tag3) == true) { ok = 3; } if (comparetag(newtag, tag4) == true) { ok = 4; } }
void readTags() { ok = 0; if (RFID.available() > 0) { delay(100);
for (int z = 0 ; z < 14 ; z++)
http://digilib.mercubuana.ac.id/
{ data1 = RFID.read(); newtag[z] = data1; } RFID.flush();
checkmytags(); }
if (ok == 1) { gerbang_satu.write(90); gerbang_dua.write(90); digitalWrite(ledjalur_satu, LOW); digitalWrite(semboyankuning_satu, HIGH); digitalWrite(semboyanmerah_satu, LOW); digitalWrite(sinyalhijau_satu, HIGH); digitalWrite(sinyalmerah_satu, LOW); lcd.setCursor(0, 0); lcd.print("BUKA GERBANG"); lcd.setCursor(0, 1); lcd.print("JALUR SATU"); delay(2500); lcd.clear(); }
else if (ok == 2) { gerbang_tiga.write(90); gerbang_empat.write(90); digitalWrite(ledjalur_dua, LOW); digitalWrite(weseljalur_masuk, LOW); digitalWrite(weseljalur_keluar, LOW);
http://digilib.mercubuana.ac.id/
digitalWrite(semboyankuning_dua, HIGH); digitalWrite(semboyanmerah_dua, LOW); digitalWrite(sinyalhijau_dua, HIGH); digitalWrite(sinyalmerah_dua, LOW); lcd.setCursor(0, 0); lcd.print("BUKA GERBANG"); lcd.setCursor(0, 1); lcd.print("JALUR DUA"); delay(2500); lcd.clear(); }
else if (ok == 3) { lcd.setCursor(0, 0); lcd.print("JALUR SATU AMAN"); lcd.setCursor(0, 1); lcd.print("TUTUP GERBANG"); delay(1000); gerbang_satu.write(0); gerbang_dua.write(180); digitalWrite(ledjalur_satu, HIGH); digitalWrite(semboyankuning_satu, LOW); digitalWrite(semboyanmerah_satu, HIGH); digitalWrite(sinyalhijau_satu, LOW); digitalWrite(sinyalmerah_satu, HIGH); lcd.clear(); }
else if (ok == 4) { lcd.setCursor(0, 0); lcd.print("JALUR DUA AMAN");
http://digilib.mercubuana.ac.id/
lcd.setCursor(0, 1); lcd.print("TUTUP GERBANG"); delay(1000); gerbang_tiga.write(180); gerbang_empat.write(0); digitalWrite(ledjalur_dua, HIGH); digitalWrite(weseljalur_masuk, HIGH); digitalWrite(weseljalur_keluar, HIGH); digitalWrite(semboyankuning_dua, LOW); digitalWrite(semboyanmerah_dua, HIGH); digitalWrite(sinyalhijau_dua, LOW); digitalWrite(sinyalmerah_dua, HIGH); lcd.clear(); } }
void stasiun() { if (ok == 1) { while (steps == 0) { digitalWrite(buzzer_satu, HIGH); digitalWrite(buzzer_dua, LOW); delay(200); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, HIGH); delay(200); digitalWrite(buzzer_satu, HIGH); digitalWrite(buzzer_dua, LOW); delay(200); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, HIGH);
http://digilib.mercubuana.ac.id/
delay(200); digitalWrite(buzzer_satu, HIGH); digitalWrite(buzzer_dua, LOW); delay(200); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, LOW); delay(200); steps = 1; } while (steps == 1) { lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("KERETA API"); lcd.setCursor(0, 1); lcd.print("KELAS EXECUTIF"); delay(4000); lcd.clear(); steps = 0; } }
else if (ok == 2) { while (steps == 0) { digitalWrite(buzzer_satu, HIGH); digitalWrite(buzzer_dua, LOW); delay(200); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, HIGH); delay(200); digitalWrite(buzzer_satu, HIGH);
http://digilib.mercubuana.ac.id/
digitalWrite(buzzer_dua, LOW); delay(200); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, HIGH); delay(200); digitalWrite(buzzer_satu, HIGH); digitalWrite(buzzer_dua, LOW); delay(200); digitalWrite(buzzer_satu, LOW); digitalWrite(buzzer_dua, LOW); delay(200); steps = 1; } while (steps == 1) { lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("KERETA API"); lcd.setCursor(0, 1); lcd.print("KELAS BISNIS"); delay(4000); lcd.clear(); steps = 0; } } }
void loop() { readTags(); stasiun(); }
http://digilib.mercubuana.ac.id/
Lampiran 2
int out_A_pwm = 3; int out_A_in_1 = 9; int out_A_in_2 = 8; int out_stby = 12;
void setup() { pinMode(out_A_pwm, OUTPUT); pinMode(out_A_in_1, OUTPUT); pinMode(out_A_in_2, OUTPUT); pinMode(out_stby, OUTPUT); digitalWrite(out_stby, HIGH); digitalWrite(out_A_in_1, HIGH); digitalWrite(out_A_in_2, LOW); }
void kecepatan() { digitalWrite(out_stby, HIGH); digitalWrite(out_A_in_1, HIGH); digitalWrite(out_A_in_2, LOW); analogWrite(out_A_pwm, 150); }
void loop() { kecepatan(); }
http://digilib.mercubuana.ac.id/