pn532 nfc card testing notes

Active today
Viewed 34 times

I have a pi zero v1.3:

PI – pn532

5v to 5v
gnd to gnd
BCM11 to SCK
BCM5 to SS

I think the issue is BCM5 to SS? I believe this should be CE0 or CE1?

I have closed both SEL0 and SEL1. The only other thing is instead of using the DI/O 1-6 corresponding to the “MISO/MOSI/ETC”, I plugged the wire directly into the hole for MISO/MOSI/ETC.

Any help would be awesome!!

Link to the product: https://learn.adafruit.com/adafruit-pn532-rfid-nfc/shield-wiring

Thank You,

  • but which tutorial says “bcm5 to ss”? – tlfong01 2 days ago
  • 1
    I’ll have to find it.Is there another it should connect to? – Denis yesterday
  • You might like to show us a photo of your module, similar to the photos in these NFC questions: (1) stackoverflow.com/questions/60819793/…, (2) raspberrypi.stackexchange.com/questions/109773/…. Cheers. – tlfong01 yesterday
  • I googled the tutorial for your module and found it is for I2C. (3) learn.adafruit.com/adafruit-pn532-rfid-nfc/shield-wiring. Actually your module can do I2C, SPI, and UART. My answer in Ref 1 above is for PN532 in I2C mode, and I successfully followed the libnfc tutorial to setup the mdules OK. I can show it in SPI mode if you prefer to do SPI. BTW, the tutorial in your mdoules is for Arduino, you need to find other NFC tutorials for Rpi, such as libnfc for PN532 or simpleMFRC522 etc. – tlfong01 yesterday
  • In case you really prefer to do SPI, you need to first make sure your SPI setup is correct, by doing the SPI loopback test. See this for more details: “SPI NFC Module Testing Part 3 – Troubleshooting SPI Software and Hardware using LOOPBACK”: raspberrypi.stackexchange.com/questions/109773/…. You may also like to use a python program to read/ping the NFC module’s “Version” register to make sure the NFC module not bad, and more or less working OK. – tlfong01 yesterday
  • I have also listed demo code in my answers above on how to read a SPI “version/ID” or “config” registers. If you can show me a photo of your module, then I can give more details on how to connect MOSI to MISO in a cross-over/loop, and also how to connect the CLK/MOSI/MISO/SS to both Rpi’s buses: SPI 0.0, 0.1, 1.0, 1.1, 1.2 etc. – tlfong01 yesterday
  • Your module and accompanying tutorials seem to be 8 years old and for Arudino only. I guess you need to find more up to date Rpi compatible tutorials such as libnfc or simpleMFRC.References:(4) Adafruit PN532 NFC/RFID Controller Shield for Arduino 2012 [Product sheet] adafruit.com/product/789 (5) Adafruit PN532 NFC/RFID Controller Shield for Arduino 2012 [Tutorial] learn.adafruit.com/adafruit-pn532-rfid-nfc (6) Adafruit PN532 NFC/RFID Controller Shield for Arduino 2012 [Wiring] learn.adafruit.com/adafruit-pn532-rfid-nfc/breakout-wiring – tlfong01 yesterday
  • Having said above, there is indeed update of the above tutorials more Rpi, but using CircuitPython/MicroPython. Byt I think Ccircuit does not run very smoothly in Rpi. But anyway, you can try your luck: (6) Adafruit PN532 NFC/RFID Controller Shield for Arduino 2012 [Rpi/MO Circuit/Micro Python] learn.adafruit.com/adafruit-pn532-rfid-nfc/python-circuitpython. Good luck and cheers. – tlfong01 yesterday
  • 1
    Hey thank you for all of this!! I checked the spi an that was good. Here is what I posted in the forum. I looked it up and matched the arduino connections to the shield and I have rewired up the nfc pn532. I will post a new photo tonight but it is still not workin 😦 forums.adafruit.com/viewtopic.php?f=60&t=164398 – Denis 8 hours ago
  • Your forum discussion is good. If you know your SPI thing is OK, then you can try the libNFC right way. I found that AdaFruit also recommended libNFC way back in 2010! I vaguely remember Lada Ada saying that SPI is not reliable, so she chose I2C. Of course no harm trying it. By the way, I am drafting answer with some pictures, so we can compare and contrast. I only tried libNFC’s I2C mode. So it would be nice if you try it first, and I will follow! 🙂 – tlfong01 7 hours ago
  • One more thing before I forgot: You asked about the pin “D5” referred in the Arduino guide. I guess that refers to Arudono UNO R3’s “D5”, which means “Digital pin number 5”. For Rpi, perhaps you need to read the libNFC guide which Rpi GPIO pins are referring, for the “Reset” and “Interrupt” purposes. – tlfong01 7 hours ago
  • The libNFC test in SPI mode is as easy as I2C. You may find the tutorial by the Wilfrid Laurier Uni good (Ref 6, 7). Cheers. – tlfong01 just now   Edit


Part A – PN532 NFC testing setup

pn532 test

Part B – libnfc 1.1.7 SPI Mode tested OK

libnfc 1.1.7 test ok

/ to continue, …


(1) Problem with detecting badge with PN532 and Rpi – Asked 2020mar23, Viewed 74 times

(2) How can Rpi python read a MFRC522/PN532 NFC/RFID MIFARE smart card/tag? – Asked 2020mar28 Viewed 271 times

(3) PN532 NFC Controller Datasheet Rev 3.6 — 2017nov28 NXP

(4) PN532 UM0701-02 80C51 Firmware User Manual Rev 02 – NXP 2007

(5) PN532 NFC RFID Module – Comoponents101 2018oct06

(6) Raspberry Pi Interface with PN532 NFC Module, with python demo program – Wilfrid Laurier University 2019

(7) Youtube Interfacing Raspberry Pi to PN532 NFC Module – Terry Sturtevant, Wilfrid Laurier University, 10,490 views 2017may04

/ to continue, …


Appendix A – Suggestion to wire AdaFruit’s Arduino compatible PN532 NFC shield to Rpi.

adafruit pn532

Appendix B – PN532 NFC Module I2C/SPI/UART Jumper Setting

i2c/spi/uart jumper setting

Appendix C – PN532 Register Map

pn532 reg map

/ to continue, …

End of answer


Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: