IoT Based RFID Authentication System


Radio-frequency identification (RFID) uses electromagnetic fields to transfer data through wireless.

  • A rfid system uses tag, attached to the objects for identification.
  • Readers send a signal to the tag and read its response.
  • Tag is read-only the tag uses the radio energy transmitted by the reader.
  • Each tag have unique serial number,by using this tag number it is easy to identify product details.

Rfid has multiple usage,  it use to track the object attached to it using the unique serial no.Application: attendance system.An Rfid reader attached to esp8266, when ever reader detect the rfid card it read the tag serial no and push the serial no to cloud with timestamp.

Block Diagram

Flow Chart

Component Required:

  1. Node MCU.
  2. MRC522 RFID
  3. Jumper wire
  4. BreadBoard

Software Required:

  1. MIT App inventor – Android
  2. Firebase
  3. Arduino 

Circuit diagram


Login To firebase

  • create new project
  • Create database for RFID device
  • Set firebase security rules to test mode to allow esp8266 to set and read database
  • Set Rules of firebase to read and write in real timedatabase
  • Select Real-time Database 
  • Copy the URL- Required in code as firebase host-id to communicate with firebase
  • Click to add child to Create a field to hold data in firebase
  • Create RFID field to hold RFID Access data in firebase.
  • RFID, Access field in realtime database hold RFID access data.
  • Get authentication id from firebase.

Android Application

  • Create New project from mit app inventor for RFID access monitoring
  • Select layout to place the user interface component
  • Create a header from the Android application: 

                 Drag and drop label in the screen for app header

  • Add firebase component to app
  • use the firebase database url, you can ignore the FirebaseToken 

Logics To Get the Data From Firebase

Android APP

  • Code
 #include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <SPI.h>
#include <MFRC522.h>

#define FIREBASE_HOST " "
const char* ssid = "IMAKE"; // Your ssid
const char* password = "12345678"; // Your Password 

#define RST_PIN D1
#define SDA_PIN D2
MFRC522 mfrc522(SDA_PIN, RST_PIN);
bool firebase_lock = true;
void setup() 
Serial.print("Connecting to ");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
Serial.println("WiFi is connected");
void loop() 
if ( ! mfrc522.PICC_IsNewCardPresent()) 
if ( ! mfrc522.PICC_ReadCardSerial()) 
//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));
if (content.substring(1) == "AD 15 31 DA") 
Serial.println("Authorized access");
Firebase.setString("Access", "Authorized");
Firebase.setString("RFID", "Match_Found");
firebase_lock = true;
if(firebase_lock == true)
Serial.println(" Access denied");
Firebase.setString("Access", "UnAuthorized");
Firebase.setString("RFID", "Match_Not_Found");
firebase_lock = false;