Troubleshooting a PN532 NFC module with an RPi Zero

Hi all!
I just grabbed a couple of these:

I’m attempting to set them up with I2C on a pair of Raspberry Pi Zeroes.

I’ve set them up according to this guide:
http://wiki.sunfounder.cc/index.php?title=PN532_NFC_Module_for_Raspberry_Pi

Everything’s fine up until the i2cdetect –y 1 stage.

I’m able to enable I2C on the RPi, I’m able to plug them in resulting in the module’s red LED lighting up, I’m able to do all the various installs and everything okay. But when I go to detect the I2C device, nothing comes up:

pi@machinename:~ $ sudo i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

My first guess would be that it’s wired wrong, but I’m using a commodity ribbon cable and I’ve checked and double checked that it’s in the correct position. Also the LED lights up, so at least the +5v line is probably right.

Any clues or hints as to things that might be wrong?
Thanks

Hi wolfmuffin!

Thanks for the information. I have just tested one of our Little Bird PN532 NFC Modules and it is working fine on my end:

Could you please …

  1. Double check that the switches on the NFC Module have been toggled as such:
    SEL0 : H
    SEL1 : L

  2. Post an image of the wiring on your Raspberry Pi to the NFC Module

  3. Enter sudo nano /boot/config.txt … Is dtparam=i2c_arm=on ?

  4. sudo nano /etc/modules … is there a line at the end: i2c-dev ?

  5. Post your config.txt file here and we can take a closer look : )

Cheers,
Cherie

Hi Cherie,
Great, major thanks! I don’t have any jumper cables handy so I’ll have to track some down. But I’ll revisit this thread when I’ve found some.
Thanks again!

No problem, thanks for the images and information wolfmuffin!

I see the problem now. Notice how there is another row of pins next to the attached ribbon cable? Some of those pins are what it needs to be connected to. Instead of a ribbon cable, could you please use just four separate jumper cables and connect it like how I’ve got here:

If you turn the NFC Module over on the back side it has labels marking what each pin is.

In my example:

Red - 5V
Black - GND
Orange - SDA
Green - SCL

These are then to be connected to the corresponding 5V, GND, SDA, and SCL pins on the Raspberry Pi Zero W.

Let me know how it goes!

Cheers,
Cherie

Not a problem wolfmuffin, happy to help and don’t hesitate to contact us if you have any more questions!

Heya Cherie,
Got it working with your instructions, thanks!
I’m finding the performance is very poor for small devices like smart rings, so I may have to change hardware. This seems to only really work for NFC cards.
Thanks though!

Happy to hear that!

Just a heads up, I have written up a guide on how to set up the PN532 NFC Module. Just in case you or anyone else needs to refer to the wiring and command line steps again, it can be found here: https://www.littlebird.com.au/a/how-to/240/nfc-module-with-raspberry-pi

I’m finding the performance is very poor for small devices like smart rings, so I may have to change hardware. This seems to only really work for NFC cards.

That’s interesting. How are you evaluating the performance?

Thanks for the feedback, I will give it a test with some NFC devices.

Cheers,
Cherie