Introduction: Arduino Attendence Logger

Picture of Arduino Attendence Logger

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?

Picture of 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

Picture of 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.

Specification

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 of 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

Picture of 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

Picture of 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

Picture of 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.

Comments

KushalS13 (author)2017-07-16

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

vica070808 (author)2016-12-27

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

vonPongrac (author)vica0708082016-12-28

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

Rookie89 (author)2016-10-21

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?

NicoD6 (author)2016-06-12

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?

LukasG16 (author)2016-05-22

how do i get the website up?

LithanA (author)2015-11-25

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

cnadeau3 (author)LithanA2015-11-30

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.

vonPongrac (author)cnadeau32015-12-01

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.

cnadeau3 (author)2015-11-24

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

Chief_Monkey23 (author)2015-09-26

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

DavezDesignz (author)2015-08-23

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?

DavezDesignz (author)2015-08-19

does it have to be a mega? or would an uno or pro micro work?

vonPongrac (author)DavezDesignz2015-08-19

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

DavezDesignz (author)vonPongrac2015-08-19

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!

jpsimmonds (author)2015-07-27

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

http://forum.freetronics.com/viewtopic.php?f=6&t=5361

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

Warren Arendse (author)2015-07-25

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?

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.

You should use example from RFID library to determine your tags UID. I think this example is called DumbInfo. When you know the UID of your tag, write it to variable UID_tagA.

I am using this little trick:

http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/

Arduino Mega 2560 have SPI interface on pins 50, 51, 52, 53, so you must connect those pins (exept SS is on pin 10 so it is connected via shields pins). Just follow tutorial that I provided in this comment.

diy_bloke (author)2015-07-24

cool

tomatoskins (author)2015-07-23

This is super cool! I've often wondered about how long I spend on projects as well!

About This Instructable

24,345views

262favorites

License:

Bio: I am an engineer and a maker who loves technology challenges.
More by vonPongrac:Robotics guideArduino attendence loggerLED Night Light (Dark Sensor)
Add instructable to: