0% found this document useful (0 votes)
6 views4 pages

Making An RFID Reader

The document outlines the process of creating an RFID reader, including a circuit diagram and program code. It utilizes the MFRC522 library for Arduino to initialize the RFID reader and read card data. The code includes setup and loop functions to handle card detection and data output via serial communication.

Uploaded by

jombethdamasen07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Making An RFID Reader

The document outlines the process of creating an RFID reader, including a circuit diagram and program code. It utilizes the MFRC522 library for Arduino to initialize the RFID reader and read card data. The code includes setup and loop functions to handle card detection and data output via serial communication.

Uploaded by

jombethdamasen07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Making an RFID Reader

Laboratory No.2

RATING

Member:

Date Perform Date of Submission

Instructor
CIRCUIT DIAGRAM
SKETCH/ PROGRAM CODE
#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN 9 // Configurable, see typical pin


layout above
#define SS_PIN 10 // Configurable, see typical pin
layout above

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522


instance

void setup() {
Serial.begin(9600); // Initialize serial communications with
the PC
while (!Serial); // Do nothing if no serial port is opened
(added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
delay(4); // Optional delay. Some board do need more
time after init to be ready, see Readme
mfrc522.PCD_DumpVersionToSerial(); // Show details of
PCD - MFRC522 Card Reader details
Serial.println(F("Scan PICC to see UID, SAK, type, and data
blocks..."));
}

void loop() {
// Reset the loop if no new card present on the sensor/reader.
This saves the entire process when idle.
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}

// Select one of the cards


if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}

// Dump debug info about the card; PICC_HaltA() is


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

You might also like