Blog

PN532 NFC RFID Read/Write Module V3 Kit

PN532 NFC RFID Read/Write Module V3 Kit

Advanced Near Field Communication for Arduino and Embedded Systems

Introduction

The PN532 NFC RFID Module V3 is a highly integrated transmission module for 13.56MHz contactless communication. Based on NXP's PN532 chipset, it supports read/write operations with various NFC and RFID tags including Mifare, NTAG, and FeliCa.

PN532 NFC ModuleKey Features

📱 Multi-Protocol Support

Works with NFC, Mifare, ISO/IEC 14443 A/B, FeliCa

📶 Multiple Interfaces

I2C, SPI, and UART communication options

Fast Operation

Supports up to 424kbps data transfer rate

🔧 Easy Integration

Works with 3.3V or 5V systems including Arduino

Technical Specifications

Operating Frequency 13.56MHz
Supported Protocols NFC, Mifare, ISO/IEC 14443 A/B, FeliCa
Communication Range Up to 5cm (depending on antenna)
Interface Options I2C, SPI, HSU (UART)
Operating Voltage 3.3V – 5V DC
Current Consumption ~100mA during operation
Data Transfer Rate Up to 424kbps

Pin Configuration

PN532 Pinout
Pin Label Description Arduino Connection
1 VCC Power (3.3V or 5V) 5V
2 GND Ground GND
3 SDA I2C Data A4
4 SCL I2C Clock A5
5 IRQ Interrupt Request D2
6 RST Reset D3
Note: The module includes jumpers to select between I2C, SPI, and UART interfaces

Wiring with Arduino (I2C)

// Basic I2C Connections:
// VCC → 5V
// GND → GND
// SDA → A4 (SDA)
// SCL → A5 (SCL)
// IRQ → D2 (optional)
// RST → D3 (optional)

// For SPI interface, different connections are required
Important: Ensure correct interface jumpers are set before powering the module

Basic Tag Reading Example

// PN532 NFC Reader Basic Example (using Adafruit_PN532 library)
#include <Wire.h>
#include <Adafruit_PN532.h>

#define PN532_IRQ   (2)
#define PN532_RESET (3)

Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);

void setup() {
  Serial.begin(9600);
  nfc.begin();
  
  uint32_t versiondata = nfc.getFirmwareVersion();
  if (!versiondata) {
    Serial.println("PN532 not found");
    while (1);
  }
  
  Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX);
  Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC);
  Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
  
  nfc.SAMConfig();
  Serial.println("Waiting for NFC tag...");
}

void loop() {
  uint8_t success;
  uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
  uint8_t uidLength;
  
  success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength);
  
  if (success) {
    Serial.println("Found NFC tag!");
    Serial.print("UID Length: "); Serial.print(uidLength, DEC); Serial.println(" bytes");
    Serial.print("UID Value: ");
    for (uint8_t i=0; i < uidLength; i++) {
      Serial.print(" 0x"); Serial.print(uid[i], HEX);
    }
    Serial.println();
    delay(1000);
  }
}

Advanced Features

Tag Emulation

// Configure as NFC tag
nfc.setPassiveActivationRetries(0xFF);
nfc.startPassiveTargetIDDetection(PN532_MIFARE_ISO14443A);

Mifare Classic Auth

// Authenticate with Mifare Classic
uint8_t keya[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
success = nfc.mifareclassic_AuthenticateBlock(
  uid, uidLength, 4, 0, keya);

NDEF Message Writing

// Write NDEF URL to NTAG
uint8_t ndefprefix = NDEF_URIPREFIX_HTTP;
uint8_t url[] = { 'e', 'k', 'o', 's', 't', 'r', 'a', '.', 'c', 'o', 'm' };
success = nfc.ntag2xx_WriteNDEFURI(ndefprefix, url, sizeof(url));

Peer-to-Peer

// Initialize NFC P2P
nfc.InitDepTarget();
// Configure as Initiator/Target
nfc.TgInitAsTarget();

Troubleshooting

Module Not Detected

  • Verify interface jumpers are correctly set
  • Check I2C/SPI address with scanner
  • Ensure proper voltage (3.3V or 5V)

No Tag Detection

  • Move tag closer to antenna (1-5cm)
  • Check tag compatibility (Mifare, NTAG, etc.)
  • Verify antenna connections

Communication Errors

  • Check wiring connections
  • Add pull-up resistors if using I2C
  • Try lower communication speed