What I needed was an access control system for my office.
The whole project is pretty easy to build.
I had a spare Aduino Mega and a Ethernet shield at home, so, with a few more components I have been able to build an access control system for my office. It uses NFC tags and mySql database to collect data's into a table.
Substantially, the Arduino waits for a tag, then it will try to contact a php webpage which will manage the upload of the data into the database. To do this, it will check first for the presence of the tag into a "users" table of "known" tags. The table contains infact known users and their relative tags.
If the tag is not recognized, the Arduino won't record the access. Otherwise, it will insert a record into the table. At the moment, timestamp, id_tag, the company branch (location), and the ip are recorded into the table.
I added also a lcd to make the things easier for the users. When the access is recorded, a green led will flash for few seconds and a buzzer will play a short tone with increasing pitch. The lcd will show a short ok message for few seconds.
If some issues occur (as lan not working, or unknown tags), a red led will flash instead, and the tone played will have a decreasing pitch. The lcd will show also a short error message for few seconds.
With a couple of buttons more, you can manage to record also the kind of operation: "is that an access or an exit?!" (but this will be developed another time).
Step 1: What You Need - Components and Wiring
First of all, it is a database oriented project, so you will need a webserver where to upload a .php file. this is the code part that which process the requests of the arduino and manage the database.
Also you need a mysql database, where all the accesses will be stored.
You can build up everything in a local "server" in your office (maybe xampp is a good and easy choice) or if you have a website+mysql db it could be the same.
Ok, here's the bill of materials:
- Arduino Mega 2560
- Ethernet shield W5100
- RF522 rfid tag reader compatible with 13,56mhz 14333A tags
- Display LCD 16x2 1602
- a piezo buzzer or another kind of buzzer
- A bunch of wires
- A couple of leds (green and red) and 2 of 2k resistances
And, ok again.. about the wiring...
The pictures about the wiring are not the best, but it is better described into the arduino sketch attached in the next step.
Step 2: The Code and the Attachments
Finally, here there are the files that you are looking for.. In attachment you will find
- timbrature.ino, which is the sketch to upload into Arduino Mega.
As mentioned before, all the connections and the wirings about the lcd and RFID board are described into the header of the .ino file
- rfid lib.zip, which contains the rfid library needed
- timbratura.zip, (timbratura.php) this file is the file that you need to upload into your website webserver.
It will manage first to recognize the tag (check if it exixt into the "users" table), then it will record the access to a mysql "access" table.
Step 3: Finish: Test Everything - the Video of the Working Thing
Now you are ready to watch the video again. It's about how the reader works, check the tag and record the access to the database. I hope that the video will be more clear now compared to the first step.