BLOG > Tutorial 12 for Arduino: RFID Card Reading

Finally!  It’s been about 3 months since my last arduino tutorial – I’ve been keeping busy as usual.  I’ve been working on this one for some time.  I got the parts months ago, made an outline a few weeks ago, prototyped the circuits and wrote the code last week, and did the filming over the last few days.  I’ve upped the ante for my production capabilities on this video.  I’m using two cameras (A Canon Vixia HF11 and a Canon EOS Rebel T3i Digital SLR), a fancy new Rode Shotgun microphone, and more tripods!  I’ve also implemented some improved audio processing on my voice-overs, so let me know what you think!

RFID technology is really really fun in my opinion, and I’ve been wanting to implement it in a project for some time now.  However, doing that can be challenging.  But, thanks to the tutorial below, you should have no problems putting together a simple RFID-based security system!  I explain the physics of how RFID works in the video, but if you’re a physics nerd like me, and you’re hungry for more, be sure to read up on RFID on wikipedia.  In this video, I’ll explain how to setup an RFID reader (like this one) with your arduino, read some serial numbers, and use that data to make a secure entrance database.

 

You can download the files associated with this episode here:

GNU GPL License Distributed under the GNU General Public (Open-Source) License.
Please Attribute and Share-Alike.

192 comments

    1. The code is available for download in the post above. “Episode 12 Arduino Programs”

      I have no idea what you mean by “com4 javascript”

  1. Hey i was wondering for the cooking hacks.com site, the prices for the components are in pounds right? so does that mean when we order the parts from that site that it will be higher in cost due to currency exchange rates?

  2. Hey, thanks for you tutorial. It help me a lot: my rfid system works!!!
    Thanks!

    I’ve got a question, I need to change the baud rate to 38400. In the documentation, it says you can change it using a command CMD_SET_BAUD, but I have no idea of how to do it from Arduino. Is it possible?

    Thanks a lot

    Frank

    1. Refer to how I issued the auto_read command. In that case, I had to send a 0x87 and the accompanying data. To change the baud rate, you’ll need to send a 0x52. Look at section 3.1.1 in the datasheet for how to structure the command.

      1. hi i am from Nepal
        i am trying to control serrvo motor through Xbee-pro with arduino i am able to control only one servo motor will you help me to write audrino code how can i control more than one servo motor through Xbee-pro using arduino uno

  3. Hi Jeremy,

    cool vids! I did not really understand you said about the jumpers at 30:41. Can it cause any damage if the jumper is not setup properly?

    thx,

    laszlo

  4. great tutorials. just my 2 cents: in the code where you check if it’s your or your brother’s card, instead of if statement, how about:

    j_card = j_card && (data[i] == jeremy[i])

    should work, since it’s standard C syntax, but i understand you went with the “if” lines for simplicity’s sake… i just wonder if this’ll compile into smaller code…
    and keep up the good work

  5. Hey! Very nice tutorial!
    I just got a Mifare 1k RFID reader but I cant send a command from my arduino mega :(
    I cant send a byte array (like those Serial.print’s) from my tx pin
    What i’m doing wrong? 0o

  6. I’m a newby to the world of arduino but i get a long with it pretty well and your videos help a lot. Thanks for that.

    I guess the datasheet your showing is from the rfid module of the reader you are using, right? If I am now using an other Reader can I still use the values you used for the header etc. ?
    Better: Are the UART frames default?

  7. Hi, Its really wonderful tutorial,,, I have just one question, wheither is there way to make a configuration file / txt file that can be used for a user to enter tag IDs for maching,,,,I mean user dont have to enter IDs in arduino environment and compile every time if he/she would like to enter new card……

    Thanks,,,great work

    1. Yes, you can do this using an SD card with a txt file. I explain how to read data from from an SD card txt file in my datalogging tutorial. Check that one out.

  8. Hi Jeremy, the videos are very helpful, thanx for uploading. I have one querry, After detecting the correct RFID tag, I want to add some more security i.e., I want to add 4 pin password facility in this application, can u help me out in this regards. Thanks

  9. Thanks Jeremy, brilliant work!!
    I would like to inquire about your experience with NFC or Felica. Instead of a RFID i would like to do something similar with a NFC or Felica Card, can you kindly guide me to any of your videos or blogs with regards this?
    Thanks!!

  10. How to make a basic RFID reader…cz i wanna make a RFID based attendance system…so hw to make the circuit of reader..??? plz reply..its urgent…

  11. Hi Jeremy,

    I’ve downloaded this episode 12 program file. But i only see .ino file not the .pde. I still using the R2 Arduino. Can I have the code for R2 Arduino.

  12. Thanks,

    I’ve already found how to opened the .ino file. I opened it using Notepad++ and i can see your programming.

    Thank you for the great tutorial ^_^

  13. Very great tutorial. Helps me a lot. Thank you so much. You are awesome. Hoping for new tutorials.

  14. Hi Jeremy

    Great tutorial i´m new to Arduino and made a search after seing this tutorial i just wanted to ask you if this RFID reader can be used with the arduino?

    (it´s a Danish website but the text is in English)

    i hope to hear from you soon

  15. I’m trying to build the same FRiD reader. I just want to make sure i used the correct parts for this project.

    is the Arduino XBee Shield Empty the one you used for your project?

    thank you

  16. hello jeremy i have a project to do .. my ingredient is rfid reader rs 232,arduino duemilanove,max232,PC database.. you have other sample can help me with my project? i want arduino only read and write ..PC become the processing to compare the tag and save to database..

  17. Hello Jeremy,
    I wanted to ask if you can rewrite the unique ID of the RFID ID card of another card?

    Your video blog is very detailed and invested!
    Thank you!

  18. Could you use a RFID Reader #28140 with two tags to do the rfid lab or will it not work

  19. Would this work if i have my rfid connected like this… No XBEE, just the rfid board and arduino MEGA
    -ground connected to ground
    -TX of rfid to RX of arduino
    -RX of arduino to TX of rfid

    what differences in the code would I have?

    Thank you so much for this episode! It was soooo helpful and awesome!

  20. I’m trying to run the program and it giving this error. don’t know what to do.

    Binary sketch size: 3130 bytes (of a 32256 byte maximum

    tried changing port and other options giving on the arduino webpage

  21. Can we get timestamp when arduino reads rfid tags. if so what is the code snippet that reads and more info

  22. Hi,

    I ordered a RFID 125 KHz pack from cooking-hacks, but I am not able to get it working. If I have the rfid module attached and the jumpers in the USB -position, I get an error: “avrdude: stk500_getsync(): not in sync: resp=0xff”

    I am able to send the program if the shield is not attached (it is instructed that way in cooking-hacks example video) but the reader does not still work.

    Tried the jumpers in both positions (xbee/usb) no success!

    The setup contains Arduino Uno Rev3 board that works ok (tried other applications).

    Can anybody help?

  23. Hey I was wonder can you give me advice how can i make this project work with the xbee wireless chip

  24. Is it possible to send the tag ID over a network to a server, using a GSM module on the same arduino board? if possible could you please guide me through.

  25. Hey… I’m doing a project called RFID system lock using RFID cards and Arduino and a motor so just wanted to know ho to import the database I’ve created into Arduino or something like that

  26. Hi Jeremy,

    I am a grad student at Stanford.I am working at a lab where I am given the task to build an RFID attendance device.The objective of this would be to identify(log in) a student who uses a particular instrument and record the time of use.Thus we want to develop a simple,cheap,small RFID based product that can be installed with each instrument in the lab to track its usage.I have purchased a Teensy 2 arduino board, an RTC and a wifi interface.It would very helpful if you can help me with the Arduino coding for this project.I am completely new with Arduino,please help me out

    1. Fariah,

      I can’t write code for everybody who asks, unfortunately, or I’d have no time for my own work.You program the Teensy justl ike any other arduino. You can write the RFID code based on what I’ve written for this tutorial. As for the Wifi code, there are tons of examples on the arduino website. As you work on it, let me know if you have specific questions and I’ll try to help.

  27. hello mr. Jeremy Bum..I have an arduino mega and a rfid reader connected to uart, but i don’t know how to connect there pins.I hope you can help me..thanks

  28. Hi Jeremy,

    I’m NEW to Arduino. I’ve recently found this Series and loved it!. Easy to understand, great amount of details, Thanks!.

    I have a project in mind for a self-serving machine that reads/writes info from a smartcard. What I’d love to do is:

    – Read SC id.
    – Read SC credit balance.
    – Be able to “buy” stuff with the balance and “charge the expense”.
    – Write ‘new’ credit balance to SC.
    – Write purchase order into a Log.

    I was thinking of using this https://www.sparkfun.com/products/9440? and use the same RFID principles, but I’m not sure how to… Is there a library and schematics for me to go through?

    Thanks again,
    Gus

    1. The library used here will be sufficient for the reading. You’ll need to write some of your own, including an array of variables that keeps track of current credits, and adds and subtracts from them accordingly.

      1. Jeremy, thanks for the tips, but I’m not sure how to connect the SmartCard reader/writter hardware and I don’t want to fry-it…

  29. hello Mr. Jeremy, does it possible to read multiple tags at the same time? if then, what will the changes on this tutorial you’ve made? thanks a lot.

  30. hey jeremy, great tutorial, I have a project with RFID same as this tutorial, but i shoud use arduino UNO, do you think that it might not be a problem if i use the code that u used in this tutorial, what is the different between UNO and MEGA? thanks

  31. Hi Jeremy! Before all, congratulations for your tutorial! I new in the Arduino world, so I asked you about a question. I’m working on a project with Arduino UNO and the RDM630 RFID module, using the serial port of the Arduino.

    The problem is I can’t see nothing by the Arduino’s serial port, only the message I see is “Card ID – ÿÿÿÿÿÿÿÿÿ” and I think I’ve been ok connected all the pins. I was looking some codes of different people and it didn’t working.

    Do you know where is the problem? I posted the link of the module: http://www.seeedstudio.com/wiki/index.php?title=125Khz_RFID_module_-_UART

    Thanks!

  32. PLS which XBee shield should i get. is the WRL-09132 – XBee Explorer Regulated okay for this, or am i gonna need to buy something else to attach to it.
    also what about the USB XBee Adapter – ID: 247 is it okay?

  33. Do you know where to get a full list of communication protocols? I recently bought the SM130 and the datasheet is incomplete in terms of communication protocols. I didn’t know if there was a way to read them off the device itself, or if I need to get them from an outside source. Any help is appreciated.

  34. Hi guys!

    The problem what happends it is about the interface. The RDM630 has two different interfaces; TTL-RS232 or Wiegand. And we use Arduino’s Codes for the wrong hardware interface. So when I used a correct code for the interface of my RDM630, in my case Wiegand, the module runned perfectly.

    1. Do you have a sample of your code using Wiegand?

      I have a similar setup and running into the same problem. I appreciate any help you can provide.

  35. HI Jeremy

    I have been watching all your arduinos tutorials videos and I can’t wait for my arduino to arrive to start making “cool stuff” as you say, and I have a question. I wonder if putting together the sd card shield that you show in an early video with the RFID Card Reading , can be possible to make a wav. file and upload it to the sd card and make a code as the one that you did to play the melody every time you slide the card in front of the coil, so instead of play the melody, plays the wav. saying HELLO JEREMY. I think something like that is possible, isn’t it? and I don’t have a clue of how to do it? but I don’t want you to give me an answer of how to do it, just a simple (yes, it can be don or not, it can’t be done and If I will be needing something else to do it) because I want to try to do it by myself.
    Don’t get me wrong, I just want to get fun braking my head apart trying to do it as you do with you creations hehehe. and maybe I would be asking you things that I don’t understand, If you don’t mind.
    Thanks for your video tutorials I got fun watching them and I will be watching them again when I get my Arduino.
    Thanks.

  36. Can you please tell me how can i use the rfid data entering the com port of my laptop to link an associative database..can you provide me any links which teach the same..i sahll be grateful

  37. i have purchased Mifare YHY502CTGV33 RFID read/write module. but facing difficulties in interfacing with arduino duemilanove nano board. the module itself has a small microcontroller ATMEGA8A on it, so should we use another one, for read write application.

  38. Hello Jeremy,

    The Skylanders portal accepts 3 RFIDs “simultaneously” and keeps them lit up during the time they are on the portal. If one is removed and another RFID is placed on the portal it recognizes both actions while maintaining the other 2 remaining lit RFIDs. Does this require extra hardware (ie multiple coils), or extra software — or both?

    Thanks.

    Regards, Dennis

  39. Hi a buy a arduino + Xbee + RFID125khz when i upload to the arduino i have this message avrdude: stk500_getsync(): not in sync: resp=0x00 (avrdude: usbdev_open(): did not find any USB device “usb”) but if i take out the RFID from the xbee the upload work fine.
    can you help me?/

Leave a Reply to akesh Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Advertisement