The Waveshare NFC HAT with PN532 chip adds contactless read/write capability for access control, attendance, and data exchange.
NFC and RFID Basics
- 13.56 MHz, range ~10 cm
- Reads MIFARE Classic, Ultralight, NTAG tags
- NDEF format for URLs, text, contacts
Specs
- NXP PN532, ISO14443A/B, MIFARE, FeliCa
- I2C/SPI/UART selectable via DIP switches
- Read range up to 7 cm
Setup
- Set DIP switches to I2C mode.
- Enable I2C on Pi.
- Install:
pip3 install adafruit-circuitpython-pn532
Python Code
from adafruit_pn532.i2c import PN532_I2C
import board, busio
i2c = busio.I2C(board.SCL, board.SDA)
pn532 = PN532_I2C(i2c)
pn532.SAM_configuration()
while True:
uid = pn532.read_passive_target(timeout=0.5)
if uid: print(f"Card: {uid.hex()}")
Projects
- Office access control with door lock relay
- Student attendance system with timestamp logging
- Library book checkout
- Digital business card on NFC tag
Security Notes
- MIFARE Classic encryption is broken — use DESFire for real security.
- UIDs can be cloned — add server-side validation.
- Combine NFC + PIN for higher security.
Frequently Asked Questions
What cards work?
MIFARE Classic 1K/4K, Ultralight, NTAG213/215/216.
Read credit cards?
Can detect them but cannot access payment data.
Read range?
3-7 cm with built-in antenna.
Card emulation?
Yes, PN532 supports emulation mode.
Conclusion
The NFC HAT adds contactless identification to Pi projects for access control, attendance, and smart labels.
Browse the full Waveshare collection at Zbotic.in with fast shipping across India.
Add comment