Sistem Kerja Alat
Security Box atau berangkas dengan sistem keamanan fingerprint berbasis Arduino. Brangkas dapat dibuka hanya dengan sidik jari orang yang terdaftar pada sensor fingerprint.
Kebutuhan Hardware
- Arduino UNO Board
- Sensor Fingerprint
- Buzzer
- Modul Relay
- Power Supply 7-9 Vdc
Modul Sensor Fingerprint (Source)
Schematics
Koneksi Arduino UNO dengan Modul Fingerprint
Koneksi Arduino UNO dengan Relay
Koneksi Arduino UNO dengan Buzzer
Source Code/Sketch
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
int getFingerprintIDez();
boolean sidik_benar=false;
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
char kode,i;
void setup()
{
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
kode=10; //kode sidik jari (ID sidik jari)
finger.begin(57600);
//-----------------BUZZER BUNYI TIT 2X
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
}
//=======================prog utama
void loop(){
i=1;
while(i){
getFingerprintID();
delay(50);
}
}
//===================================
// returns p if failed, otherwise returns ID #
uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return p;
p = finger.image2Tz();
if (p != FINGERPRINT_OK) return p;
p = finger.fingerFastSearch();
//jika sidik jari salah kembali baca sensor
if (p == FINGERPRINT_NOTFOUND && sidik_benar==false){
for(char i; i<50; i++){
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
}
return p;
}
//jika sidik jari benar kerjakan kontrol relay
if (p != FINGERPRINT_OK ) return p;
kontrol_relay();
return finger.fingerID;
}
void kontrol_relay(){
if(finger.fingerID==kode){
//============pembacaan sidik jari pertama saat buka box
if(sidik_benar==false){
// RELAY ON
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(300);
digitalWrite(9, LOW);
sidik_benar=true;
}
//==========pembacaan sidik jari ke dua saat tutup box
else{
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
delay(300);
digitalWrite(9, LOW);
i=0;
sidik_benar=false;
}
}
}
#include <SoftwareSerial.h>
int getFingerprintIDez();
boolean sidik_benar=false;
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
char kode,i;
void setup()
{
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
kode=10; //kode sidik jari (ID sidik jari)
finger.begin(57600);
//-----------------BUZZER BUNYI TIT 2X
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
}
//=======================prog utama
void loop(){
i=1;
while(i){
getFingerprintID();
delay(50);
}
}
//===================================
// returns p if failed, otherwise returns ID #
uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return p;
p = finger.image2Tz();
if (p != FINGERPRINT_OK) return p;
p = finger.fingerFastSearch();
//jika sidik jari salah kembali baca sensor
if (p == FINGERPRINT_NOTFOUND && sidik_benar==false){
for(char i; i<50; i++){
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
}
return p;
}
//jika sidik jari benar kerjakan kontrol relay
if (p != FINGERPRINT_OK ) return p;
kontrol_relay();
return finger.fingerID;
}
void kontrol_relay(){
if(finger.fingerID==kode){
//============pembacaan sidik jari pertama saat buka box
if(sidik_benar==false){
// RELAY ON
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(300);
digitalWrite(9, LOW);
sidik_benar=true;
}
//==========pembacaan sidik jari ke dua saat tutup box
else{
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
delay(300);
digitalWrite(9, LOW);
i=0;
sidik_benar=false;
}
}
}
Jalannya Alat
Sebelum digunakan terlebih dahulu Anda daftarkan sidik jari Anda pada sensor fingerprint menggunakan program enroll Anda bisa lihat pada proyek interfacing Arduino Sensor Fingerprint atau proyek Simpan Sidik Jari Tampilan LCD.
Letakan jari pada sensor fingerprint kunci akan terbuka otomatis sehingga brangkas bisa dibuka. Sedangkan untuk mengunci kembali letakkan jari pada fingerprint.
Video Project V - 35. Security Box menggunakan sensor Sidik Jari berbasis Arduino Uno
KONTAK KAMI 085743320570 (adi sanjaya)
No comments:
Post a Comment