1. Blog>
  2. RFID based Attendance system using Arduino and External EEPROM

RFID based Attendance system using Arduino and External EEPROM

by: Mar 22,2021 705 Views 1 Comments Posted in Activities

Arduino reader module PCB

Overview:

In this post we are going to learn how to build a RFID based attendance system using Arduino development board, RC522 RFID reader module and external EEPROM. We will take a brief look at RC522 RFID module, external EEPROM and other circuit modules that makes this proposed RFID attendance system work.

RFID card based system is so commonly used in our modern life such that you must have come across at-least one point in your life at schools, offices, train stations, libraries etc. 

In this post we will learn how to build an attendance system that can store attendance of 100 people and 255 attendance counts per person.

Circuit diagram:

Main Program code: https://github.com/Electronics-Project-hub/RFID/blob/main/RFID-Attendance-system.txt

Circuit description:

The proposed circuit consists of the following module that makes this RFID attendance system possible:

·RC522 RFID module.

·External EEPROM AT24C256.

·RTC module DS3231 / DS1307.

·I2C LCD module.

·Buzzer and buttons.

Now let’s take a look at them one by one.

RC522 RFID module:

The above shown module is the heart of the project; it is a RFID card reader module which is used for reading data from compatible MIFARE manufactured RFID cards. The Module consists of a PCB where the traces are laid like a coil to generate electromagnetic waves to read the contents in a RFID card placed nearby. 

The coil shaped PCB trace generates electromagnetic waves at 13.56 MHz; the generated EMF will be picked by the RFID card. The RDIF cards are not just plain plastic cards; they have microchips embedded in it and similar to coil shaped PCB trace, there are thin coil inside the card to energize the tiny chip and also for establishing communication between the card and RFID reader. 

The RFID reader module has a controller IC which is responsible for generating the EMF and decodes incoming data from RDIF tag / card. The module communicated with microcontrollers via SPI protocol and works on 3.3V supply. 

RFID card and key tag:

The above image illustrates a RFID card and a RFID keychain, both consists of a tiny chip embedded in it as mentioned earlier and it comes in different memory sizes, yes RFID card stores data. For example the above illustrated card can hold up to 1KB of memory which is readable and writable. 

The RFID cards also have something called UID or unique identification number (which is very important for this project) using which a correct card can be identified. UID consist 8 hexadecimal numbers and we are going to read it from the cards and add attendance to the correct person. For a layman UID of a card cannot be modified.

External EEPROM:

The above image illustrates an external EEPROM IC AT24C256 which is a non-volatile memory; it is utilized for storing attendance data. It consists of 8 pins and can store up to 256KB of data. It uses I2C protocol to read and write data from a microcontroller. Below is the pin diagram of AT24C256:

It has 8 pins and can operate on 5V and 3.3V supply for AT24C256 and only 3.3V for AT24LC256, which is 3.3V variant of the EEPROM. The 256KB memory is divided into 8 memory parts (of 32KB each internally) and we will be utilizing only one memory block in the EEPROM IC.

The pins A0, A1 and A2 are used for selecting the memory block to which we are going to write and read data. By pulling A0, A1 and A2 to ground it will select the first memory block.

WP pin or write protect pin is used for preventing unintentional writes to the EEPROM. Making it HIGH will disable write and making it LOW will enable write, by default we are connecting WP to ground.

Pins SDA and SCL are the communication pins that connects to I2C pins of Arduino.

Real time clock:

The proposed project has a RTC or real time clock module which is used for showing date and time on the LCD as idle screen. The RTC module we are going to use is DS3231 or DS1307; both are compatible with this project and you may choose one depending on the availability and cost.

Both the RTC module works on 5V supply and communicates via I2C protocol and they have their own 3V lithium backup battery to keep track of time even when the main power supply is disconnected. Our recommendation is DS3231 due to its superior accuracy in time tracking. 

I2C LCD Display:

We are utilizing an I2C display adapter module for driving the LCD display so that we only need to connect a total of four wires Vcc, GND, SCL and SDA, otherwise we will be connecting 16 wires. Use a Phillips screwdriver to adjust the contrast of the display.

For prototyping on breadboard you may just connect them as illustrated above, but for a permanent build you may need to solder the I2C adapter directly on back of the LCD.

Buzzer and buttons:

There are three push buttons provided for retrieving attendance count which will be shown on the display. The three buttons are up, down and home. By pressing up or down you can see the attendance count of a person and by pressing home button you can bring the screen to idle. 

A buzzer is provided in the circuit for auditory feedback, so that when a person scans his or her card, it will indicate whether the card has been properly scanned or not.

Prototype image:

How to register a RFID card to the machine?

As mentioned earlier we are going to decode UIDs to recognize a card and to increment the attendance count to the correct person. To do this we need to enter the UIDs of the cards in the main program code. Now follow the steps given below:

·You need to build the circuit fully as per the circuit diagram.

·Copy the code present in this link which can show UID of a RFID card: https://github.com/Electronics-Project-hub/UID-reader/blob/main/UID%20reader.txt

·Upload the code to the project setup and open serial monitor at 9600 baud rate and place your card on the RFID reader and you will see the below:

·Copy the UID and paste it to the main program code as shown below after “Null”.

·Here I have entered four UIDs and also entered the database size as 4. If you are entering 20 UIDs say for an example, you need to set the data base size to 20. The first UID after “Null” is the attendance location 1 and so on till 99.

·Now compile and upload the code.

·Now if you scan a card who’s UID is present in the main code, you will see the below screen and an attendance count will be added to the UID. 

·If you try to scan a card who’s UID is not present in the code you will see this:

How to read attendance data?

·Press up button to see the attendance count. For example in the above image the person number 1 has registered 4 attendances. Press up button again to see attendance of person number 2 and so on.

·You can also press down button to see the attendance count of a previous person.

·Press home button to bring the screen back to idle. Only at idle screen the RFID cards will be scanned. 

·Once the attendance of any person reached 255, the machine cannot register more attendance anymore for that person, so you need to delete the counts in the memory. This can be done by pressing home button first and down button next at idle screen, this will erase all the data in the EEPROM.

·The attendance (person) number will be arranged according to the UIDs placed in the code. 


Note: The content and the pictures in this article are contributed by the author. The opinions expressed by contributors are their own and not those of PCBWay.

Written by Blogthor.



https://github.com/Electronics-Project-hub/UID-reader/blob/main/UID%20reader.txt

  • Comments(1)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
    View More
    Back to top