Introduction: Arduino RFID Reader / MFRC522 Turorial

Picture of Arduino RFID Reader / MFRC522 Turorial

This is an simple tutorial for beginner on how to use a MFRC522 module using Arduino

Remarks* I apologize for my english's grammar because i am a chinese :)



Step 1: Collecting Parts and Programs

Picture of Collecting Parts and Programs

In this project, you needed these parts :

1.Aruduino Uno R3 (you can also use the other version of Arduino)

2.MFRC522 module

3.Arduino IDE ( you can download it from here https://www.arduino.cc/en/Main/Software )

4.5V relay (not necessary)

5.TIP31 transistor (not needed if you didn't use the 5V relay)

6.Jumper cables

7.LEDs

Programs :

You will need the RFID library and the programs which you can download from the file that i attached . If you don't know how to add a library , here's the link https://www.arduino.cc/en/Guide/Libraries

Step 2: Connecting the Component

Picture of Connecting the Component

Connect the pins with following :

- MOSI ---> PIN 11

- MISO ---> PIN 12

- SCK ---> PIN 13

- SS/SDA ---> PIN 10

- RST ---> PIN 9

- LED ---> PIN 7 & GND

- Relay / Output power ---> VCC connect to 5V pins and the collector pin of the TIP31

- GND connect to GND pins,

- IN connect to emitter pin of TIP31

- Pin 8 is connected to the base pin of the TIP31

*Ways to connect the led and relay is shown on the image above ( i didn't connect the arduino with the mfrc522 module because i didn't know how to make it , so just follow the text above to connect them)

*Double check before you connect your arduino with your computer , the wrong connection could damage your arduino

Step 3: Setting Up for Your Card

Picture of Setting Up for Your Card

First:

Plug your arduino into your computer and select the correct board and com, then verify and upload your sketch

Second:

Open up serial monitor and set your baud to 9600 baud

Third:

Scan your card , your should saw a bunch of numbers pop out

Last:

Copy only the number and paste it to the column after "int cards[][5] = { (replace the space with ',' as shown in the image above, in my case, my card is 5 117 21 219 190 )

You're Done !

Pls comment if you spot any mistake of my instructables or any question to ask me

Comments

hetlabrotterdam (author)2017-10-30

Your instruction made me think twice about what I had done earlier. Works fine now. Thanks. Got a more complex .ino working soon afterwards.

You're Welcome. Thanks too

mercer493 (author)2017-08-04

What do you mean by "Setting Up Your Card"? I run the code and place the card over the reader and nothing is being output to the monitor. :/

Also, would this program work with RFID tags as well? :)

Sooncheng (author)mercer4932017-12-13

Sry i am not really sure about it

weshan (author)2017-10-12

Hey.. Thank u very much for ur helping. It is very helpful for me

Sooncheng (author)weshan2017-12-13

You're welcome

Robbie1155. (author)2017-07-14

Hey,

I was wondering if some one could post the code to have 10 RFID cads and tags

Ehsan Balouch (author)2017-05-18

Hi,

Please help to provide Arduino card to use more than one RFID cards and tags or at least Master and standard tag provided with the kit.

Thanks.

AbishekK5 (author)2017-05-11

Hi,I was wondering if I could change the pin values for all the pins as I have already used up most of the pins for other sensors? Thanks in advance

Sooncheng (author)AbishekK52017-05-14

For things i know , you can't. I would recommend you to change the sensor's pin. I'll do futher research. Sorry can't help here.

MasterA12 (author)2017-04-17

Is works for HID type cards?

Sooncheng (author)MasterA122017-04-24

not sure about it, sry

Robert 7320 (author)2016-09-19

how can i make this so i can use two or more cards ?

GavinM28 (author)Robert 73202016-10-03

Go to the lines where you want to enter your card numbers, and just include more card numbers:


int cards[][5] = {
{5,117,21,219,190}, //Card 1
{181, 2, 398, 810, 193} //Card 2
...
};

Sooncheng (author)GavinM282017-04-24

thanks!

KaenyI (author)2017-02-11

I saw on the first page that you do not need the relay or the transistor. What is the difference in instructions and outcome if i choose not to use the relay and transistor?

Sooncheng (author)KaenyI2017-03-22

Of course you can choose not to use a relay / transistor. I used it because the power output of the Arduino is too small, so i used a relay/transistor to supply a greater power to the things i want to use. Hope this helps !

mithunbabbira (author)2017-01-09

there is problem in connection between rfid reader and ardunio. ..plz help me i tried with 2 new readers with many other ways ...but still dint figure it out plz help me ..i have to submit my project within few days and i am out of option here

Sooncheng (author)mithunbabbira2017-03-22

I'm Sorry that i couln't help.. i am beginner of Arduino..

gunawan eko (author)2016-10-19

thanks for make this,,,

its very greatful...

Sooncheng (author)gunawan eko2017-03-22

You're Very Welcome !

a1m918 made it! (author)2016-12-11

I made it ^_^

Thanks for a such a nice tutorial !
(Sorry for not posting the images/pictures because I made it to move further so I disassembled it :) )

