How to Connect Arduino and RFID

402,142

394

180

Intro: 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

Step 1: What You Gonna Need?

- Arduino Board
- RFID Sensor from seeedstudios
- Wires
- Protoboard
- RFID tags (125kHz) from seeedstudios

Step 2: Plugging All Together

Connect the antenna on the appropriate pins like the first photo.

Plug the RFID sensor to the protoboard like the second photo above.

Only 3 wires are required to interface, 2 wires for supply and another for the serial line(communication)
The wires as connected as the third photo shows.
On RFID sensor: PIN 1 -> Tx
PIN 2 -> Rx (Not Used)
PIN 3 -> NC
PIN 4 -> GND
PIN 5 -> VCC (+5V)

Tx from RFID board goes to Digital PIN 2 on Arduino Board.

That is all you gonna need to wire.

Moving on to next step, the software.

Step 3: The Code

I'm not a software guy, so this code is just for demonstration.

I don't make any kind of checksum at the tags code, but it seems to work fine.

The code is really simple. I used a new library for the serial, using software emulation.

With the two white cards you can deny or allow the access of others keys.

Any doubt, please ask me.

Edit (05/11/12):
code update for new Arduino version

Step 4: Results!

There is no LED, sound or LCD for debug or visualization, just through the serial line.

The video demonstrate how to use the software. I didn't post any kind of explanation as text on the video. I hope that the images spokes more then words, xD

Any doubt or suggestion, feel free to ask, or correct me.

Please, if you like it, rate it,

thank you


Share

Recommendations

  • Audio Contest 2018

    Audio Contest 2018
  • Tiny Home Contest

    Tiny Home Contest
  • Metalworking Contest

    Metalworking Contest

180 Discussions

0
None
epidemicz

8 years ago on Introduction

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.

1 reply
0
None
TrầnÂ19

8 months ago

i connected module to arduino promini with your code but i can see my tag code in serial monitor.

can you help me ?

thanks.

0
None
greatescapeprops

10 months ago

Thanks for the tutorial. I have it all working but the cards do not read fast enough or not at all. I have to put the cards directly on the antenna. Any ideas on this? I have all 125Mhz cards with the correct reader and hookup is correct. Thanks.

0
None
Gregory Akau

1 year ago

Don't know why I'm having a multiple read for each card I swap

0
None
ShoaibH3

1 year ago

plz send me rfid code at this shoaibhassan031439@gmail.com
i need it urrgent...plz

0
None
sweeth

2 years ago

Hi, This is really nice. Can we calculate distance also? if in case we would like to calculate distance as how much far or close the tag is with reader , is that possible?

Regard's

Hari

2 replies
0
None
otaviouspsweeth

Reply 1 year ago

I don´t think it is possible to do that with this particular module.

0
None
sweethotaviousp

Reply 1 year ago

Hi, Thanks for the kind response,

Can we measure distance via signal strength? Or can you please suggest me any other module? I have MLX 90109 with DVK 90109 and EVB 90109

0
None
lef11

2 years ago

I had the readers and they dont seem to be reading i have them hooked up the way you have it set up but how does your code work? there arent any comments throughout the code and i have been looking to use them for a school project. can you help?

2 replies
0
None
otaviousplef11

Reply 2 years ago

send me your code and a pic of your schematic

0
None
lef11otaviousp

Reply 2 years ago

Just figured it out now how can i get the id part out of whats being read? I also noticed that sometimes im reading double of the same part of the code?

0
None
AroojZ

5 years ago on Introduction

Hi I have arduino Mega ADK, Here is a preview of it, http://arduino.cc/en/uploads/Main/ArduinoADK_R3_Front.jpg can you tell me where to connect the TX of RFID in the arduino board? I,m an extreme beginner so if my question is stupid please bear with me. Just tell me the exact pin number on which to attach from the arduino board's picture! Thanks in advance.

3 replies
0
None
F-sidd142AroojZ

Reply 2 years ago

i have the same problem. please tell if someone have sorted out.

0
None
otaviouspF-sidd142

Reply 2 years ago

Send me your code and a pic or schematic of your conection

0
None
F-sidd142

2 years ago

i am able to work with arduino uno but unable to get it working on arduino mega.
i used the code above and connected the rfid pin to arduino mega's digital pin 2.
help...!!

0
None
anagliph

2 years ago

Hello,

Using your code to decode a keychain fob ID tag. The fob has the number "0001383297" inscribed. The code outputs "3100151B81BE".

Boards are hooked up per your directions, using the same RFID receiver card and the Sparkfun UNO board.

Any ideas on how to decode the output that matched the inscription?

I have used a commercial USB RFID reader (it looks like a thumb drive) and it outputs the number inscribed on the fob.

Thanks!

RFID1.jpg
1 reply
0
None
otaviouspanagliph

Reply 2 years ago

Hi,

Ss you can see in the image below the number 000138297 inscribed is in DEC. Cinverting it to HEX give us this 00151B81. Probably the beginning "31" and the final "BE" should be a verification code.

So the reading is OK, the problem is on the conversion from DEC to HEX.

hex to dec.png
0
None
rcbart

2 years ago

Do you know if using this approach you can connect more than one RFID reader to a single arduino?