0% found this document useful (0 votes)
23 views24 pages

Automatic Door Lock System Using RFID & Servo Motor Metrpogate

The document outlines a project for an RFID and servo motor control system designed for an automatic door lock. It includes a list of necessary components, detailed wiring instructions, and Arduino code for programming the system. The code facilitates access control by granting or denying entry based on RFID tag recognition.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views24 pages

Automatic Door Lock System Using RFID & Servo Motor Metrpogate

The document outlines a project for an RFID and servo motor control system designed for an automatic door lock. It includes a list of necessary components, detailed wiring instructions, and Arduino code for programming the system. The code facilitates access control by granting or denying entry based on RFID tag recognition.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

RFID & Servo Motor Control

system for Automatic Door


Lock

1
COMPONENTS NEEDED
1. Arduino UNO
2. LED
3. Breadboard
4. Wires
5. Battery
6. USB-A to B
7. RFID Module (RC522)

2
Introduction to the Components

RFID
Module
Arduino UNO R3 Breadboard Battery

3
Connect Arduino GND to Breadboard negative
rail

4
Connect Arduino 5V to Breadboard positive rail

5
Place RFID Module anywhere in the Bread
Board

6
Connect RFID VCC to 5V of Arduino

7
Connect RFID GND to GND of Arduino GND

8
Connect Lower BreadBoard Negative Rail to Upper Negative Rail of
BreadBoard

9
Connect Lower BreadBoard Positive Rail to Upper Positive Rail of
BreadBoard

10
Connect Arduino GND to Negative rail of
Breadboard

11
Connect Servo GND to Negative rail of Breadboard

12
Connect Servo Positive to Positive rail of
Breadboard

13
Connect Servo Signal Pin to Arduino Pin 3

14
Connect RFID SCK pin to Arduino pin 13

15
Connect RFID SDA pin to Arduino pin 10

16
Connect RFID MOSI pin to Arduino pin 11

17
Connect RFID MISQ pin to Arduino pin 12
Do Not Connect IRQ pin to anywhere.

18
Connect RFID RST pin to Arduino pin 9

19
ual image of Circuit connection & Serial monitor

20
Complete Pin Connections

IRQ

13

21
Code for Arduino IDE
#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>

#define SS_PIN 10
#define RST_PIN 9
#define LED_G 5 //define green LED pin
#define LED_R 4 //define red LED
#define BUZZER 2 //buzzer pin
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
Servo myServo; //define servo name

void setup()
{
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
myServo.attach(3); //servo pin
myServo.write(0); //servo start position
pinMode(LED_G, OUTPUT);
pinMode(LED_R, OUTPUT);
pinMode(BUZZER, OUTPUT);
noTone(BUZZER);
Serial.println("Put your card to the reader...");
Serial.println();
}
void loop()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return; 22
} // Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.print("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "73 A4 A2 2E"||content.substring(1)=="F3 3A 67 97")
{
Serial.println("Access Granted");
Serial.println();
delay(500);
digitalWrite(LED_G, HIGH);
tone(BUZZER, 500);
delay(300);
noTone(BUZZER);
myServo.write(180);
delay(3000);
myServo.write(0); 23
digitalWrite(LED_G, LOW);
}
else {
Serial.println(" Access denied");
digitalWrite(LED_R, HIGH);
tone(BUZZER, 300);
delay(1000);
digitalWrite(LED_R, LOW);
noTone(BUZZER);
}
}

24

You might also like