Attendance system using Raspberry Pi and NFC Tag reader

Picture of Attendance system using Raspberry Pi and NFC Tag reader
With my new toy Raspberry pi I've done several testing projects from
instructables, adafruit etc. But after a while it became boring and I've started looking for something actually useful for me. My previous playground was my new phone several weeks ago which came with new feature NFC reading. Thought and thought together gave me idea for attendance system for our small (family) company using NFC tags. The additional kick was my interest in those systems before, but discovering the cheapest are for around $750 I decided it is too much for such small company as 6 employees.
As I don't have any experience with "mature" attendance systems, I've decided only to implement basic features. These consist of logging incoming people, outcoming people, start and end of a break and deleting last inserted action (in case of mistype during logging).
All these actions are logged into local MySQL database from where I can display it and manipulate with my front-end application. Because the SD card is not such safe data medium, especially when loosing power unexpectedly, I'm uploading all data daily to my local server, where I keep backup in case of corruption of the SD card.
During normal operation of the logging station, display shows current date and time and calls for action selection. When you choose appropriate action on the keyboard, display shows selected action and calls for attaching the TAG to the reader. Also the LED under display also turns on.
When the TAG is read, the LED turns off and beep signal comes out the speaker. For a brief moment display shows action and name of the owner of the card. Then everything returns to the default state waiting for another entrance.

For foot notice, this whole project including source codes is licensed under Beer-ware licence as follows:
Jakub Dvorak wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.
Remove these adsRemove these ads by Signing Up
KarstenM1 month ago

Hey! I've got a question for the wiring part of the RFID RC522. I have connected everything to the right pins (Got raspberry pi 2) but no led lights on the rc522 turn on and the chip gets hot as hell. Do you know how I can solve this? Many thanks for your help!

vince0314 made it!3 months ago

Hi.. i had connect the RPi_rev2(pins40) with RFID-RC522 module...there are a few error during run the attendance.py..the errors as the attachment ...

Attandance with RC522.jpg
Ukshil4 months ago

When I'm trying to install setup.py of SPI-Py folder, it shows an error as: command 'gcc' failed with exit status 1..

Help me to solve this. Please!!

hi i love ur project it is similar to my project can u share idea wit me wasimahmed9415@gmail.com thank you

sirion9 months ago

Hi, it seams that the beeper module is not supplied on the github page

File "/home/pi/src/attendance/attendance.py", line 23, in <module>
import beeper
ImportError: No module named beeper

after commenting this out the only thing i get is something like this

attendance.py:178: RuntimeWarning: No channels have been set up yet - nothing to clean up! Try cleaning up at the end of your program instead!
29.10.2014 06:44:43
29.10.2014 06:44:44
29.10.2014 06:44:45
29.10.2014 06:44:46
29.10.2014 06:44:47
29.10.2014 06:44:48
29.10.2014 06:44:49

But no readings, i can confirm that when i use the

MFRC522-python-master/Read.py i get readings so my connections are ok..

please help

cholbing sirion5 months ago

The GPIO.cleanup() isn't successfully clearing the channels. I'll see what I can do.

cholbing cholbing5 months ago

Also I must mention; use the terminal command 'ps aux | grep python' and close running python processes. Compiling the script over and over can throw off your channels, you gotta kill processes before.

derp1992 sirion6 months ago

hi there, as you go through the code you see the following

if(actions==(specified action))

this actually are unprintable ascii characters and ttys, where 49 is called upon pressing 1 key on the numpad,50 on 2 ,51 on 3 and so on

so the terimnal is showing the timing's as you have stated above, you actually need to press 7 on the numpad in order to read the uid from the rfid reader which corresponds to 55 in unprintable ascii, i believe the author chose this way of accepting choices in order to run the code at boot(this is what i think may be something else, not sure). you can inbox me if need further information regarding this

stoneschan sirion7 months ago

sirion ,were you ever able to figure this out?

sirion stoneschan7 months ago

No, never had an reply to this problem...

cholbing5 months ago

So has anyone got this thing working. I looked through the Code, and there are a lot of instructions missing. An enitre module is no-where to be found...

Hi Everyone, i have a project at home where i can control my lights and water features etc via relays which can be controlled over the internet but i have now ordered and received a 2 in 1 RFID Reader & Keypad "Image Below" that id like to use as a gate entry that either you can enter a certain code or use the RFID to enter which will turn off a relay, when the relay is turned off the magnetic lock will release and then after a few seconds the relay powers on again and locks.


I have a 2 in 1 RFID & Keypad, the sticker that shows what the wires are but it isnt very clear and i dont know where to wire them to. (Which pins on the Rasp Pi) I understand the Red And black are to go to a 12v power supply.

Also i have seen so many people using different code, but does anyone have any that would help me at all?

The wire picture isnt that clear but it shows:



RedVCC +12V

WhiteD1 / TX / 4R -



GreenD0 / RX / 4R +

Grey26 /34

I have a Raspberry PI Model B running raspian, i have the following pins available:


Look forward to hearing from you Callum

zacy50001 year ago

This is great! Exactly what I have been looking for! Thanks so much. Im going to be getting my NFC reader from hong kong soon. I got it for £2.50 so its going to be fun. Thanks.

Did you ever get this going?

BartoszB8 months ago

In the header of attendance.py there's a "import beeper", but there's no standard library like this and no file is included. Can you help me?

Did you ever get this working? Im having the same issue. This "instructable" is missing a bunch of the steps... The author may as well should have never published it......

khor.w.jie8 months ago

how to create a mysql database and import it to Raspberry Pi?

TonyD38 months ago

Im getting ImportError: No module named MySQLdb when trying to run attendance.py. I have set up a database with mysql and i can even see it with phpmyadmin.

BartoszB TonyD38 months ago

You have to install MySQLdb lib on your RPi before you can run it. :)

LinuxUnux9 months ago


I am having the same issue as Sirion, and also I am having import issues in <module> for the onScreen and NFC imports.

Just wondering if you could give any help

jjjdz10 months ago

hmm.. when running attendance.py

File "/home/pi/RPi.GPIO-0.5.7/attendance/MFRC522.py", line 11, in <module>

import spi

ImportError: No module named spi

install RPi.GPIO-0.5.7.tar.gz

SébastienJ11 months ago

Other skill with PNEV512R :


asadkundi1 year ago

Quotation Required of Tags Attendance system.

Good idea! I am just starting to noodle around with NFC, nice project, and thank you for sharing.