3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to connect Arduino and RFID

How to connect Arduino and RFID
On this instructable I will try to show how to interface a RFID sensor with the Arduino. I am using the RFID sensor from seeedstudio the serial version of it. There are a few parts you will gonna need. I also bought some RFID keys.

UPDATE: Now it works with IDE 021
 
Remove these adsRemove these ads by Signing Up
 

Step 1What you gonna need?

What you gonna need?
«
  • DSC05286.JPG
  • DSC05288.JPG
- Arduino Board
- RFID Sensor from seeedstudios
- Wires
- Protoboard
- RFID tags (125kHz) from seeedstudios
« Previous StepDownload PDFView All StepsNext Step »
66 comments
1-40 of 66next »
Oct 13, 2009. 4:30 AMepidemicz says:
Thanks for the instructable man, really appreciate it.  I've been wanting to do something with rfid and this is going to help me out big time.
May 15, 2012. 7:46 PMhissamu says:
Olá Otavio! Parabéns pelo projeto, porém não estou conseguindo compilar o projeto. Adicionei a NewSoftSerial12 e tentei usando a versão 0021 da IDE do Arduino, só que fica dando erro no NewSoftSerial.cpp. Poderia me ajudar por favor? Obrigado!
May 7, 2012. 8:23 PMmgerboni says:
Friend, would you can send me this java application that is displaying the readings on the screen?
Apr 15, 2012. 10:31 PMjayduino says:
Hey Guys, this little board comes pre programmed with code.. Just hook it up to your computer if you don't want to mess around with arduino. You also have the option to program it if you want to be more creative. Just though I would share it.

http://www.jayconsystems.com/product_detail.php?prod_id=283
Mar 19, 2012. 6:34 AMtxmg says:
sorry! when i put code in arduino 1.0
it with this problem
sketch_mar19a.cpp:1:27: error: NewSoftSerial.h: No such file or directory
sketch_mar19a:5: error: 'NewSoftSerial' does not name a type
sketch_mar19a.cpp: In function 'void setup()':
sketch_mar19a:14: error: 'RFID' was not declared in this scope
sketch_mar19a.cpp: In function 'void loop()':
sketch_mar19a:22: error: 'RFID' was not declared in this scope
sketch_mar19a.cpp: In function 'void add()':
sketch_mar19a:40: error: 'RFID' was not declared in this scope
sketch_mar19a.cpp: In function 'void del()':
sketch_mar19a:66: error: 'RFID' was not declared in this scope
does it mean needing head file "NewSoftSerial.h"
Mar 19, 2012. 7:57 AMtxmg says:
may be i know
Jun 24, 2011. 5:03 PMMark3rr says:
Hello,
Im a newbie, but I like to play araund with arduino and cool stuff like the rfid reader.
My problem is the code.

i used the little part of code from mwp

