Hi,
With the code below, even with an RFID button resting on the RFID reader, when reading I get “Tag ID: 000000 Scan Time: 0.00”. How can I resolve this?
#include <Wire.h>
#include "SparkFun_Qwiic_Rfid.h"
#define RFID_ADDR 0x13 // Default I2C address
Qwiic_Rfid myRfid(RFID_ADDR);
String tag;
float scanTime;
int serialInput;
void setup()
{
// Begin I-squared-C
Wire.begin();
Serial.begin(115200);
while (!Serial);
if(myRfid.begin())
Serial.println("Ready to scan some tags!");
else
Serial.println("Could not communicate with Qwiic RFID!");
// Want to clear tags sitting on the Qwiic RFID card?
//myRfid.clearTags();
}
void loop()
{
if (Serial.available() > 0){
serialInput = Serial.read();
if (serialInput == 49){ // "1" on your keyboard is 49 in ASCII
tag = myRfid.getTag();
Serial.print("Tag ID: ");
Serial.print(tag);
scanTime = myRfid.getPrecReqTime();
// If this time is too precise try:
// long time = myRfid.getReqTime();
Serial.print(" Scan Time: ");
Serial.println(scanTime);
}
}
}
I’m getting the same issue with that example.
What is your setup? (board, antenna, tags)
Sharing a photo is even better
I’m using an Arduino ESP32 with the Sparkfun Qwiic Reader, RFID Reader ID-3LA and 16mm RFID button.
which RFID Button / tag do you use ?
Is it being run from a battery? If so it might not be enough for the board + read power
Also: how long after button the RFID button onto the reader do you wait to try printing the scanned tags? (press 1 after a few seconds)
The wiring looks correct, you might share a photo of the rfid side’s soldering to see if anything weird is going on there
It’s connected via Qwiic. I have the button placed right next to the scanner so I’m not sure it’s a timing thing. As of now it’s being powered by USB.
Cabling looks OK, as it returns correct from begin(). Looking at the source code of the library, it assumes all works well and seems to miss out basic I2C communication error checks.
Just to be sure download an I2c scanner from internet (e.g. Arduino Playground - I2cScanner) and see whether it detects only that device. (either 0x13, 0x14 or the old 0x7D)
Else I expect one of the components is in error and hard to advice which.
1 Like
This prints using the test sketch:
Scanning…
I2C device found at address 0x13 !
done
I tried using another RFID scanner and got the same result with the example sketch. However, when using the same board and a STT522H Qwiic temperature sensor, that works.
Well the communication is working.Are you able to try another tag/button?
I tried three different buttons and none of them worked.
none of them worked and you have different scanners ? Really ? looks to me something is very weird / wrong.
What do you have and what have you tried ?
With these buttons, I tried two pairs of RFID Qwiic Readers and ID-3LA Readers with an Arduino ESP32. They are connected with a Qwiic Jumper to the SCL/SDA pins and 3.3V/GND on the board, and the board’s powered by USB.
…is the ID-3LA soldered or just sitting in the reader’s PTH holes?
It’s not soldered. How could I go about soldering the ID-3LA pins to a female connector?
Good; well, I was gonna have you remove the antenna and inspect the actual reader board’s female pins for any damage/strange soldering, but I just realized if you’ve tried it with 2 readers it is more likely to be a defective antenna…but having 2 defective is unlikely!
I don’t think I have an antenna. Just the Qwiic Readers and ID-3LA’s. If I’m missing an antenna could you provide the link?
the ID-3LA is the antenna…you can just lift it straight off (but I don’t think there’s much of a point now, as you’ve tried 2)
When testing with USB: show a photo of your setup (I just noticed the battery power from the earlier photo appears to use a 9v, which won’t work…they only output like 300mA max)
Were your setups the same for both readers?