RC522 Write a Card Demo Code

Posted by: Chao Category: Uncategorized Tags: , , , Comments: 11

RC522 Write a Card Demo Code

It is very easy and common to read the RFID card ID, which is the first 4 bytes of the data area, and used to identify the card holder. But also a lot of people ask if the RC522 can write a RFID card or not, the answer is yes, now we have a demo here. It tells how to write data after the first address block 0 from block 1, to store your data there.

You can buy this item here, and some extra cards here.

Data structure:

Please read more data structure info about the RC522 card, there are 0-63 blocks, each 4 blocks (0,1,2,3) in a line of a sector, the key data are stored in the block 3 (called trailer), see the data structure here below:

I am using a ACR122U-A9 card reader to read and write data with the software tool called NFCGUIFreeVer.exe here.

Please note:

It is very risky to overwrite the card ID or key, will permanent lock card, so be careful unless you really know how to do it.

Demo Code available for downloading after purchase.

Edit the block address from 1~63 to store data inside, we have set it to 1 default, which will write data just after the card ID (first block 0). and finally I use the tool to see how the data update inside:

Share this post

Comments (11)

  • kaue mello Reply

    Hi, the link for download is unavailable, do you have another link for arduino example? Thanks.

    August 20, 2015 at 1:43 am
    • Chao Reply

      Yes, please try again, it supposes to be fixed now. Br,

      August 20, 2015 at 3:15 am
      • kauemello Reply

        It worked, thanks,I am trying to use a rc522 for a few days, it will help me a lot, really thanks

        August 20, 2015 at 12:38 pm
      • sergi Reply

        where and how can I download sir? I didn’t see any link. Thanks

        January 12, 2016 at 9:34 am
      • ben nasr Reply

        plz link

        November 3, 2016 at 7:59 pm
  • Converting byte to bool on c# « news-Knowlage FeeD Reply

    […] trying make a library to iot core on c# based on arduino library (http://blog.electrodragon.com/rc522-write-a-card-demo-code/) but i don’t understand what […]

    October 28, 2015 at 11:38 am
  • poulbran Reply

    Used this in a project at school, most of the guys though nothing of it.
    I think RFID is fricking cool!

    September 12, 2016 at 7:55 am
  • maos Reply

    Hello, where how can I download sir?

    December 6, 2016 at 5:19 am
  • Okba Reply

    thank you

    April 5, 2017 at 9:25 pm
  • serkan tapan Reply

    code example thank

    September 1, 2017 at 10:05 pm
  • Chao Reply

    Hi, arduino code only for purchase customer only, please login into wiki page and find it:

    September 3, 2017 at 12:43 pm

Leave a 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.