ST25R3916 ESP32 SPI Test Guide

This guide shows how to test the ELECHOUSE ST25R3916 NFC Reader Module with an ESP32 over SPI. It covers library installation, hardware wiring, uploading the example sketch, and verifying that NFC tags and cards can be detected correctly.

What You Need

  • ESP32 development board, for example ESP32-WROOM-32 or ESP32 Dev Module
  • ELECHOUSE ST25R3916 NFC Reader Module
  • USB cable for ESP32 programming
  • Jumper wires
  • Arduino IDE
  • Latest ELECHOUSE ST25R3916 library from GitHub

Install the Library

Use the latest maintained library from GitHub:

https://github.com/wilson-elechouse/ST25R3916

Install both folders into your Arduino libraries directory:

  1. NFC-RFAL
  2. ST25R3916_ELECHOUSE

Use ESP32 Dev Module as the target board in Arduino IDE.

Default SPI Wiring

ESP32 Pin ST25R3916 Pin
GPIO23 MOSI
GPIO19 MISO
GPIO18 SCK
GPIO5 CS
GPIO4 IRQ
5V 5V
GND GND

Optional:

  • GPIO2 -> LED status output

Recommended SPI Examples

  • ESP32_SPI_scan_14443AB_15693 – multi-protocol discovery baseline for 14443A, 14443B, and 15693
  • ESP32_SPI_polling_hotplug – continuous polling with insert and remove reporting
  • ESP32_SPI_card_profile – one-shot card profiling for protocol, subtype, and NDEF visibility
  • ESP32_SPI_mf1_s70_read_write_test – MIFARE Classic S70 read/write verification

Arduino IDE Setup

  • Board: ESP32 Dev Module
  • Upload Speed: 115200
  • Serial Monitor: 115200 baud

Test Procedure

  1. Open one of the SPI example sketches in Arduino IDE.
  2. Click Verify to confirm the sketch compiles.
  3. Click Upload to flash the ESP32.
  4. Open Serial Monitor at 115200 baud.
  5. Present an NFC tag or card to the antenna area.
  6. Confirm card detection data appears in the serial output.

Expected Results

  • The sketch compiles and uploads successfully
  • The ST25R3916 initializes correctly
  • UID, protocol, or card profile information appears in Serial Monitor
  • Repeated card presentation is detected consistently

Detailed Validation Suggestions

  • Card detection: present a MIFARE Classic or NTAG card and confirm UID output
  • No-card idle: leave the reader idle and confirm there is no false trigger spam
  • Repeated reads: present and remove the same card multiple times and confirm consistent detection

Troubleshooting

  • Re-check the wiring for CS, IRQ, MOSI, MISO, and SCK
  • Confirm the correct ESP32 board is selected in Arduino IDE
  • Confirm Serial Monitor is set to 115200
  • Keep the card close to the antenna during initial testing
  • If you see architecture warnings but compilation succeeds, make sure you are using the latest ELECHOUSE GitHub library

Looking for I2C Instead?

If you want to use I2C instead of SPI:

  1. Bridge the module’s on-board I2C solder pad
  2. Connect the module using SDA / SCL / IRQ / VCC / GND
  3. Use the I2C examples in the latest ELECHOUSE GitHub library

Product page: ST25R3916 NFC Reader Module

Shopping Cart