A Three-Step Arduino RFID Guide to Building and Coding Your First Project Today
by ElectroScope Archive in Circuits > Arduino
38 Views, 2 Favorites, 0 Comments
A Three-Step Arduino RFID Guide to Building and Coding Your First Project Today

Arduino is a game-changer for DIY electronics. Partner it with RFID, and voila! You unlock the ability to build smart, contactless systems like access control, attendance trackers, and inventory management tools, all from your workspace.
This is a complete Arduino RFID guide, where you’ll learn to connect and configure the RC522 RFID reader with Arduino, and also write code to read RFID tags.
Supplies
Arduino Board (Uno, Nano, Mega, or any compatible board with SPI pins)
Make sure your board has MOSI, MISO, SCK, and SS pins available.
RC522 RFID Reader Module
Operates at 3.3V and uses the MFRC522 chip. Includes antenna and onboard circuitry.
RFID Tags or Cards
MIFARE Classic cards or compatible RFID keyfobs to test reading and writing.
Jumper Wires
Male-to-male or male-to-female dupont wires for connections between Arduino and the RFID module.
Power Source
USB cable for Arduino power, or external 7-12V adapter/battery pack (if not using USB).
Note: Always connect the RC522 VCC pin to Arduino’s 3.3V pin, do not use 5V.
Computer with Arduino IDE Installed
Download the latest Arduino IDE from arduino.cc for coding and uploading.
MFRC522 Arduino Library (to be installed manually as explained in Step 2)
Optional Tools:
Soldering iron (for permanent connections), multimeter (for debugging).
The Configuration

The RC522 RFID module has 8 pins and supports multiple communication protocols like SPI, I2C, and UART. For Arduino projects, SPI is the most commonly used protocol.
Let’s connect the module by following these steps.
1 — Power Connections
Connect the VCC pin (supply voltage between 2.5V to 3.3V) to the Arduino’s 3.3V pin. Then, connect the GND pin to the Arduino’s GND.
2 — SPI communication pins
- Connect SDA (also called SS) to Arduino’s pin 10 (Slave Select).
- Connect SCK (Clock) to pin 13.
- Connect MOSI (Master Out Slave In) to pin 11.
- Connect MISO (Master In Slave Out) to pin 12.
3 — Control pins
- Connect RST (Reset pin) to Arduino’s pin 9.
- The IRQ pin (interrupt signal to indicate RFID tag detection) is optional and can be left unconnected.
Note: Use the 3.3V pin to power the RC522, not 5V. The IRQ pin is optional and can be left unconnected.
Install the Library and Test Sample Code

The MFRC522 Arduino library by Miguel André Balboa is required to work with the RC522 module. This library isn’t available in the Arduino Library Manager, so you’ll need to download and install it manually:
- Download the MFRC522 Library
- Open Arduino IDE
- Go to: Sketch → Include Library → Add .ZIP Library
- Select the downloaded ZIP file to install it
(Alternatively, you can extract the ZIP contents directly into your Arduino libraries folder.)
5. Upload the DumpInfo Example
Once the library is installed, you can test your setup using the built-in example code:
- Go to: File → Examples → MFRC522 → DumpInfo
- Upload the sketch to your Arduino
- Open the Serial Monitor (set baud rate to 115200)
- Scan an RFID tag near the RC522 reader
The serial monitor will display data like Card UID, PICC type, and memory block contents.
You can also directly copy and upload the code below from the DumpInfo example:
If the output shows a data dump, your module is working perfectly.
Writing Data to the RFID Tag

Now that we have dumped the factory data from the tag, let’s see how we can write some data to it. Use the following Arduino code to write and then read back data on the RFID tag.
How does it work?
- The program initializes the SPI bus and RFID reader, sets up a default key (0xFF x6) for authentication.
- The loop() waits for a new RFID card. When detected, it writes two data arrays to block 1 and block 2 of the tag.
- After writing, it reads the same blocks and prints the data to the serial monitor.
- The writeBlock() function checks if the block is writable (not a trailer block), authenticates, and writes data.
- The readBlock() function authenticates and reads data from the specified block.
Once uploaded, open the Serial Monitor at 115200 baud, scan your RFID tag, and watch the data written and read-back data printed on the screen.