Introduction: 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?
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.