Arduino Attendence Logger





Introduction: Arduino Attendence Logger

About: I am an engineer and a maker who loves technology challenges.

I am always wondering how many hours per month I spend working on my projects. Hopfully I was designing atendance logger for local company and imidiatelly saw potential in this simple logger. First prototype was made with Arduino and was only a proof of concept. Becouse of that company allowed me to share this project.

System that company is using today grew up Arduino's performance and got many more features today.

RFID module was used in initial phase of development. NFC module could be used instead.

Step 1: What You'll Need?

We will need:

- Arduino Mega 2560

- Ethernet Shield W5100 with microSD slot

- Tiny RTC module

- RFID module RC522 with some tags

- 9V PSU and project housing

- Ethernet cable, breadboard and some wires

- LED (green and red or double colored) with 220 ohm resistor

- 8 ohm speaker (or buzzer)

Step 2: Plans

Before westarted with designing our system we set some demands:

- Every employee must be able to have his own tag and must be identified with it.

- For every employee there displaying history must be enabled.

- Hour or arrival and departure from work must be saved. In addition working hours must be calculated from time of arrival and time of departure.

Defining a problem

We can divide problem into three sub problems: identifying employee, saving history and calculating working hours, display of history. First sub problem can be tackled with RFID reader and some tags. Second sub problem, saving history, can be resolved with some kind of external memory module, like SD card. Third one is composed from communication and GUI. These can be resolved with simple Web Server.


Bloc diagram of our solution is presented in picture above. Central part is Arduino Mega 2560 platform. RFID reader, Ethernet shield and microSD card are connected to Arduino via SPI communication.Tiny RTC module is connected via I2C communication interface. Also we added LED and small speaker for indicating successful card read.

Step 3: Hardware Setup

Picture above is presenting connections among modules. For SPI communication we are using hardware SPI (MISO, MOSI and CLK are all the same, SS pin for Ethernet is on pin 10, for SD card is on pin 4 and for RFID reader is pin 6, and RST pin for RFID is on pin 7). LED is connected to pin 2 and 3, and speaker is connected to pin. Tiny RTC module is connected via I2C module to pins 20 and 21. 9V PSU is connected to Arduino’s external PSU connector. Ethernet shield is connected to computer (or router) via UTP cable.

Step 4: Arduino Code

Flowchart above is presenting, how code should work. We wrote Web Server from examples in Ethernet library. The rest of the code is from RFID library example, SD library example and RTC library example.

We designed web interface in Notepad++ using HTML and some CSS code. Code is well documented, therefore I won’t do this once again.

Step 5: Testing RFID Data Logger With Web Server

We tested all three desired functions: we can now read RFID tag, identify it, store time of arrival, time of departure and working hours of an employee. We made a short video of our system in action.

Step 6: Conclusion

In the end we made a validation of our demands. Here are results:

- We can identify an employee with a RFID tag.

- We can display history for employees.

- We can store time of arrival, time of departure and working hours within a month.

From results from validation we can conclude that project was carried out successfully. Project served us as a platform for application that is daily in use in local company.



    • Oil Contest

      Oil Contest
    • Casting Contest

      Casting Contest
    • Woodworking Contest

      Woodworking Contest

    We have a be nice policy.
    Please be positive and constructive.




    I can't change UID when I try to scan it just denying it.

    Can you help with more rfid cards to be logged in SD card.

    Hi guys, i need help for arduino UNO. i can't use this script

    1 reply

    It is too big for Arduino Uno. My initial plan was to use Uno, but there was not enough Flash memory.

    Hi Guys,
    I've been searching for a totorial of an portable RFID attendance logger, with obviously only SD card for storing data. Any help or suggestions?

    Hi sir, I think this schematic is wrong? Why is the 3.3v on the mega is connected to the grounds of rfid and ethernet sd shield?

    how do i get the website up?

    I've tried to do the same with uno but when i plug the rc522 as spi slave, nothing rfid readings...any help ?

    2 replies

    The Ethernet and the RFID reader are using the same pins( 50, 51,52) which are somewhere in the library. I gave up trying to find them so, I plugged the Ethernet Shield into a Uno and used a mega for the RFID reader. But to connect these two boards together you need to use pins 20 and 21 of the Mega which are used by the RTC module, which i gave up using as well. Unless you can find where you can change the pins, 50, 51 and 52 in the library, I have no idea how else this will work. As for the library for the RFID reader, I just created and Integer that reads and remembers the chip data, if you want to print them you have to manually enter the 8 digit number it will give you to the serial monitor or were ever else you want it. I hope this helped a little, but its all i got.

    They both should use SPI pins (those that you have listed). Only difference is Chip Select pins (Ethernet is using pin 10 and RFID is using pin 6). There is no need to change them since both Ethernet Shield and RFID module are using SPI library.

    How did you get your RFID reader to work? also were do you enter the library for the RFID chips? Please help

    Can I use my Intel Galileo Gen 2? It has an ethernet and a micro SD card slot.

    I have run into a problem with this... here is the log as you can see it added more hours than it should have... 2nd line from 21:44 to 0:1 == 21 hours 43 mins?

    8-22-2015 19:33, 21:44, 2:11, 20;
    8-22-2015 21:44, 0:1, 21:43, 42;
    8-23-2015 0:1, 0:27, 0:26, 42;

    does anyone know what the problem could be?

    I tried but code is to big for Atmega328. So Atmega2560 was first solution.

    ok thank you I will have to check it out ... I have an 1284p chip somewhere I will have to check if that will work... I wasn't thinking of the size of the sketch just the pins

    well I was able to try this out but had some differences with my setup to get it working properly ... I am going to make some changes and see about using a esp8266 for wireless instead and would like to add a screen for some status messafes(preferably with micro SD slot) ... would be nice to save clock in values in case of loss of power as well ... I'm going to try the project as is later but using the ethernet2 library to see if that shrinks the code enough to fit it on an uno or pro micro ... nice job on this project!

    If you wanted longer data logging, perhaps something as shown in this projected on Freetronics

    Personally I am building something similar, but much more complicated and many more features using RFID, NFC & Bluetooth, although it may require multiple bluetooth connections to achieve what I want, but we will see

    Very nice project. Only 1 thing that doesn't make sense. I've figured the Ethernet shield is not mounted on the mega unless you remove some of the pins on the shield. The power connections from the mega to Ethernet shield is wrong in the schematic I would say, or I'm I missing something? Also, the rfid reader's 3.3v pin would go to the mega and not the shield to get the voltage?

    1 reply

    Sorry, I see the shield does fit on the mega. Should I still connect pins 11-13 to pins 50,52,53? I can bring up the page with only the mega, shield and sd card. I've connected rtc, rfid, buzzer and leds but I cannot seem to read the tag or it doesn't give me wrong card indication.