PN5321 MINI Documentation

PN5321 MINI Documentation provides quick start steps, pin mapping, ESP32 wiring examples, troubleshooting notes, and revision details for the ELECHOUSE PN5321 MINI w/ Interference-Resistant Antenna.

Quick Start

  1. Select the interface on the module by solder jumper: I2C, SPI, or HSU (UART).
  2. Power the module from 2.7V to 5.5V. For ESP32 designs, 3.3V power is recommended.
  3. Connect the antenna and keep it away from large metal areas during first tests.
  4. Install the ELECHOUSE PN532 Arduino library or another PN532-compatible library.
  5. Run a basic card-read example to confirm the board is responding.

Technical Summary

  • Controller: NXP PN532
  • Frequency: 13.56 MHz
  • Protocols: ISO/IEC 14443 A/B, ISO 15693, FeliCa
  • Interfaces: I2C, SPI, HSU (UART)
  • Supply voltage: 2.7V to 5.5V
  • I/O logic: 3.3V
  • Board size: 25 × 16.4 × 4.4 mm
  • Antenna options: 10×25 mm or 40×50 mm, ferrite-backed
  • Antenna connectors: MX1.25 and IPEX4

Pinout / Multi-Function Signal Mapping

Silkscreen I2C Mode SPI Mode HSU / UART Mode Notes
GND GND GND GND Ground
5V (or 3V3) 2.7–5.5V 2.7–5.5V 2.7–5.5V Board power input
RST RST RST RST Active-low reset, optional but recommended
SCK SCK SPI clock
MISO MISO SPI MISO
TX/MOSI/SDA SDA MOSI TX Multiplexed signal pin
RX/SS/SCL SCL SS RX Multiplexed signal pin

ESP32 Wiring

I2C (recommended for quick bring-up)

ESP32 PN5321 MINI Notes
3V3 5V/3V3 Prefer 3.3V supply for unified logic
GND GND Common ground
GPIO4 RST Optional active-low reset
GPIO21 TX/MOSI/SDA I2C SDA
GPIO22 RX/SS/SCL I2C SCL

SPI (VSPI default pins)

ESP32 PN5321 MINI Notes
3V3 5V/3V3 Logic is 3.3V
GND GND Common ground
GPIO4 RST Optional reset
GPIO18 SCK SPI clock
GPIO19 MISO Host input
GPIO23 TX/MOSI/SDA MOSI
GPIO5 RX/SS/SCL Chip select

HSU / UART2

ESP32 PN5321 MINI Notes
3V3 5V/3V3 Logic is 3.3V
GND GND Common ground
GPIO4 RST Optional reset
GPIO17 (TX2) RX/SS/SCL Module RX ← ESP32 TX2
GPIO16 (RX2) TX/MOSI/SDA Module TX → ESP32 RX2

HSPI note: if you use ESP32 HSPI (GPIO14 / 12 / 13 / 15), remember that GPIO12 and GPIO15 are strapping pins and can affect boot mode if they are pulled incorrectly during reset.

Supported Platforms

  • ESP32 (I2C, SPI, or UART)
  • Arduino boards with PN532-compatible libraries
  • Raspberry Pi / Linux through SPI or I2C
  • Compact embedded and OEM designs needing a remote ferrite-backed antenna

Initialization Method

  1. Choose the interface by solder jumper.
  2. Wire the module according to the selected mode.
  3. Use the matching PN532 transport wrapper in software.
  4. Call begin(), then check firmware response before testing cards.

Example Code

#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>

PN532_I2C pn532_i2c(Wire);
PN532 nfc(pn532_i2c);

void setup() {
  Serial.begin(115200);
  nfc.begin();

  uint32_t version = nfc.getFirmwareVersion();
  if (!version) {
    Serial.println("PN5321 MINI not found");
    while (1) {}
  }

  nfc.SAMConfig();
  Serial.println("PN5321 MINI ready");
}

void loop() {
}

For first tests, start with a simple read example before moving to NDEF, P2P, or card emulation workflows.

Libraries and Resources

Common Errors

  • No response from board: interface jumper and code wrapper do not match.
  • ESP32 boot issues: HSPI strapping pins are being pulled in the wrong state.
  • Poor read distance: antenna is too close to metal, switching power circuitry, or high-current traces.
  • Unstable communication: supply is noisy, ground is weak, or the reset line is floating.

Troubleshooting

  • The included antenna is already ferrite-backed. In normal installations, no extra ferrite sheet is required.
  • Keep the antenna trace short and the cable routing clean.
  • Separate the antenna from switching regulators, motor drivers, and high-speed data pairs.
  • Start with I2C or VSPI on ESP32 before trying more complex interface combinations.

Version Differences

  • Product A and Product B in the manual share the same NXP PN532 chip and feature set.
  • The PN5321 MINI differs mainly by its compact board form factor and ferrite-backed external antenna arrangement.
  • Certified variants may differ only by antenna size (10×25 mm / 40×50 mm) or connector style (MX1.25 / IPEX4).

