multiple rfid

Hi to all

I am trying to read multiple rfid readers with an arduino nano but it isnt working in a reliable way (loop verry slow and not always reading cards) annyone sugetions?

here is how i did it arduino uno - Issue sharing MISO with multiple RC522 RFID Readers - Arduino Stack Exchange and this my code

/*******************************************
* function:get the id of RFID key
* RFID   Uno r3
* VCC    3.3V
* RST    2
* GND    GND
* MISO   **
* MOSI   4
* SCK    5
* NSS    6
* IRQ    3
****************************************/

#include"rfid1.h"
RFID1 rfid;//create a variable type of RFID1

uchar serNum[20]; // array to store your ID
int i=0;
void setup()
{
  Serial.begin(9600); //initialize the serial
 
}
void loop()
{
  if(i==1){
    rfid.begin(3, 6, 4, 7, 5, 2);
  }
  if(i==2){
  rfid.begin(3, 6, 4, 8, 5, 2);

  }
  if(i==3){
  rfid.begin(3, 6, 4, 9, 5, 2);

  }
 if(i==4){
  rfid.begin(3, 6, 4, 10, 5, 2);

  }
 if(i==5){
  rfid.begin(3, 6, 4, 11, 5, 2);

  }

  i++;
  if (i==6){i=0;
  }
//  Serial.println(i);
  rfid.init();
  uchar status;
  uchar str[MAX_LEN];
  // Search card, return card types
  status = rfid.request(PICC_REQIDL, str);
  if (status != MI_OK)
  {
    return;
  }
   Show card type
  rfid.showCardType(str);
  //Prevent conflict, return the 4 bytes Serial number of the card
  status = rfid.anticoll(str);
  if (status == MI_OK)
  {
    Serial.print("The card's number is: ");
    //memcpy(serNum, str, 20);
    rfid.showCardID(str);//show the card ID
    Serial.println();
  
    
     uchar* id = serNum;
    if( id[0]==0xC0 && id[1]==0xB7 && id[2]==0xB9 && id[3]==0x79) 
    {
    
     Serial.print(" Hello Dannel! ");
      delay(2000);
    
    } 
  }
  delay(100);
  rfid.halt(); //command the card into sleep mode 
}

Connecting the MFRC522 that way is outside the specs the datasheet tells us (any input pin must not have a voltage of more thatn PVdd + 0.5V. In your case you're at least 1.2V above that specification. That may run with some tolerant chips but other chips may fail and in my opinion they are allowed to fail.

Using a bit-bang SPI emulation is never fast.

What's the reason for connecting 5 RFID readers to one Arduino?

In the loop() if i is 0 you don't communicate with any device.

Hi pylon

thanks for trying to help me out!

is there any way of getting the voltage down as I have already soldered everything together?

i also noticed that the powerup led on the rfid readers somtimes don't stay at same brightness "flickering" ??

Thanks

is there any way of getting the voltage down as I have already soldered everything together?

Not really. Don't you think it would have been better to try first with one reader and make it working before soldering all readers?

i also noticed that the powerup led on the rfid readers somtimes don't stay at same brightness "flickering" ??

Could have many reasons, hard to tell without access to the actual hardware. Have you tried looking at the signal with a scope?