RFID Based Attendance System

RFID Based Attendance System


RFID Based Attendance System Using Arduino

In this project, we are going to build an RFID based attendance system using Arduino. An RFID based Attendance Management System is based on some simple concepts. We store a set of RFID card data in our system, say 3 or 10 RFID card data. When the person with the right RFID card (compatible to data preloaded in our program/system) come and swipes his RFID tag, his arrival time will be stored on the system. When the same person swipes his RFID tag again, the system will save it as his leaving time and add it to his total working hours.


  • Display the current  time and date on the LCD    along with an option for menu button.
  • Save the arrival and leaving time details of a user in the EEPPROM of arduino.
  • Calculate & store the total working hours of each user and provide options in the menu for retrieving it.
  • Provide an option for clearing data which can access only by the admin using his ID.

Circuit Diagram -Arduino RFID Attendance System

Project Description

The full circuit diagram for    interfacing RFID module to Arduino    is shown above. The unique ID code in the RFID card is read by the circuit and the name of the corresponding person will be displayed on the 20 x 4 LCD display. TX pin of the RFID module is connected to the 0th pin (RX) of arduino. The Arduino receives data from the RFID module through this channel.

Button 1,2,3,4 are used for selecting the menu and different options within the menu. The Arduino pins to which the buttons are connected are configured as “INPUT_PULLUP” within in the program. This will eliminate the use of of external pull up resistors by enabling the internal pull ups of Arduino.    A buzzer and two LED indicators are also connected to the 5th,4th  & 3rd pin of the Arduino respectively. The buzzer sounds  upon receiving an ID code when a card is read by the circuit.

Our system uses a 20 x 4 LCD module for displaying purpose.The working and   interfacing of 20×4 LCD module is similar to that of 16 x2 LCD     expect that it consist of few more rows and columns. The RTC module that we use here is   DS1307 IC. The RTC Module is connected to the Arduino using I2C protocol. The SCL and SDA pins are used for establishing I2C communication.


 The libraries that we are using here are “LiquidCrystal.h”, “EEPROM.h”, “wire.h”. LiquidCrystal is for interfacing LCD module. EEPROM writing and reading are carried out using the functions provided by the  “EEPROM.h” library. The “wire.h” library allows you to communicate with I2C / TWI devices(RTC Module).The address of the I2C device is mentioned on the beginning of the program. There are both 7- and 8-bit versions of I2C addresses. 7 bits identify the device, and the eighth bit determines if it’s being written to or read from.

The Wire library, which is used for I2C bus communication, followed by defining the bus address for the RTC as 0x68. These are followed by two functions that convert decimal numbers to BCD (binary-coded decimal) and vice versa. These are necessary because the RTC ICs work in BCD not decimal. The function setTime() is used to set the clock. Using it is very simple to insert the values from year down to second, and the RTC will start from that time. Once you have run the function once it’s wise to prefix it with // and upload your code again, so it will not reset the time once the power has been cycled or microcontroller reset. Reading the time from your RTC IC is just as simple, in fac, the process can be followed neatly inside the function displayTime().

Two pointer arrays are declared at the beginning which contains the RFID codes and names of the persons. The name and ID code of every staff should be enrolled in this array on the programming time. When a person swipes his RFID card, the controller will receive a unique ID code at its RX pin. The controller will compare the received ID with the previously stored codes in the above mentioned array. If the received ID is equal to any of the ID stored in the program, the name of the person will be displayed on the LCD and the arrival time will be stored on the EEPROM of the controller.
flag is then host inside the program to point out the presence of that person. When the same person swipes his ID  again, the controller will assume that the person is leaving ( by checking the corresponding flag bit)  and save that time as his leaving time. The working hours is then calculated using the arrival and leaving time. It is then added to the total working hours and stored in the EEPROM. The controller will automatically clear  yesterday’s data at everyday  morning(8.30 AM). The details about the total working hours of staffs can be cleared only by the admin. An option named “view all” is included in the menu which shows the total working hours of each staff from the last time of reset. Option “ view attendance” will give the arrival and leaving time of staffs present on that day. Program include the details of 10 staffs. You can make the program shorter by cutting down the number of staffs.

RFID Read Number Code -

                                                                   Download Report