to make the arduino`s serial monitor speak to me. But the only thing it says is:
access denied
access denied
access denied
access denied
no matter what a Tag i use it ever gets this failure..

What can I do now..
please help me :)
Feb 19, 2012. 5:06 AMwfelix says:
have you change the id cards in the code?
Dec 5, 2011. 1:17 AMpmason3 says:
Hi, I am very new to the whole arduino thing, so I may have jumped in too deep for this one. I am having troubles using the NewSoftSerial library, i keep getting errors when attempting to compile;

In file included from FY1Z49MGH89ZZ95.cpp:1:
C:\Users\joker\Downloads\arduino-1.0-windows\arduino-1.0\libraries\NewSoftSerial/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\Users\joker\Downloads\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)

Am I missing other libraries? Any help at all would be greatly appreciated!
Feb 19, 2012. 5:05 AMwfelix says:
Also, you should read this in "newsoftserial"page: "The latest version of NewSoftSerial is available here: NewSoftSerial12.zip. Note: don’t download this if you have Arduino 1.0 or later. As of 1.0, NewSoftSerial is included in the Arduino core (named SoftwareSerial)."
Feb 19, 2012. 5:02 AMwfelix says:
Actually, arduino 1.0 has a LOT of incompatibilities with old libraries... try to downgrade to 0023 or 0022

When you got more expertise, you can adapt the old libraries to work with new 1.0 arduino SDK ;)
Jan 19, 2012. 10:28 AMMeca242 says:
When I try and verify the sketch it says "it says error "RFID" was not declared in the scope."

Please help me fix this!
Jan 23, 2012. 10:40 AMMeca242 says:
Yup, I do have the newsoftserial library and it is still giving me the same error as before.
Oct 1, 2011. 11:40 AMpsicopato says:
Hi,


I'm a nooby to RFID and as well to arduino stuff.

I'm trying to keep the accepted cards in arduino's EEPROM and I managed to do so but it is getting difficult to know which way to grant access by comparing the read card number and stored card number. How can I do that??
Jul 16, 2011. 8:44 AMdanieljcooper says:
How do I stop the reader from reading a card once it has read one?
I am having problems with the reader reading the add and delete cards twice. Hope that makes sense. Cheers
Mar 19, 2011. 9:32 AMmwp says:
i have just been trying this code on a Duemilanove with an ATMEGA328, and was not seeing any response to the RFID tags.

When I uncommented the println statements in the reading loop it worked as expected, so it seems that the program was trying to read the bytes too fast. After the first byte is read it loops back to test if another byte is waiting, and if it is not, then the loop exits with the string 'msg' just one byte long.

It works when the println is executed, because then there is always time for the next byte to arrive before RFID.available is called.

The solution is to add an explicit delay:

while(RFID.available()>0){
c=RFID.read();
msg += c;
delay(1); //allow time for another byte to arrive
//Serial.println(msg); //Uncomment to view your tag ID
//Serial.println(msg.length());
}
Feb 10, 2011. 3:48 PMdevondo says:
What is you code? i can't download it here its just a Tmp file
Jan 3, 2011. 4:21 AMparadox116 says:
I can't get to the code you included here and I'm still learning the ins and outs of programming.. could you please send me the code in a private message? I have the same RFID reader and I'm stalled on my project until I can figure out how to get my code to work. Thanks!
Jan 16, 2011. 2:33 AMparadox116 says:
It keeps downloading it as a .TMP file. It's probably some simple fix that I just don't know about.
Nov 9, 2010. 5:31 AMyaRincewind says:
Hi :)

Looks cool.

Unfortunately the arduino SDKs from 0018 (?) on don´t support the string library anymore, instead there is one build in (the old library isn´t even available for download anymore).

But the code will not compile with 0021. I´ve just deleted the #include .

Now I keep getting errors like:
rfid:25: error: 'class String' has no member named 'append'

Could you please make an update so that never SDKs would work?
Nov 9, 2010. 10:30 AMyaRincewind says:
That would be great :-)

Thank you very much in advance.

Cheers
Rince
Nov 4, 2010. 11:37 AMTetragammatron says:
Does anyone know if there's a way to extend the range of the RFID sensor? I would like to detect an RFID chip on my person to unlock my door just by approaching it. I was thinking perhaps multiple antennae's or a higher gain one? Does anyone have some good ideas or thoughts with how to accomplish this?
Nov 4, 2010. 1:12 PMTetragammatron says:
Thanks otaviousp! Is there any in between that you are aware of? For example, RFID is usually in a range of a half a foot or less, whereas active tags like RF and UHF can range up to 100m. I'm looking for something in the 5 foot range. Do you think that my only alternative will be to use an active tag that requires power, etc? Thanks!
Sep 9, 2010. 4:39 PMCoolKoon says:
Hey, nice instructable! I've been fooling around with Arduino boards for a while but didn't know that there's such a simple module for it that can be used to set up an RFID system. Say, is this thing able to write things to RFID cards as well? Or is it a read-only system?
Mar 22, 2010. 9:42 PMGuibom says:
Hey Man, thanks!! I thought my RFID was broken... I could get the LED to flash when I scanned a card, so I knew the antenna/etc was ok  But I couldn't read the card at all... Turns out using the old SoftwareSerial didn't really work out.
When I saw your example and changed to the NewSoftwareSerial, it instantly fixed the problem.

E vc e' Brasileiro ne'?! =D
Aug 17, 2010. 10:45 PMvitizen says:
how did u get the LED to flash, the LED connected from LED out to ground, does not flash when connected to a 5V DC supply. thanks
Mar 26, 2011. 4:49 AMnrodrigues says:
boas, eu gostava de controlar os 8 leds via webrowser no arduino ( D2 a D9 )
ou seja uma pagina simples em que tenha um ON e OFF via ethernet atravez dele....

email : lx.nuno.rodrigues@gmail.com


OBS : Estou a usar o Arduino Uno + Ethernet Shield ( com MiniSD )
Jul 26, 2010. 5:39 AMarduinoer says:
What is NC on arduino?
1-40 of 66next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
31
Followers
5
Author:otaviousp