2

I am looking for connecting to ADAFRUIT RFID PN532 readers to one arduino, I think its possible since I2C was for that, but how can i modify the code (Which is already in RFID ADAFRUIT LIBRARY) two access through the both readers at one instance ?

1 Answers1

2

No, you can't connect two Adafruit PN532 shields on the same I2C bus. The problem is that you can't change the peripheral address of the PN532. Thus, both PN532 NFC chips would respond to the same address and you can't control which of the two shields you communicate with.

However, you may be able to separate the two boards

  • by using an I2C multiplexer that switches between the two boards, or
  • by using the SPI option of the PN532 shields. In SPI mode you have an additional chip-select PIN that you could wire to separate PINs of the Adruino. You could then address a specific PN532 shield using those chip-select lines. However, you would need to port the PN532 library to SPI communication.
Michael Roland
  • 39,663
  • 10
  • 99
  • 206
  • If i used I2c myltiplexer they would work in sync ? I want to reduce the number of used arduino boards in the project instead of using one arduino for every PN532, is it possible ? please am not advanced can you explain :) ? – Mohamad Alhaddad Dec 24 '14 at 07:44
  • That depends on what you mean with "in sync"... An I2C multiplexer allows you to switch communication between the two PN532 boards. Thus, you would first communicate with one PN532 (e.g. set up reader mode and let the chip poll fo tags), then tell the multiplexer to switch to the other board, and then communicate with the second PN532 (e.g. do the same set up procedure). Of course you would need to adapt the PN532 interface library accordingly. – Michael Roland Dec 24 '14 at 08:58