Shubam Tayal
Published © CC BY-NC

RFID scanner - Full tutorial

A contactless and modern way of security.

IntermediateFull instructions provided51,551
RFID scanner - Full tutorial

Things used in this project

Hardware components

RFID reader (generic)
×1
Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
9V battery (generic)
9V battery (generic)
In my case, I had just used a wire which connects my laptop to the Arduino. This supplies battery to the processor.
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
If you buy the more expensive version of the RFID reader, you would need to purchase this as soldering would not be needed at all.

Story

Read more

Custom parts and enclosures

PROPER CASING FOR TWO COMPONENTS

It has the functionality of a good example of housing, where no issues are found.

Schematics

RFID TO ARDUINO

This is a full image, reducing any problem you might have, it is visible and outlines where to the pin. I have used fritzing,org for the development of the schematics.

Code

Code for the serial monitor

Arduino
This is the code for the serial monitor, remember that you would need to get a RFID example library
#include <SPI.h>
#include <MFRC522.h>
 
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);   
 
void setup() 
{
  Serial.begin(9600);  
  SPI.begin();      
  mfrc522.PCD_Init();   
  Serial.println("Approximate your card to the reader...");
  Serial.println();

}
void loop() 
{
  
  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
 
  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) == "29 C2 07 5E") // Make sure you change this with your own UID number
  {
    Serial.println("Authorised access");
    Serial.println();
    delay(3000);
  }
 
 else   {
    Serial.println(" Access denied");
    delay(3000);
  }

Credits

Shubam Tayal

Shubam Tayal

0 projects • 3 followers

Comments