loading
Security System and Access Control with Arduino and RFID


This project is an evolotuin of my first project called "Arduino - Security System and Access Control"
As you can see at the blog http://arduinobymyself.blogspot.com.br/2012/03/arduino-sistema-de-seguranca-controle.html (sorry but this project still be in Portuguese).

Instead of using a matricial keyboard, to enter passwords and to allow access to a door or to drive an electronic device, now we will use a RFID (Radio Frequency Identifier Device).
We also will use a LCD Display with 20 character and 4 lines to show some messages from the system, besides a servo-motor to drive an mechanical device like (door's locks, turnstile, etc...).

The electronic device used  it is the MFRC522AN RFID (13.56MHz MiFare RC522AN with SPI communication) which can be easily found on electronics shop or on the internet sites at an affordable price.

Like this: http://www.fystore.com/p42892/RFID-module-Kits-S50-13-56-Mhz-6cm-With-Tags-SPI-Write-amp-Read-for-arduino-uno-2560.html



Step 1: Operation

OPERATION:

Users will have cards or tags registered to access the system.
When approaching the card/tag to the RFID sensor (approximately 6 cm), the
serial number of this card/tag is detected and so compared with a serial number  that are recorded in the software or in a database on a memory card; if it is a registered serial number, the system will release the entry of this user. A green LED will be lit and some messages will be appearing  in the LCD display ( user recognition and user  welcome), besides that a servo will be drived to release a mechanical device.

Otherwise, the system does not release the user access, and a warning red LED will be lit  and will be showed a message on the LCD advising  the user to contact the account manager.
During this process of release or rejection of users, characteristics beeps will be played on a buzzer (just like a sound announcement).

See the explanatory video at the "Video and Picture" section.

Step 2: Stuff and Materials

STUFF and MATERIALS:

1 x Arduino UNO, MEGA, Duemilanove ou Teensy, etc...
1 x RFID MFRC522AN (SPI communication)
1 x servo-motor 9g
1 x LCD 20x4 (I2C comunication)
1 x green LED
1 x red LED
2 x 220 Ohm reistor
1 x Buzzer
1 x Bread Board
wires and cables to the connection

Step 3: Device Interconnections

INTERCONNECTIONS:


Interconnections from the RFID to the Arduino pins:
Reset     > Pin 5
SS           > Pin 10
MOSI      > Pin 11
MISO      > Pin 12
SCK       > Pin 13
Ground  > Ground
3.3v        > 3.3v


Interconnections from the LCD (I2C) to the Arduino pins:
GND > GND of the Arduino
VCC > +5V of the Arduino
SDA > A4 pin of the Arduino
SCL > A5 pin of the Arduino

Step 4: The Whole Project Interconnections

The whole project:

Remember that the LCD is a 20x4 display and the RFID is the MRFC522AN device.
The Buzzer and the servo motor are general purpose devices.

Step 5: Programming

The files were deposited in google drive, to access, you need to create your own account or ask me to share the file with you.


Below you have the Arduino's sketch, that should be placed in a folder with the same name of the file.
https://docs.google.com/file/d/0B_YlEklLDDS7SzhtU1BhZGMxMW8/edit?usp=sharing


In the next link you have the file "pitches.h" it is necessary to play the musical notes and the sounds, it must be in the same folder of the Arduino sketch.
https://docs.google.com/file/d/0B_YlEklLDDS7cmVDQmRpT29xRlE/edit?usp=sharing


L
ibraries:

https://docs.google.com/file/d/0B_YlEklLDDS7Qy1pemh3bGgwQTg/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7dDVkaHNVVG5vcjQ/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7dDVkaHNVVG5vcjQ/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7WTJQcU1FU083UG8/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7Mkp1RnZTTlhEeDA/edit?usp=sharing

Get all files on GitHub:

https://github.com/Arduinobymyself/ArduinoRFID.git



Step 6: Videos and Pictures

VIDEO:

This is a preliminary video, only to see the general operation of the system.

See on youtube:
http://youtu.be/2O7IVOfFptA




http://youtu.be/fuWf0W6yNo4

 
The display is not displaying the message only black captions
good job mr
<p>It doesn't work for me :(</p>
Hello sir<br>I may use your code its super sir.<br>But myquestion is how to display a employees detail in LCD display ? What's it's code ? Plz sir share a link or code sir it's my project sir so soon you replay sir<br> Thanking for you are code
I modified some things :p thanks a lot!
Hi KatV1<br>May I ask about code and schematic this project? I really need it for my assignment.<br>Thank you
Hi Sir<br>May I ask about code and schematic this project? I really need it for my assignment.<br>Thank you Sir
<p> Please where is the code in english?</p>
<p>ask me in this email arduinobymyself@gmail.com</p><p>Put the project name and I will send de details for you.</p>
is the tutorial to save allowed tags in SD card posted already? great instructible<br>
<p>BIGDOG1971 halo,<br><br> thanks for posting, so help me.<br> overnight tried in sequence and a little editing on:<br> emaomos byte [5] = {0xDE, 0x1F, 0x47,0xC9,0x4F};<br> with HEX my tag, and managed to walk. and I want to adding a tag id in order to use his ID, respectively, if you can help how to code?<br> and for the future development of this program if it can be combined with a password keypad, with the picture when the id tag will bring up the program received a command to enter a password<br><br> Thank you in advance</p>
<p>Sir,</p><p>in your sketch there is</p><p>byte emaomos[5] = {0xDE,0x1F,0x47,0xC9,0x4F}; // Marcelo Moraes (e+mao+mos)</p><p>Please explain to me about correlation between emaomos and 0xDE,0x1F,0x47,0xC9,0x4F ? How to translate that?</p><p>If i wanna use my name, let say WACHID how to type in sketch.</p><p>Thanks Sir,</p>
<p>Mr Wachid,</p><p>for </p><p>byte emaomos[5] = {0xDE,0x1F,0x47,0xC9,0x4F}; // Marcelo Moraes (e+mao+mos)<br>// coloque aqui seus outros cart&otilde;es permitidos</p><p> if not wrong to be edited or inserted tag HEX father, I happened overnight to try and succeed.</p>
<p>Where do we get the RFID tag?</p>
<p>Marcelo how are you ? You talked in your previous posts, that you were developing a RFID Access Control with log , hows that coming?</p>
<p></p><p>Ol&aacute;, obrigado pelo belo tutorial, mas eu coloquei o codigo aqui para rodar e deu erro, o que eu fiz de errado?</p><p><br></p><p><br></p><p>RFID_Simples.ino:35:21: error: pitches.h: No such file or directory</p><p>RFID_Simples:40: error: 'RFID' does not name a type</p><p>RFID_Simples:46: error: 'LiquidCrystal_I2C' does not name a type</p><p>RFID_Simples:52: error: 'NOTE_G4' was not declared in this scope</p><p>RFID_Simples:52: error: 'NOTE_A4' was not declared in this scope</p><p>RFID_Simples:52: error: 'NOTE_B4' was not declared in this scope</p><p>RFID_Simples:52: error: 'NOTE_A4' was not declared in this scope</p><p>RFID_Simples:52: error: 'NOTE_B4' was not declared in this scope</p><p>RFID_Simples:52: error: 'NOTE_C5' was not declared in this scope</p><p>RFID_Simples:54: error: 'NOTE_G2' was not declared in this scope</p><p>RFID_Simples:54: error: 'NOTE_F2' was not declared in this scope</p><p>RFID_Simples:54: error: 'NOTE_D2' was not declared in this scope</p><p>RFID_Simples.ino: In function 'void setup()':</p><p>RFID_Simples:70: error: 'lcd' was not declared in this scope</p><p>RFID_Simples:74: error: 'rfid' was not declared in this scope</p><p>RFID_Simples.ino: In function 'void loop()':</p><p>RFID_Simples:88: error: 'lcd' was not declared in this scope</p><p>RFID_Simples:94: error: 'rfid' was not declared in this scope</p>
<p>How can i use a relay instead of servo? What changes need to be done to sketch? Thanks</p>
<p>Sir,i am having trouble while installing library,can u please send me detailed procedure for installing rfid libraries and its original program to work...plz respond as soon as possible....Thankyou...plz email me at aamirabbas1194@yahoo.com</p>
<p>Hi can i get the following file and can you share the file to muhammad_iman_shah_b_abu_bakar@ceseit.sg and can you send or share it through my google drive . I really need the files for the arduino project and it is important to have them otherwise your arduino project that im testing out will not be complete. i will really appreciate if you send the files.</p><p>&lt;SPI.h&gt;</p><p>&lt;RFID.h&gt;</p><p> &lt;Servo.h&gt;</p><p>&quot;pitches.h&quot;</p><p> &lt;LiquidCrystal_I2C.h&gt;</p><p> &lt;Wire.h&gt;</p>
<p>Hi Im new to arduino and im trying to make your project but the point is when i download the arduino code from your google drive i open it and see it is in a different language and when i try using google translate, i cant translate out the words. so can you upload anther arduino code for this project in english so i can download the english code from you.</p>
<p>how Muc power does the RC522 draw from the Arduino UNO. I thought it was limited to 50 ma at 3.3v any problems with this? Can you handle multiple tags?</p><p>Nitrous</p>
I'm new to the arduino and programming. Would this be simple for me to setup? Instead of the servo I will be using a relay. I've tried a couple other script but cannot get them to work. Please let me know if this would work on the latest arduino... I will,order all parts.
<p>how to adding new card, which has 4 byte and 7 byte?. in your code only using 4 byte. your answer will be very useful to me. please answer. or send me and email to : mohadrianfaisal@gmail.com</p><p>please</p>
<p>wheres the code in english plz?</p>
Request the code and libraries by sending us an email<br><br>arduinobymyself@gmail.com<br><br><br>Regards.
<p>Nice explained on Security System and Access Control with Arduino and RFID Thank you! Iwatchs.</p>
<p>hi sir, can you explain this code</p><blockquote>byte emaomos[5] = {0xDE,0x1F,0x47,0xC9,0x4F};</blockquote><p>thanks before</p>
<p>Hi. i emailed you. and you didn't answer. why my MFRC522AN doesn't read my RFID card/tag. please response as fast as you can. im begging. :( my wiring connections are correct and the program doesn't have any errors. please</p>
I am so sorry.<br>I cannot find your email, please send the email to me again.<br><br>Regards<br><br>arduinobymyself@gmail.com<br>
<p>Hello,</p><p>I am on similar project with this RC522 RFID reader, check working flow how it works. Details here:</p><p><a href="http://forum.arduino.cc/index.php?topic=256260" rel="nofollow">http://forum.arduino.cc/index.php?topic=256260</a></p>
Great job.<br>I am preparing a new post with the RDM6300 module and it will work like your system. A master tag will add/delete users in the system.<br><br>I hope I can post it as soon as possible.<br><br><br>Best Regards<br>
<p>This was my first thought for use of arduino. I'm new and haven't bought anything yet. What do you think the max wire length would be for the reader? How do you program the reader? I'd like to also open the door with my cell phone by sending an sms or hitting a tiny web page or something.</p><p>Have you considered putting your code on github.com? It's a great way to share and version you code.</p><p>Thanks!</p>
Hi<br>Send me an email <br>It will be a pleasure to sharing the code and libraries with you.<br><br>I do not have a project with RFID and Ethernet or SMS yet... maybe in the future.<br><br>Regards.<br><br>arduinobymyself@gmail.com
Very nice work ! i dont have the access to the code source but it's seem to be smart again. If you want to improve your system use an external i2c eeprom to control who are allowed an not with a basics comparaison. <br>
Hi,<br><br>Thanks for the advice.<br>I intend to using a SD card to store the allowed users and to log the access attempts (I will make a tutorial about SD card with SPI communication).<br><br>If you want the code, I can share with you.<br>Send me an email; marcelo.moraes.1971@gmail.com<br><br>Cheers
<p>hi,</p><p>i am biwwot i intend to work on a security system based on rfid with a adruino mega ,,,a stepper motor a lcd dispay,a rfid module, </p><p>could you please assist me with the coding</p>
<p>Hello, you can find a good Mifare RFID kit with reader, tag and card.</p><p>They sell it cheap on this webstore:</p><p><a href="http://voltatek.com/en/home/110-mifare-rc522-rfid-card-reader-module.html" rel="nofollow">http://voltatek.com/en/home/110-mifare-rc522-rfid-card-reader-module.html</a></p><p>They ship from Canada.</p>
<p>Congratulations for your tutorial and mainly for sharing it with the community. I would like to ask you to share or send me the code and libraries on:</p><p>1-) by e-mail: caedviana@hotmail.com</p><p>2-) or on dropbox and google drive: ceviana.s3@gmail.com</p><p>Thanks in advance. Carlos VIANA</p>
<p>there's an error <br>it says &quot; 'RFID' does not name a type &quot;<br>What should I do ??</p>
ARDUINO'S LIBRARY INSTALLATION PROBLEM<br><br>This kind of issue is due to libraries installation failure.<br>To solve the problem, proceed as shown below.<br><br>Remove all project libraries from the &quot;libraries&quot; folder.<br>To install the library(ies), follow the steps below:<br>1 - take sure that the Arduino's IDE is closed; <br>2 - unzip the library(ies) in the &quot;libraries&quot; folder of the Arduino's IDE; <br>3 - open the .ino file and compile it.. <br><br>90% of people with this kind of problem, have solved it by following the procedure above.<br>If not, please re-install the arduino's IDE.<br><br><br>I hope I have helped you. <br><br>Feel free to send me your questions. <br><br><br>Best Regards<br><br><br>Marcelo Moraes <br>arduinobymyself.blogspot.com.br <br>arduinobymyself@gmail.com
<p>i have a problem, when i download and install the RFID library i don't think that it's working, no error when checking syntax but my reader isn't responding, and when i put the code in the arduino software with library installed the word RFID in include &lt;RFID.h&gt; stays in black, and not turning orange like a library should do</p><p>any solution?</p>
Hi Daznovia,<br><br>This kind of issue is due to libraries installation failure.<br>To solve the problem, proceed as shown below.<br><br>Remove all project libraries from the &quot;libraries&quot; folder.<br>To install the library(ies), follow the steps below:<br>1 - take sure that the Arduino's IDE is closed; <br>2 - unzip the library(ies) in the &quot;libraries&quot; folder of the Arduino's IDE; <br>3 - open the .ino file and compile it.. <br><br>90% of people with this kind of problem, have solved it by following the procedure above.<br>If not, please re-install the arduino's IDE.<br><br><br>I hope I have helped you. <br><br>Feel free to send me your questions. <br><br><br>Best Regards<br><br><br>Marcelo Moraes <br>arduinobymyself.blogspot.com.br <br>arduinobymyself@gmail.com
<p>tried to, and still the same problem. why are there 5 links for the library ? i cannot even make the example work !</p>
<p>also my reader is a funduino RFID RC522 and i'am using it with a nano</p>
This is a really cool project! I have similar RFID reader, and I have no idea how to use it. I know the basics in serial communication, and have looked for other tutorials for RFID. I can not find anything the applies to my type of reader. I have a MF522-AN. If you could make a tutorial for the use of your RFID or point me in the right direction for how to use it that would be very helpful!
Excellent! I will do that when i get the chance.
Hello,<br><br><br>I think you can use the code I have posted on my instructables about RFID with your MF522-AN.<br><br>Send me some specification of your RFID reader for my analysis.<br><br>Best regards<br><br>Marcelo Moraes<br>arduinobymyself@gmail.com
<p>hello,</p><p>could you provide the sketch of this cretation , because i want to improve my experience with arduino.</p>
Hi Uzan<br><br>I will be glad to share the code with you.<br><br>Send me an email, in this way I can send you the code and libraries.<br><br><br>Cheers!<br><br>Marcelo Moraes<br>arduinobymyself@gmail.com
<p>Hello thank you for the tutorial, it has filled in some gaps in my knowledge, my only question would be could you provide the source code with english annotations please so I can follow it better, allowing me to make adaptations for my own project, I would be very grateful for this </p>

About This Instructable

153,464views

190favorites

License:

Bio: I am 43 years old and I live in Brazil. I am a Telecommunication / Electronics Engineer. Sixteen years acting in the industry of "Telecommunication and ... More »
More by BIGDOG1971:Arduino Propeller Message Display (POV) ARDUINO By Myself Mini-CNC (Plotter) ROVER Bot - The Arduino Bluetooth Controlled Tank 
Add instructable to: