miguelbalboa / rfid

Arduino RFID Library for MFRC522
The Unlicense
2.73k stars 1.42k forks source link

Reduce field strengh / power (Metal frame interference) #589

Closed srcastor closed 1 year ago

srcastor commented 1 year ago

I have 3 readers one on top other about 80 MM distance behind a metal frame with holes to "insert" MIFARE Ultralight tags

image

Everything runs very smoothly as long as all 3 reades has a tag on it, however, when only 1 or 2 tag inside, the free readers detect the other tag in a random way, some times nothing, some times fully UID (7 bytes) sometimes UID is shifted or messed.

Every reader works with a own arduino and they arent connected each other so I can't make them to work in a sequential order but I tried to apply some smart delays with no luck , the only way I can think now it's some kind of power reduction.

I already tried to set RXgain to 0, tags need to be closer to the reader in order to be detected so the new rxgain value it's working but has no impact on the duplicate effect, so lets say I have 100 duplicate or false reads / hour with RXgain at max or at min

I am very surprised not getting CRC errors even when UID is so messed up, ex 00 00 00 81 6C XX XX instead of 81 6C 4F C5 D2 F4 F0

void loop() {

   mfrc522.PCD_AntennaOn();    

    if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) { 

      dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size,reader);          
      MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);

      //Serial.println(PICC_Type);

      mfrc522.PICC_HaltA();
      mfrc522.PCD_StopCrypto1();
      mfrc522.PCD_AntennaOff();
    }

}
Rotzbua commented 1 year ago

Create a Faraday cage around every reader to stop the propagation of the rf.