RF-ID DOOR LOCKING SYSTEM || REAL TIME PROJECT


RF-ID DOOR LOCKING SYSTEM

HEY GUYS I CAME UP WITH A NEW REAL TIME PROJECT RF-ID DOOR LOCKING SYSTEM WITH ARDUINO.
THIS PROJECT CAN BE USED IN COLLEGES,SCHOOLS,OFFICE,HOMES,SHOPS ,ETC.


COMPONENTS REQUIRED:-

1. ARDUINO NANO.
2. RFID-RC522 MODULE.
3. RFID TAGS.
4. ZERO PCB.
5. BUZZER.
6. LED'S (GREEN, RED).
7. PUSH BUTTON.
8. FEMALE BERG STRIPE PINS.
9. JUMPER WIRES.
10. 16 X 2 LCD DISPLAY.


CIRCUIT :-








LIBRARY:-

1. RF-ID-MASTER:-

2. DOWNLOAD LIQUID CRYSTAL LIBRARY :-  



SOURCE CODE:-

1. DUMPINFO CODE
UPLOAD THIS CODE FOR SCANNING YOU ID CARDS AND TAGS.

#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN  9 
#define SS_PIN  10 

MFRC522 mfrc522(SS_PIN, RST_PIN); 

void setup() {
Serial.begin(9600);
while (!Serial);
SPI.begin();
mfrc522.PCD_Init();
delay(4);
mfrc522.PCD_DumpVersionToSerial();
Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

void loop() {
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}

// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}

mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}



2. 16 X 2 LCD DISPLAY CODE:
THIS CODE IS FOR CHECKING YOUR LCD DISPLAY 

//DOWNLOAD LIQUID CRYSTAL LIBRARY  https://github.com/arduino-libraries/LiquidCrystal

#include<LiquidCrystal.h>
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);//(RS, Enable, A2, A3, A4, A5)

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}

void loop() {
lcd.setCursor(2,0);
lcd.print("MKINVENTIONS");

lcd.setCursor(0,1);
lcd.print("MADHAN CHIRUGURI");

}





3. RF-ID WITH 16 X 2 LCD DISPLAY CODE:-
UPLOAD THIS CODE FOR COMPLETE RF-ID DOOR LOCKING SYSTEM PROJECT

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>

#define SS_PIN 10
#define RST_PIN 9

#define GREEN_LED 3 //define green LED pin
#define RED_LED 4 //define red LED
#define BUZZER 2 //buzzer pin


MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.
Servo myServo; //define servo name

#include<LiquidCrystal.h>
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);//(RS, Enable, A2, A3, A4, A5)




void setup() 
{
  // Specify the LCD's number of columns and rows:
  lcd.begin(16, 2);

  
  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  myServo.attach(6); //servo pin
  myServo.write(0); //servo start position
  pinMode(GREEN_LED, OUTPUT);
  pinMode(RED_LED, OUTPUT);
  pinMode(BUZZER, OUTPUT);
  noTone(BUZZER);
}


void loop() {
  lcd.setCursor(0, 0);
  lcd.print("PLACE YOUR  CARD");
  lcd.setCursor(0, 1);
  lcd.print("ON  THE  SCANNER");
  
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
  //Show UID on serial monitor
  lcd.print("UID tag :");
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
  {
     lcd.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
     lcd.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  lcd.println();
  lcd.print("Message : ");
  content.toUpperCase();
  
  if (content.substring(1) == "E9 76 8D C2") //RFID TAG
  {
    lcd.setCursor(0, 0);
    lcd.println("Authorised access");
    lcd.setCursor(0, 1);
    lcd.print("NAME : ");
    lcd.println("ALPHA LEO");
    delay(500);
    digitalWrite(GREEN_LED, HIGH);
    tone(BUZZER, 500);
    delay(300);
    noTone(BUZZER);
    myServo.write(30);
    delay(5000);
    myServo.write(0);
    digitalWrite(GREEN_LED, LOW);
    lcd.clear();
  }

  
//  else if (content.substring(1) == "73 6D 07 03") //RFID CARD
//  {
//    lcd.setCursor(0, 0);
//    lcd.println("Authorised access");
//    lcd.setCursor(0, 1);
//    lcd.print("NAME : ");
//    lcd.println("BETA MAXX");
//    delay(500);
//    digitalWrite(GREEN_LED, HIGH);
//    tone(BUZZER, 500);
//    delay(300);
//    noTone(BUZZER);
//    myServo.write(180);
//    delay(5000);
//    myServo.write(0);
//    digitalWrite(GREEN_LED, LOW);
//    lcd.clear();
//  }
  
 else   {
    lcd.setCursor(0, 0);
    lcd.println(".ACCESS  DENIED.");
    lcd.setCursor(0, 1);
    lcd.println("...NOO ACCESS...");
    digitalWrite(RED_LED, HIGH);
    tone(BUZZER, 300);
    delay(1000);
    digitalWrite(RED_LED, LOW);
    noTone(BUZZER);
  }

Post a Comment

0 Comments