Arduino,  Tutorials

MFRC522 RFID Read and Write Data in Specific RFID Block

In this tutorial, we will learn how to read and write data to a specific RFID block using MFRC522 and Arduino. If you are storing a person’s first name and surname, then this tutorial is what you are looking for. You can also read the data stored in ID by using the MFRC522 library.

Requirements

MFRC522 RFID Module

MFRC522 Library

Arduino

Jumper Wires

Pin wiring

MFRC522 RFID Module

PinWiring to Arduino Uno
SDADigital 10
SCKDigital 13
MOSIDigital 11
MISODigital 12
IRQunconnected
GNDGND
RSTDigital 9
3.3V3.3V

 

Writing data to RFID Block

Modify the block number and byte buffr[] variable below. In my case, I want to write Devcraze.com (12 Characters) in block 4.

You may want to use ASCII Text to Hex converter. 

Per an RFID block, it must have 16 bytes. So I appended four 0x20 (Space). (Devcraze.com____) and trim it later on.

 

Reading Data from Specific block of RFID Tag

Upload the following Arduino code to read the data stored in block 4.

Open up your serial monitor and put your RFID tag near the MFRC522 RFID Module.

 

 

If you like this tutorial, don’t hesitate to click the social media buttons below 🙂

Spread the love

Leave a Reply

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