Hi everyone,
I am currently working on a project where I have to read an RFID tag, but the thing is, the Arduino is 8 meters away from the RFID Reader (MFRC522), connected with a high quality cable. I was working with 15cm length before, and everything was working with the MFRC522 library. Then, I extended the cable to 5 meters, and it wasn't working, but when I started using the RFID library, it started working on 5 meters length.
Now, I need to read from the reader on 8 meters length, but it doesn't work right now with the current RFID library. I tried something like changing the frequencies, but I can't make it work.
The previous programmer managed to make it work, so his code works on 8 meters distance from the Arduino, but mine works in maximum 5 meters.
I would be really thankful if someone can help me.
Note: I connected my Arduino on the same hardware from the other programmer, he didn't use any other buffers or whatever, just a normal wiring.
Code:
#include <SPI.h>
#include <RFID.h>
#define SS_PIN 10
#define RST_PIN 9
RFID rfid(SS_PIN, RST_PIN);
String rfidCard;
void setup()
{
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
rfid.init(); // Initiate MFRC522
Serial.println();
}
void loop()
{
if (rfid.isCard()) {
if (rfid.readCardSerial()) {
rfidCard = String(rfid.serNum[0]) + " " + String(rfid.serNum[1]) + " " + String(rfid.serNum[2]) + " " + String(rfid.serNum[3]) + "|";
Serial.println(("UID: " + rfidCard));
delay(3000);
}
rfid.halt();
}
}