Introduction
The ST25TB family (including SR176, SRI512, SRI2K, and SRI4K) are popular NFC/RFID tags from STMicroelectronics. These tags use the ISO14443-2B protocol and are commonly found in transport cards, ski passes, and access control systems.
In this tutorial, we’ll show you how to read ST25TB cards using the Moetes PN532 NFC Module with Raspberry Pi.
What is ST25TB?
ST25TB is a family of contactless memory chips operating at 13.56 MHz. Key characteristics include:
- Protocol: ISO14443-2B (Type B)
- Memory: Varies by model (176 bits to 4 Kbits)
- UID: 8-byte unique identifier
- Applications: Public transport, ski passes, access control, loyalty cards
| Model | Memory Size | Blocks |
|---|---|---|
| SR176 | 176 bits | 11 |
| SRI512 | 512 bits | 16 |
| SRI2K | 2 Kbits | 64 |
| SRI4K | 4 Kbits | 128 |
Hardware Requirements
- Moetes PN532 NFC Module
- Raspberry Pi (3B+, 4, or 5)
- Jumper wires
- ST25TB card (SR176, SRI512, SRI2K, or SRI4K)
Wiring Diagram
Connect the PN532 module to your Raspberry Pi using UART:
| PN532 Module | Raspberry Pi |
|---|---|
| VCC | 5V (Pin 4) |
| GND | GND (Pin 6) |
| RXD | TXD (GPIO 14, Pin 8) |
| TXD | RXD (GPIO 15, Pin 10) |
Note: Ensure the PN532 module is configured for UART mode. Check the interface selection pins/jumpers on your breakout board. TXD on PN532 connects to RXD on Pi, and vice versa (cross-connection).
Software Setup
Enable UART on Raspberry Pi
sudo raspi-config
# Navigate to: Interface Options -> Serial Port
# - Login shell over serial: No
# - Serial port hardware enabled: Yes
sudo reboot
Install Required Libraries
# install dependencies
sudo apt-get install git autoconf libtool libusb-dev tree
# clone and build libnfc
git clone https://github.com/nfc-tools/libnfc
cd libnfc
# setup PN532 configuration
sudo mkdir -p /etc/nfc/devices.d
sudo cp contrib/libnfc/pn532_uart_on_rpi_3.conf.sample /etc/nfc/devices.d/pn532_uart_on_rpi_3.conf
# build libnfc
autoreconf -vis
./configure --with-drivers=pn532_spi,pn532_i2c,pn532_uart --sysconfdir=/etc --prefix=/usr
make
./examples/nfc-st25tb
