6

I recently bought this NFC/RFID reader PN532 module V3

I want to use it with my raspberry pi 3. I have install and configured the library libnfc. The PN532 is connected with I2C. I have well enabled it on my RPi.

My problem is that I cannot scan anything. Indeed, when I run the function nfc-poll in the console, I get this :

nfc-poll uses libnfc 1.7.1
NFC reader: pn532_i2c:/dev/i2c-1 opened
NFC device will poll during 30000 ms (20 pollings of 300 ms for 5 modulations)
nfc_initiator_poll_target: Success

During the poll, I passed near the PN532 a lot of different tags, even those that arrived with it. But there is never any detection. Nevertheless, the RPi seems to communicate correctly with the PN532, as is shown in the second line.


The command i2cdetect -y 1 is well returning :

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

The PN532 is wired as follow :

  • (PN532 --> RPi3)
  • GND --> pin 6
  • VCC --> pin 4
  • SDA --> pin 3
  • SCL --> pin 5

I have checked the wiring (i have well the yellow led ON, and if I remove the SDA or the SCL connection, I get an error message trying nfc-poll which indicates that the connections are OK)


I have checked the position of the two switchs on the PN532 to enabled I2C communication.


My libnfc configuration file (/etc/nfc/libnfc.conf) is the following :

# Allow device auto-detection (default: true)
# Note: if this auto-detection is disabled, user has to set manually a device
# configuration using file or environment variable
allow_autoscan = true

# Allow intrusive auto-detection (dehttp://www.jamesrobertson.eu/pages/2014/mar/30/rfid-module.htmlfault: false)
# Warning: intrusive auto-detection can seriously disturb other devices
# This option is not recommended, user should prefer to add manually his device.
allow_intrusive_scan = false

# Set log level (default: error)
# Valid log levels are (in order of verbosity): 0 (none), 1 (error), 2 (info), 3 (debug)
# Note: if you compiled with --enable-debug option, the default log level is "debug"
log_level = 1

# Manually set default device (no default)
# To set a default device, you must set both name and connstring for your device
# Note: if autoscan is enabled, default device will be the first device available in device list.
device.name = "Itead_PN532_I2C"
device.connstring = "pn532_i2c:/dev/i2c-1"

I have tried to set the parameter allow_intrusive_scan to true, but it do not change anything.


I have exactly the same problem when using the PN532 wired in SPI mode.


Do you have any idea ? Thank you very much in advance.

4
  • 2
    May I point out you are using pins 2, 3, 4, 6 NOT GPIO 2, 3, 4, 6. They are very different things and the cause of much confusion and many mistakes on the Pi.
    – joan
    Mar 1, 2017 at 8:56
  • Yes you are right. I will correct my post. But i think the wiring is still ok
    – qcha
    Mar 2, 2017 at 15:02
  • no one has an idea ?
    – qcha
    Mar 8, 2017 at 21:48
  • I tried to switch in a SPI mode but the problem remains exactly the same.
    – qcha
    Mar 8, 2017 at 22:49

2 Answers 2

2

I had exactly the same problem problem: communication with host is OK, but tags are not detected. I believe that this is a fake Elechouse module, and it can't work because of terribly designed RF part.

To fix it, I replaced all the components near the antenna as follows: L0 = 680nH; C0 = 180pF; C1 = 22pF; C2 = 168pF (100 pF and 68 pF in parallel); R2 = 3.9 K; Rq = 1.5 Ohm Refer the circuit diagram on Fig. 51 (p. 212) of the datasheet.

There are no places on the PCB for Rq, so I had to cut traces, but probably it will work without Rq as well.

After this modification the module detects tags at 4-6 cm distance.

-3

Use SPI to comunication its works

1
  • 3
    Welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. Whilst this may theoretically answer the question, it would be highly preferable to include some explanation here to turn this into a more helpful answer.
    – Ghanima
    Jun 6, 2017 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.