MuhammadH268 (author)a1m9182016-12-14

(Y)

Sooncheng (author)MuhammadH2682017-03-22

(Y)(Y)(Y)

Sooncheng (author)a1m9182017-03-22

Great ! Good Day !

Boxoffrogs (author)2017-01-16

Excellent, thank you so much!

Sooncheng (author)Boxoffrogs2017-03-22

You're Welcome

OmkarT3 (author)2016-09-07

Pin 9,10 voltage is more than 4v and MFRC522 max working voltage 3.3v so may be it can damage MFRC522 module?

i_sharma (author)OmkarT32017-03-05

You can use logical level shifter . May be this would help you.

Sooncheng (author)OmkarT32016-09-13

you can make a circuit to lower down the voltage

GeraldS48 (author)2016-10-06

Has anyone tried this with the UNO R3 with WiFi. The application would be to read the card ID and send the transaction via Web/Cloud?

JMorton3 (author)2016-06-16

I am just starting to learn RFID - specifically using the MFRC522 and 13.56MHz tags. I have a question - is it possible to read a certain block only? The reason I ask is this - I am trying to make a game involving around 8 pieces, with each having an RFID tag embedded in it. I will be making several duplicates of each piece in case they are stolen or dropped and broken. If I could read a specific block, then I could write the playing piece number to that block in each of the duplicates, and have the Arduino read that specific block to confirm which playing piece has been positioned. Is this possible? This way I would only need to keep a list of 8 piece numbers, not 32 numbers (if I made 3 duplicates of each of the original pieces).

Sooncheng (author)JMorton32016-09-13

hmm.. i am not sure about it , try playing with the code

DrewW14 (author)2016-06-05

How do I use two cards at once?

Sooncheng (author)DrewW142016-09-13

hmm.. i will try it out

curiosity36 (author)2016-06-29

Thank you sir for the most simple RFID example. Works for me.

Sooncheng (author)curiosity362016-09-13

welcome good day !

pkjær (author)2016-06-19

GREAT INSTRUCTABLES!!
Question....

Is it possible to read NFC chips with this RFID reader? I have hooked it all up and it reads some RFID chips fine, but others not, thinking there is a difference between NFC and RFID. So is it possible

Sooncheng (author)pkjær2016-09-13

i am not sure about it , you can try it out

BloodyK1 (author)2016-03-16

I just Registered to instructables just to thank You for the code and library, and add one line if(access){

// Serial.println("Welcome!");

digitalWrite(power, LOW);

delay(500);

digitalWrite(power, HIGH);

access = false; // This line

Becouse if access is granted some times unregistered ID card unlocked the relay so after granting access it disables it to unable unlocking by other cards

Sooncheng (author)BloodyK12016-09-13

ok thanks !

gusm3 (author)2016-03-15

i want to ask ,if i want to read block 4 ,where i must to add listing program
thank's

Alpha 23 (author)2015-11-03

Would you know how to use the mgrc522 module to copy the iOS from a tag and write it to another one all in one code

gtoal (author)Alpha 232015-11-03

I think what you are looking for is an RFID Emulator. Fairly sure these cards are hard-wired and can't be reprogrammed in software. What's your application that you want to reprogram cards for?

benny_boost (author)gtoal2016-02-22

4 months and he is still thinking of a legit excuse.... hows i keep losing my work swipe card and would feel like james bond if i made my own copy :-D

BadrA2 (author)2016-01-10

thaaaaaaaaaaaaaaaaaaaaanx a lot

CarloL4 (author)2015-12-01

Where should i buy this RFID Reader / MFRC522?

ZakariyeA (author)CarloL42016-01-01

ebay and its cost only 4 $

bgsdika (author)2016-01-01

Thx! Simple and easy to modify :)

TheKirkwoods (author)2015-11-05

We'll put together! I'll try this, thank you.

About This Instructable

117,575views

475favorites

License:

More by Sooncheng:Servo Modification for Continuous Turning (Simple)Dog's Computer !L293D motors controller module / tutorial
Add instructable to: