Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use an Arduino Uno, a PN532 NFC reader, an NTAG213 tag and Adafruit’s PN532 library to detect a tag and print its UID. To store a URL or text that a phone can recognize, write a properly formatted NDEF record; printing a UID or dumping raw memory is not the same thing.

What this project does—and what it does not

NFC is a short-range form of contactless identification and communication. This project uses a 13.56 MHz PN532 reader with compatible ISO/IEC 14443 Type A tags, such as NTAG213, NTAG215 and NTAG216. These tags are passive: the reader supplies the energy for a response. Actual read distance varies with antenna size, alignment, tag construction and nearby metal, so expect close placement rather than a guaranteed range. See the NTAG213 specifications and PN532 module information.

  • Detection means the reader sees a nearby tag.
  • UID reading retrieves the tag identifier. An ordinary NTAG213 has a factory-programmed seven-byte UID that normal writing does not change.
  • Memory access reads or writes tag storage. Raw page data is not automatically a readable message.
  • NDEF access handles structured records, such as a URL or text, in a format commonly understood by NFC phones.

A reader marketed as RFID is not necessarily compatible with every NFC tag. In particular, an RC522/MFRC522 setup is a different reader and software path; check protocol and tag-family support before buying.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need

  • An Arduino Uno or compatible board. A Nano or another Arduino may work, but pin assignments vary.
  • A PN532 reader module or shield with documentation for its interface and supply voltage.
  • An NTAG213 for a first test, or an NTAG215/216 if the intended record needs more space.
  • Jumper wires and a breadboard for a breakout board, plus a USB cable and computer running Arduino IDE.
  • Optional: an NFC-capable phone to check that the written NDEF record is recognized.

NTAG213 is a practical starter tag for a short URL or small text. Adafruit specifies 144 bytes of user read/write memory, arranged as 36 four-byte pages, for its NTAG213 product; that is not 144 bytes of URL text. NDEF structures and record headers consume space, and reserved tag areas are not user payload. Adafruit lists more than 10,000 rewrite cycles for its NTAG213 tags. See Adafruit’s NTAG213 product details.

#1 Best Overall
AITRIP 2 PCS PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card Compatible with Arduino Raspberry Pi DIY Smart Phone Android Phone
  • RFID reader/writer supports: Mifare 1k, 4k, Ultralight, and DesFire cards, ISO/IEC 14443-4 cards such as CD97BX, CD light, Desfire, P5CN072 (SMX), Innovision Jewel cards such as IRT5001 card, FeliCa cards such as RCS_860 and RCS_854
  • On-board level shifter, standard 5V TTL for I2C and UART, 3.3V TTL SPI
  • Support NFC RFID reading and writing, P2P communication with peers
  • Support I2C, SPI and HSU (High Speed UART), easy to change among these modes
  • Small Size and easy to embed into your project

Choose NTAG215 or NTAG216 when a project requires more memory, but check the particular tag’s memory map and the capacity supported by the sketch. Do not infer usable message length from a model name alone. Cards, stickers and small clear tags may use the same chip; antenna size and surroundings affect how easy they are to read. Adafruit warns that its micro NTAG213 needs very close placement. Metal-backed objects can perform poorly unless designed with an on-metal antenna.

Wire a PN532 to an Arduino Uno

SPI is a straightforward first connection when the module provides SPI pins and its interface selector is set to SPI. The module documentation takes precedence: PN532 boards differ in labels, voltage handling, headers and switch positions. Do not connect power until you have checked the permitted supply for your exact board.

SPI wiring

PN532 signal Arduino Uno
VCC Module-approved supply; verify the board
GND GND
SCK D13
MISO D12
MOSI D11
SS, CS or NSS D10 in the example below

The Adafruit hardware-SPI constructor takes the chip-select pin: Adafruit_PN532 nfc(PN532_SS);. If you wire chip select to another digital pin, change the code to match. Uno hardware SPI uses D13, D12 and D11. Consult the Adafruit PN532 Arduino guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
SunFounder Reader Module Kit Mifare RC522 Reader Module with S50 White Card and Key Ring Compatible with Arduino Raspberry Pi
  • The RF IC Card module design the circuit of card read by using the original Philips MFRC522 chip
  • Easy to use, with pin header. The module can be directly loaded into the various reader molds.
  • Applicable for the user who need to design or manufacture the RF card terminal.
  • Module Interface: SPI, Data transfer rate: Maximum 10Mbit/s.
  • Power Voltage : 3.3V,Operating frequency: 13.56MHz.

I²C alternative

PN532 signal Arduino Uno
VCC Module-approved supply; verify the board
GND GND
SDA A4
SCL A5
IRQ and RESET Use the pins required by the module and library

For Adafruit’s I²C constructor, the IRQ and reset pins are supplied in code: Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);. Do not copy pin values from a different breakout without checking its documentation. Some boards need an interface switch or jumper changed before use; the ELECHOUSE V4 documentation describes its own selection procedure.

Install the PN532 library

  1. In Arduino IDE 2, open Tools → Manage Libraries…, or select the Library Manager icon.
  2. Search for Adafruit PN532 and install it.
  3. Install Adafruit BusIO if the IDE does not add the dependency automatically.
  4. Open File → Examples → Adafruit PN532 and use examples installed with your version.

The example names and library versions can change, so use the installed examples rather than relying on an old screenshot or a copied sketch for another vendor’s library. Arduino documents library installation in its IDE library instructions; the Adafruit PN532 repository lists the library and its dependencies.

Detect a tag and print its UID

Start with UID reading. This SPI sketch initializes the PN532, checks its firmware response, configures it for tag detection and prints the UID of an ISO14443A tag. It follows the Adafruit library’s API and the flow used in its examples; consult the library’s NTAG2xx read example and Arduino guide.

Rank #3
HiLetgo PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card for Arduino Raspberry Pi DIY Smart Phone Android Phone
  • Support NFC RFID reading and writing, P2P communication with peers
  • Support I2C, SPI and HSU (High Speed UART), easy to change among these modes
  • On-board level shifter, standard 5V TTL for I2C and UART, 3.3V TTL SPI
  • Arduino Raspberry Pi compatible, Small Size and easy to embed into your project
  • RFID reader/writer supports: Mifare 1k, 4k, Ultralight, and DesFire cards, ISO/IEC 14443-4 cards such as CD97BX, CD light, Desfire, P5CN072 (SMX), Innovision Jewel cards such as IRT5001 card, FeliCa cards such as RCS_860 and RCS_854
#include <SPI.h>
#include <Adafruit_PN532.h>

#define PN532_SS 10
Adafruit_PN532 nfc(PN532_SS);

void setup() {
  Serial.begin(115200);
  while (!Serial) {}

  nfc.begin();
  uint32_t versiondata = nfc.getFirmwareVersion();
  if (!versiondata) {
    Serial.println("PN532 not found");
    while (1) {}
  }

  Serial.println("PN532 found");
  nfc.SAMConfig();
}

void loop() {
  uint8_t uid[7];
  uint8_t uidLength;

  bool success = nfc.readPassiveTargetID(
    PN532_MIFARE_ISO14443A, uid, &uidLength
  );

  if (success) {
    Serial.print("UID:");
    for (uint8_t i = 0; i < uidLength; i++) {
      Serial.print(" ");
      if (uid[i] < 0x10) Serial.print("0");
      Serial.print(uid[i], HEX);
    }
    Serial.println();
    delay(1000);
  }
}
  1. In Arduino IDE, select the correct board and serial port, then upload the sketch.
  2. Open Serial Monitor and set its baud rate to 115200.
  3. Present an NTAG213 near the antenna. A typical result is PN532 found followed by UID: and the tag’s own bytes; your UID will differ.

A printed UID confirms neither that an NDEF record exists nor that the sketch can parse one. UID-only identification is also not secure authentication: it is readable and should not be treated as a secret credential.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read raw NTAG pages safely

For a low-level inspection, use the installed Adafruit ntag2xx_read example. It uses ntag2xx_ReadPage() to read four bytes at a time and includes tag-family examples. First run it as a read-only inspection and record what the tag contains; do not begin by writing arbitrary page numbers.

  • Pages are four bytes, but not every page is user data.
  • Tag memory also contains manufacturer and UID-related data, capability information, lock bytes and configuration areas.
  • A page dump is just bytes. Interpreting it as NDEF requires understanding the tag structure and record encoding.
  • Writing over reserved or lock-related areas can damage expected behavior or make changes irreversible.

Keep an untouched reference tag and use a spare blank tag for experiments. The library’s read example is a safer starting point than a hand-written memory loop.

Rank #4
10pcs PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card for Arduino Raspberry Pi DIY Smart Phone Android Phone
  • PN532 NFC NXP RFID Module Support NFC RFID reading and writing, P2P communication with peers
  • Support I2C, SPI and HSU (High Speed UART), easy to change among these modes
  • On-board level shifter, standard 5V TTL for I2C and UART, 3.3V TTL SPI
  • PN532 NFC NXP RFID Module Compatible for Arduino Raspberry Pi compatible, Small Size and easy to embed into your project
  • RFID reader/writer supports: Mifare 1k, 4k, Ultralight, and DesFire cards, ISO/IEC 14443-4 cards such as CD97BX, CD light, Desfire, P5CN072 (SMX), Innovision Jewel cards such as IRT5001 card, FeliCa cards such as RCS_860 and RCS_854

Write a URL or text record

For a phone-readable result, the tag needs a valid NDEF message, not merely characters written into raw memory. The most reproducible beginner route with this hardware is Adafruit’s installed ntag2xx_updatendef example, which waits for supported NTAG tags and attempts to add or update a URI record. Check the example comments and supported tag list in the Adafruit NDEF update example before using it; do not assume support for every NFC tag family or payload size.

  1. Use a blank or expendable compatible NTAG tag, and first read it to verify the reader and tag work.
  2. Open the installed ntag2xx_updatendef example and follow the sketch’s prompts and instructions. Confirm the payload in the example before presenting a tag; its supplied URI may need editing to the intended URL.
  3. Use a short HTTPS URL for an initial test. If you need text or several records, use an NDEF implementation that explicitly supports that record type and tag, with the required dependencies. Don’s Arduino NDEF library provides higher-level message and record handling, but its API and hardware setup are a separate library path; do not combine its constructors with Adafruit examples without checking compatibility.
  4. Remove the tag from the reader after the sketch reports success. Present it to an NFC-capable phone and verify both recognition and the exact content.

Repeat the phone check on Android and iPhone if both platforms matter. Recognition and action depend on the phone, operating system, tag and record format; a phone may show a prompt rather than automatically open a URL. A text string stored as raw bytes is not by itself an NDEF text record.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Locking and security

NTAG2xx tags provide configurable access and lock features, but locking is a separate operation from writing. Read the exact tag’s documentation and the example’s behavior before setting lock bits or access restrictions. A permanent read-only lock may prevent later changes; use a sacrificial tag for lock experiments and leave your working test tag writable until the content is verified.

Best Value
HiLetgo 3pcs RFID Kit - Mifare RC522 RF IC Card Sensor Module + S50 Blank Card + Key Ring for Arduino Raspberry Pi
  • The MF522-AN module design the circuit of card read by using the original Philips MFRC522 chip.
  • Easy to use, low cost, and applicable to equipment development and card reader development etc.
  • Applicable for the user who need to design or manufacture the RF card terminal.
  • The module can be directly loaded into the various reader molds.
  • The module use a voltage of 3.3V, it can connected communication with user's any CPU mainboard through several lines of SPI interface, it can ensure stable and reliable work, and reader distance.

For credentials, access control or authentication, a plain NTAG UID and an unprotected NDEF record are not security controls. They can be read, copied or replaced. Do not use this beginner setup as a secure door lock, payment mechanism or identity system without a real security design.

Troubleshoot by symptom

The serial monitor says “PN532 not found”

  1. Check that the module selector or jumpers are set to the interface used by the sketch.
  2. Confirm VCC and GND, and verify the module’s allowed supply voltage.
  3. For SPI, check SCK, MISO and MOSI connections and ensure chip select matches PN532_SS.
  4. Confirm the right board, port, library and serial-monitor baud rate. Remove duplicate or incompatible PN532 libraries if builds or behavior are ambiguous.
  5. Recheck the exact module pinout and vendor instructions; interface-selection mistakes are common. See the ELECHOUSE interface guide for that model.

The reader is found, but no tag is detected

  • Hold the tag parallel to the antenna and move it slowly over the center.
  • Move metal, batteries, wires or a phone case away from the space between antenna and tag.
  • Try a larger tag or one with the expected 13.56 MHz / ISO14443A compatibility. A 125 kHz RFID tag is not interchangeable.
  • Check that the sketch is using passive ISO14443A detection for the tag family.

The UID reads, but the NDEF data does not

  • The tag may not be NDEF-formatted, or its record may be malformed or unsupported.
  • The sketch may only support selected NTAG models or may not parse NDEF at all.
  • A phone-written record may use a type the Arduino sketch does not handle.
  • The PN532 library and a separate NDEF library may have incompatible hardware setup or APIs.

Basic tag access is not a complete phone or peer-to-peer NFC protocol stack; Adafruit explains this limitation in its PN532 FAQ.

The write reports success, but the phone does not react

  • Verify the record is valid NDEF, not raw text, and test with a short HTTPS URL.
  • Remove and present the tag again; check that the phone supports NFC and is in a state to scan.
  • Try another phone and confirm that the tag was not locked against reading.
  • Use the Arduino reader or a known NDEF-capable app to confirm the record content independently.

Where to take the project next

A PN532 and writable NTAG tag suit URL labels for enclosures, inventory or tool identification, classroom or exhibit information, configuration menus and NFC-triggered automation. Treat the tag as a convenient data carrier, not as proof of identity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the project needs host-and-phone interaction, password controls, permissions or configurable memory areas, a dynamic tag such as the ST25DV64KC is a different, more capable option; its setup is also more involved. SparkFun documents Arduino examples for memory access, access controls and NDEF records in its ST25DV64KC guide. For a basic URL sticker, the PN532 and NTAG213 path is simpler. If all you need is a fixed RFID identifier, a simpler reader may suffice, but confirm it supports the card family you intend to use.

Quick Recap

Bestseller No. 1
AITRIP 2 PCS PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card Compatible with Arduino Raspberry Pi DIY Smart Phone Android Phone
AITRIP 2 PCS PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card Compatible with Arduino Raspberry Pi DIY Smart Phone Android Phone
On-board level shifter, standard 5V TTL for I2C and UART, 3.3V TTL SPI; Support NFC RFID reading and writing, P2P communication with peers
$11.99
Bestseller No. 2
SunFounder Reader Module Kit Mifare RC522 Reader Module with S50 White Card and Key Ring Compatible with Arduino Raspberry Pi
SunFounder Reader Module Kit Mifare RC522 Reader Module with S50 White Card and Key Ring Compatible with Arduino Raspberry Pi
Applicable for the user who need to design or manufacture the RF card terminal.; Module Interface: SPI, Data transfer rate: Maximum 10Mbit/s.
$8.99
Bestseller No. 3
HiLetgo PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card for Arduino Raspberry Pi DIY Smart Phone Android Phone
HiLetgo PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card for Arduino Raspberry Pi DIY Smart Phone Android Phone
Support NFC RFID reading and writing, P2P communication with peers; Support I2C, SPI and HSU (High Speed UART), easy to change among these modes
$8.99
Bestseller No. 4
10pcs PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card for Arduino Raspberry Pi DIY Smart Phone Android Phone
10pcs PN532 NFC NXP RFID Module V3 Kit Near Field Communication Reader Module Kit I2C SPI HSU with S50 White Card Key Card for Arduino Raspberry Pi DIY Smart Phone Android Phone
Support I2C, SPI and HSU (High Speed UART), easy to change among these modes; On-board level shifter, standard 5V TTL for I2C and UART, 3.3V TTL SPI
$32.98
Bestseller No. 5
HiLetgo 3pcs RFID Kit - Mifare RC522 RF IC Card Sensor Module + S50 Blank Card + Key Ring for Arduino Raspberry Pi
HiLetgo 3pcs RFID Kit - Mifare RC522 RF IC Card Sensor Module + S50 Blank Card + Key Ring for Arduino Raspberry Pi
Applicable for the user who need to design or manufacture the RF card terminal.; The module can be directly loaded into the various reader molds.
$9.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.