Update History

  • v1.1 manual: English edition, added ESP32 wiring tables for I2C, VSPI, UART2, and HSPI; clarified on-board I2C pull-ups and ferrite-backed antenna note.
  • v1.0 manual: Initial draft.
  • 2026-04-05: First public documentation page for PN5321 MINI published on ELECHOUSE docs.

Related Pages

RFID & NFC Module Selection Guide

Not sure which module fits your project? See the full comparison with protocol support, interface options, and use case guidance in our RFID & NFC Module Selection Guide.

Supported Card and Tag Types

Card / Tag Standard Read UID Read/Write Data
Mifare Classic 1K / 4K ISO 14443A ✓ (with auth key)
Mifare Ultralight / C ISO 14443A
NTAG213 / 215 / 216 ISO 14443A / NFC Forum T2T ✓ (NDEF)
Mifare DESFire EV1 / EV2 ISO 14443A ✓ (with crypto)
FeliCa ISO 18092 Read only (limited)
ISO 14443B ISO 14443B Limited

Using the PN5321 MINI Near Metal

The ferrite-backed antenna is the primary reason to choose the PN5321 MINI over a standard PN532 V4. Without ferrite, a standard PCB antenna loses most of its effectiveness when mounted near metal enclosures, heat sinks, or battery packs — the metal eddy currents counteract the antenna field.

The ferrite layer acts as a magnetic shield, keeping the antenna field directed outward toward the tag rather than into the mounting surface. This makes the PN5321 MINI the right choice for:

  • Flush-mounted installations inside metal enclosures
  • Wearable devices with metallic housings
  • Industrial control panels
  • Any application where the PCB sits directly on or near a metal surface

Tip: Even with the ferrite antenna, leave at least 2–3 mm clearance between the antenna and any metal surface for best performance. Zero-clearance mounting will still degrade range.

PN5321 MINI vs PN532 V4 — When to Choose Each

PN5321 MINI PN532 V4
Board size 25 × 16 mm (compact) Larger PCB with full on-board antenna
Near-metal performance ✓ Ferrite-backed — good Poor without ferrite sheet
Supply voltage 2.7–5.5V 3.3–5V
Interfaces I2C / SPI / HSU I2C / SPI / HSU
Software compatibility 100% compatible (same PN532 chip)
Antenna options 10×25 mm or 40×50 mm external On-board PCB antenna
Best for Compact or metal-proximate designs Open-air prototyping and standard use

How the Ferrite-Backed Antenna Works

When a standard PCB antenna is placed near metal, the 13.56 MHz magnetic field induces eddy currents in the metal. These eddy currents generate a counter-magnetic field that:

  • Absorbs power from the antenna, reducing the field strength available for tag communication
  • Decreases the antenna inductance, shifting its resonant frequency away from 13.56 MHz (detuning)
  • Can completely prevent tag detection at close range

The ferrite layer on the PN5321 MINI antenna has two key properties that counteract this:

  • High magnetic permeability (μ'): The ferrite concentrates and guides the magnetic flux outward toward the tag, rather than letting it disperse into the metal
  • High electrical resistivity: The ferrite suppresses eddy current formation between the antenna and the metal surface

The result: the antenna maintains its resonant frequency and field strength even when mounted directly on or near a metal enclosure.

Low Voltage Applications (2.7V)

The PN5321 MINI operates from 2.7V to 5.5V, making it one of the few NFC modules compatible with 3.0V coin cell or LiPo battery systems without a boost converter.

Supply Source Voltage Compatible? Notes
USB (5V) 5.0V Standard operation
3.3V regulator 3.3V Recommended for ESP32 designs
LiPo battery 3.0–4.2V Direct connection, no regulator needed at 3.0V+
2× AA alkaline 2.7–3.0V ✓ (at limit) Works near full charge; may fail as batteries deplete
CR2032 coin cell 3.0V Sufficient for intermittent NFC operation

Important: The I/O logic level is 3.3V regardless of supply voltage. Do not connect 5V logic signals to SDA/SCL/MOSI/MISO without a level shifter when powering at 3.3V.

Antenna Selection Guide

The PN5321 MINI is available with two antenna options, both ferrite-backed:

Small Antenna (10×25 mm) Large Antenna (40×50 mm)
Typical read range 2–4 cm 4–7 cm
Best for Wearables, key fobs, tight spaces Access control panels, desktop readers
Connector MX1.25 or IPEX4 MX1.25 or IPEX4
Metal tolerance Good Good

Longer cable lengths (up to 100 cm) do not significantly affect reading performance when using the 50-ohm coaxial cable supplied with the module.

Practical Installation Tips

  • Clearance from metal: Even with ferrite backing, leave 2–3 mm air gap between the antenna face and any metal surface for best performance.
  • Cable routing: Route the antenna cable away from high-current traces, switching regulators, and motor drivers. EMI from these sources can desensitize the reader.
  • Enclosure mounting: Flush-mount the antenna on the inside of a plastic enclosure face. The ferrite handles the metal bracket behind it.
  • Tag type matters: Mifare Classic cards have a larger internal antenna than small NTAG stickers and generally read at greater distance.
Shopping Cart