Hello everyone,
I'm trying to build a project using multiple RFID reader.
I need to read 7 different chips simultaneously to detect different patern that I would then send to a raspberry pie to display the correct result on a screen.
I've tried setting up a proof of concept with only 4 reader, but I'm running into some diffculty.
I'm using some RC522 reader with this library: GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522
My problem is the following: Tested individually, each reader works fine. Once plugged in all at once nothing works.
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
delay(4); // Optional delay. Some board do need more time after init to be ready, see Readme
mfrc522.PCD_DumpVersionToSerial(); // Show details of PCD - MFRC522 Card Reader details
Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}
Scan PICC to see UID, SAK, type, and data blocks...
Firmware Version: 0xF9 = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...
Firmware Version: 0xC0 = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...
Firmware Version: 0xF0 = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...
Firmware Version: 0x38 = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...
Firmware Version: 0x78 = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...
As you can see from the output, everytime I reset the arduino I'm getting a different firmware version. From what I could gather on the internet, this is due to electromagnetic interference being present in the SPI bus and corrupting the data. I was concidering swapping for a shielded cable or just wraping foil around my cables. I have about 50 cm of extra cable that isn't needed on the SPI bus and CS line. I could cut it shorter. Would that help?
I've also read that lowering the SPI frequency could help.
Maybe there is a more appropriate communication for my particular case?
I tought that SPI would be better then I2C ![]()
Also, I'm using a TXS0108E from sparkfun as a level shifter betwen my nano and the RC522s. I don't know if maybe the data corruption could come from there...
Anyway, if anybody has any helpful comment or suggestion, I'll gladly take them.
I've been working on this for weeks now and I can't get it to work.