3

I have a project that requires 4 different RFID-RC522 readers. The RFID-RC522 has the following pins:

  • SDA
  • SCK
  • MOSI
  • MISO
  • IRQ
  • GND
  • RST
  • 3.3V

I have read that the SDA pin is used for selecting the active device, So I'm thinking that these devices can share data pins. Is it possible to connect multiple RFID-RC522 readers to the same 3.3V, RST, GND, IRQ, MISO, MOSI and SCK pins if you use a different pin for each SDA? If so, this would save me a lot of pins. So far, I have only seen direction on how to connect one RFID-RC522 to an Arduino.

I'm using the MFRC522 library. It appears to only support one reader because it only allows one SS pin to be identified in the constructor, and offers no way to change it later. An I missing something or do I need another library?

Hoytman
  • 747
  • 5
  • 13
  • 27

1 Answers1

1

Connect everyone to the MOSI / MISO / SCK and ground, then define every SDA all the way around. and set respectively high low depending on where you want to write.

How ever im not sure if you need to set high or low if you want to read. But since you got multiple you can play around with that your self. Feel free to add to this question with the result for future googlers.

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN           7          // Configurable, see typical pin layout above
#define RST_PIN2           8          // Configurable, see typical pin layout above
#define SS_PIN           9          // Configurable, see typical pin layout above
#define SS_PIN2          10          // Configurable, see typical pin layout above

....

MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.
MFRC522 mfrc522_2(SS_PIN2, RST_PIN2);   // Create MFRC522 instance.

....


void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  SPI.begin();        // Init SPI bus
  mfrc522.PCD_Init(); // Init MFRC522 card
  mfrc522_2.PCD_Init(); // Init MFRC522 card
Magic-Mouse
  • 604
  • 7
  • 23