RFID RC522 Based Attendance System Using Arduino with Data Logger

RFID RC522 Attendance System Arduino (Last Updated On: May 12, 2019)

RFID RC522 Based Attendance System Using Arduino with Data Logger

In this project we have designed RFID RC522 Based Attendance System Using Arduino with Data Logger. MFRC522 RFID Reader is very simple yet effective module. It is an RFID module and is used for scanning RFID cards. Its a new technology and is expanding day by day. Now-a-days it is extensively used in offices where employees are issued an RFID card and their attendance is marked when they touch their card to RFID reader. We have seen it in many movies that when someone places ones card over some machine then door opens or closes. In short, its a new emerging technology which is quite useful.

In this project we will make RFID MFRC622 based Time Attendance System Using Arduino Board. When you swipe an RFID tag next to the RFID reader, it saves the user UID and time in an SD card. It also shows if you are late or in time accordingly to a preset hour and minute.For this we are interfacing MFRC522 RFID SPI module with Arduino. We are also interfacing SD Card Module as Data logger where the data is saved in text format. Similarly, RTC Module DS3231 or DS1307 is used to store time information.

But before beginning you can see our earlier projects that are based on Attendance System:
1. RFID EM-18 Based Attendance System using Arduino & LCD Display
2. Fingerprint Sensor Based Biometric Attendance System using Arduino




Components Required

Components for RFID Attendance System

1. Arduino UNO Board (Buy Online from Amazon)
2. RFID MFRC522 Module (Buy Online from Amazon)
3. RFID Cards - 5 (Buy Online from Amazon)
4. SD Card Module (Buy Online from Amazon)
5. SD Card 16 GB (Buy Online from Amazon)
6. DS3231 RTC Module (Buy Online from Amazon)
7. 16x2 LCD (Buy Online from Amazon)
8. Red & Green LED (Buy Online from Amazon)
9. Buzzer (Buy Online from Amazon)
10. Connecting Jumper Wires (Buy Online from Amazon)
11. Breadboard (Buy Online from Amazon)

RFID MFRC522 Module

RC522 – RFID Reader / Writer 13.56MHz with Cards Kit includes a 13.56MHz RF reader cum writer module that uses an RC522 IC and two S50 RFID cards. The MF RC522 is a highly integrated transmission module for contact-less communication at 13.56 MHz. RC522 supports ISO 14443A/MIFARE mode.

RFID MFRC522 Module

RC522 – RFID Reader features an outstanding modulation and demodulation algorithm to serve effortless RF communication at 13.56 MHz. The S50 RFID Cards will ease up the process helping you to learn and add the 13.56 MHz RF transition to your project.

The module uses SPI to communicate with microcontrollers. The open-hardware community already has a lot of projects exploiting the RC522 – RFID Communication, using Arduino.


The following table shows the connection between Arduino UNO & RFID MFRC522:

Arduino RC522 Connection

Note: different Arduino boards have different SPI pins. If you’re using another Arduino board, check the Arduino documentation.


SD Card Module

The micro- SD Card Module is a simple solution for transferring data to and from a standard SD card. The pin out is directly compatible with Arduino, but can also be used with other microcontrollers. It allows you to add mass storage and data logging to your project.

SD Card Module

This module has SPI interface which is compatible with any sd card and it use 5V or 3.3V power supply which is compatible with Arduino UNO/Mega. SD module has various applications such as data logger, audio, video, graphics. This module will greatly expand the capability an Arduino can do with their poor limited memory.

The following table shows the connection between Arduino UNO & SD Card Module:

Arduino UNO and SD Card Module Connection

Note: different Arduino boards have different SPI pins. If you’re using another Arduino board, check the Arduino documentation.


DS3231 RTC Module

RTC means Real Time Clock. RTC modules are simply TIME and DATE remembering systems which have battery setup which in the absence of external power keeps the module running. This keeps the TIME and DATE up to date. So we can have accurate TIME and DATE from RTC module whenever we want.

DS3231

DS3231 is a six terminal device, out of them two pins are not compulsory to use. Its works on I2C Communication Protocols with SDA and SCL pins. So we have mainly four pins.

The following table shows the connection between Arduino UNO & DS3231 Module:
Connection Between Arduino and DS3231 RTC Module

Note: different Arduino boards have different I2C pins. If you’re using another Arduino board, check the Arduino documentation.




Circuit Diagram & Connection

The circuit for this project RFID RC522 Based Attendance System Using Arduino with Data Logger is shown in the circuit schematics below.

In this circuit there are 3.3V and 5V devices, make sure you wire them correctly. Also, if you’re using different modules, check the recommend voltage before powering the circuit. Wire one module at a time and follow the pinout tables if needed.

Circuit Diagram for RFID Based Attendance System


Preparing & Setting Up SD Card

First insert the SD Card of 16/32 GB in SD Card Reader and format using FAT32 Command:

Formating SD Card Module

Once the formatting is done, put the SD card in SD Card Module as in assembled circuit above. Then upload the code given below to Arduino Board.

After uploading check the serial monitor. If the below messages get displayed then you can proceed further.



Source Code/Programs

Add the two libraries first before compiling the Code:
1. MFRC522 Library Link: Download
2. RTC Library Link: Download


Working of the Project

When the RFID reader reads an RFID tag, it saves the current time and the UID of the tag in an SD card. The Arduino communicates with the SD card using an SD card module.

RFID RC522 Attendance System Arduino


You can set a check in time to compare if you are in time or late. If you are on time, a green LED lights up, if you are late, a red LED lights up. The system also has a buzzer that beeps when a tag is read.


Video Preview & Demonstration

Please make a donation for my hard work. Even 1$ will be appreciated.

Recommended For You

About the Author: Alex Newton

2 Comments

    1. It was not working in my case too. First check if SD Card module is working or not. Also, did u use 330-ohm resistor between mosi pins of SD Card Module and RFID

Ask A Question .......

Close