Arun IoT 8
Arun IoT 8
Experiment 8
Student Name: Arun UID: 22BET10320
Branch: IT Section/Group:22BET_IoT_703-B
Semester: 5th Date of Performance: /10/2024
Subject Name: IoT - Lab Subject Code: 22ITP-329
2. Objective:
• Prevent unauthorized access by only allowing registered RFID tags.
• Logs access history for auditing who enters and exits.
• Deactivate lost or stolen RFID tags to prevent misuse.
• Keyless entry using RFID cards, tags, or smartphones with NFC.
• Automatic unlocking when an authorized RFID tag is detected.
• Simplified access management—easy to add or remove users.
4. Procedure:
• D0 – D7: Pin number 7-14 are data bus lines that are used to send data from Arduino
which you want to display on LCD. With these 8 data lines, data can be transferred
either in an 8-bit format or in a 4-bit format.
• Contrast Select (VEE): It will help to control the contrast of PIXELS according to
the 16X2
• LCD light.
• RS: This pin is known as a register select pin. It helps to toggle the command/data
register.
• R/W: The signal on this pin will decide whether it is going to read from LCD or
write on it.
• EN: Enable pin will help to transfer the instruction from the data pins and another
command pin
• to the LCD. It acts as permission to internal registers.
• VSS: It’s a ground pin for common grounds.
• VCC: The power pin will use for voltage input to the 16X2 LCD.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
5. Code:
//Arduino Code - RC522 Read RFID Tag UID
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 7
MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class
MFRC522::MIFARE_Key key;
void setup() {
Serial.begin(9600); SPI.begin(); //
Init SPI bus rfid.PCD_Init(); //
Init RC522
}
void loop() {
// Reset the loop if no new card present on the sensor/reader. This saves the entire process
when idle.
if ( ! rfid.PICC_IsNewCardPresent()) return;
// Verify if the NUID has been readed if ( !
rfid.PICC_ReadCardSerial()) return;
MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
Serial.print(F("RFID Tag UID:"));
printHex(rfid.uid.uidByte, rfid.uid.size);
Serial.println("");
rfid.PICC_HaltA(); // Halt PICC
}
//Routine to dump a byte array as hex values to Serial. void
printHex(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], HEX);
}
}
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
6. Output:
7. Learning Outcome:
• Learn the principles of RFID operation, including how RFID tags and readers
communicate.
• Understand the differences between active and passive RFID systems.
• Gain experience in working with microcontrollers (such as Arduino, Raspberry
Pi) to control the RFID system.
• Learn how to interface RFID readers with microcontrollers for real- time access
control.
• Learn how to design and build circuits that integrate RFID readers, door locks
(e.g., electronic solenoids), and other components like buzzers or LEDs.