This tutorial is designed for beginners to learn how to use the RFID Reader Module 13.56Mhz with an Arduino UNO for a simple attendance project. By the end of this tutorial, students will be able to create a system that can read RFID tags and display user information in the serial monitor.
The project involves connecting the RFID Reader Module to the Arduino UNO, writing a code to read the RFID tags, and displaying the user information in the serial monitor. This project has various applications in Rwanda and East Africa, such as in schools, offices, and homes, where attendance tracking and access control are essential.
Students will learn how to connect the RFID Reader Module to the Arduino UNO, how to write a code to read the RFID tags, and how to display the user information in the serial monitor. They will also learn how to use the RFID library in Arduino and how to troubleshoot common issues. The skills learned in this tutorial can be applied to various projects, such as:
The RFID Reader Module 13.56Mhz is a widely used module in various applications, and learning how to use it with an Arduino UNO will open up a world of possibilities for students to create innovative projects. The module is readily available at SoftTech Supply in Kigali, Rwanda, and students can easily source the other required components, such as jumpers and a breadboard, from local electronics shops.
| RFID-RC522 Pin | Arduino UNO Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA (SS) | Digital Pin 10 |
| SCK | Digital Pin 13 |
| MOSI | Digital Pin 11 |
| MISO | Digital Pin 12 |
| RST | Digital Pin 9 |
| IRQ | Not Connected |
For students in Rwanda, the required components for this project can be sourced from local electronics suppliers such as SoftTech Supply in Kigali.
The RFID-RC522 Reader Module 13.56MHz is a widely used RFID (Radio Frequency Identification) module for applications such as access control systems, attendance monitoring, smart cards, and inventory tracking. In this tutorial, students will learn how to connect the RFID-RC522 module with an Arduino UNO, read RFID card information, and create a simple attendance system that displays student details in the Serial Monitor.
To build this project, prepare the following hardware components:
These components can be obtained from electronics suppliers in Kigali, such as SoftTech Supply. The RFID-RC522 module will read the unique identification number (UID) of each RFID card, while the Arduino UNO processes the data and displays the registered student's information through the Serial Monitor.
The RFID-RC522 communicates with the Arduino UNO using the SPI communication protocol. Connect the module as follows:
Use jumper wires to connect the RFID module and Arduino UNO carefully. Ensure that the RFID module is powered using the Arduino's 3.3V pin because the RC522 module is not designed for 5V operation.
Before programming the Arduino UNO, install the MFRC522 library from the Arduino Library Manager:
After installing the library, upload the RFID attendance program to the Arduino UNO. The program reads the RFID card UID, compares it with registered users, and displays student information such as name, ID, and attendance status in the Serial Monitor.
After uploading the program, test the RFID-RC522 module by scanning an RFID card near the reader. Follow these steps:
Example output:
Card Detected UID: A1B2C3D4 Name : Jean Claude ID : STS001 Course : Arduino Programming Status : Attendance Recorded
If the RFID-RC522 module does not detect cards, check the following:
When working with electronic components, handle the modules carefully and avoid creating short circuits. The Arduino UNO and RFID-RC522 operate at low voltage, but proper connection practices should always be followed to prevent damage to the components.
/*
RFID Attendance System
Board: Arduino UNO
RFID Module: RC522 (13.56 MHz)
To access the complete step-by-step tutorial, including hardware setup, wiring diagram, Arduino code, and testing instructions, visit: https://softechsupply.com/courses/how-to-use-rfid-reader-module-1356mhz-with-an-arduino-uno
Connections
-------------------------
RC522 Arduino UNO
SDA -> D10
SCK -> D13
MOSI -> D11
MISO -> D12
RST -> D9
GND -> GND
3.3V -> 3.3V
*/
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
SPI.begin();
rfid.PCD_Init();
Serial.println("==================================");
Serial.println(" RFID Attendance System");
Serial.println(" Scan your RFID card...");
Serial.println("==================================");
}
void loop() {
// Look for a new card
if (!rfid.PICC_IsNewCardPresent())
return;
// Select one of the cards
if (!rfid.PICC_ReadCardSerial())
return;
// Read UID
String uid = "";
for (byte i = 0; i < rfid.uid.size; i++) {
if (rfid.uid.uidByte[i] < 0x10)
uid += "0";
uid += String(rfid.uid.uidByte[i], HEX);
}
uid.toUpperCase();
Serial.println();
Serial.println("Card Detected");
Serial.print("UID: ");
Serial.println(uid);
// Attendance Database
if (uid == "A1B2C3D4") {
Serial.println("Name : Jean Claude");
Serial.println("ID : STS001");
Serial.println("Course : Arduino Programming");
Serial.println("Status : Attendance Recorded");
}
else if (uid == "12345678") {
Serial.println("Name : Alice Smith");
Serial.println("ID : STS002");
Serial.println("Course : Embedded Systems");
Serial.println("Status : Attendance Recorded");
}
else {
Serial.println("Unknown Card");
Serial.println("Access Denied");
}
Serial.println("----------------------------------");
// Stop communication with card
rfid.PICC_HaltA();
rfid.PCD_StopCrypto1();
delay(1000);
}
1. Which communication protocol does the RC522 RFID module use to communicate with the Arduino Uno? a) UART b) I²C c) SPI d) Bluetooth Answer: c) SPI 2. Which Arduino Uno pin is connected to the SDA (SS) pin of the RC522 module? a) D9 b) D10 c) D11 d) D13 Answer: b) D10 3. What is the purpose of the RFID tag's UID (Unique Identifier)? a) To store images b) To identify a specific RFID card or tag c) To measure distance d) To control the Arduino clock Answer: b) To identify a specific RFID card or tag 4. Which Arduino library is commonly used to interface with the RC522 RFID module? a) Wire b) Servo c) LiquidCrystal d) MFRC522 Answer: d) MFRC522 5. In the attendance project, what happens when a registered RFID card is scanned? a) The Arduino resets. b) The student's information is displayed in the Serial Monitor and attendance is recorded. c) The RFID card is erased. d) The Arduino turns off. Answer: b) The student's information is displayed in the Serial Monitor and attendance is recorded.
If you don't already have the parts listed above, you can buy genuine Arduino, ESP32, Raspberry Pi, sensors, and other electronic components from SoftTech Supply Shop, with fast delivery across Kigali and other parts of Rwanda.
← Browse more Arduino & IoT tutorials