It took me a while to figure out this one, hoping someone can help me out.
I have a RDM6300 rfid reader which uses 3 wires. GND - TX - 5volt. Because this unit doesnt have an option enable or disable reading to stop reading rfid tags, most of the code on the internet suggests that you use pin D2 for the 5v and then set the Pin High or low based on if you are ready to read a rfid tag or not. Basically if you complete reading a tag you turn off the rfid reader until you are ready to use it again.
So this works fine when you ware plugged into the 5v usb power. If it is plugged into a 12v power supply (doesn't matter what brand of adapter or how many amps) the unit will run fine for about 2 minutes and then start to reset its self every 30 seconds. If I plug the rfid into the 5v connector it works fine with no reboots, but when I scan a card it will read it and store it into its buffer.
I read that if I put in a transistor between the 5 volt and the pin d2 to the rfid reader that that should fix my problem. Just not sure if anyone else has a different way.
#define PIN_RFID_RX 19
#define PIN_RFID_RESET 2
void checkRFID()
{
if (Serial1.available() > 0)
{
char d = Serial1.read();
switch (d)
{
case 0x02: // Start of transmission
clearSettings();
break;
case 0x03: // End of transmission
// Turn off the RFID module.
digitalWrite(PIN_RFID_RESET, LOW);
readTag();
break;
default: // Add to buffer.
currentLine += d;
}
}
void ReadyforRFID()
{
prevDisplay = now();
digitalClockDisplay();
digitalWrite(PIN_RFID_RESET, LOW);
delay(600);
Serial1.begin(9600);
delay(300);
digitalWrite(PIN_RFID_RESET, HIGH);
LCDScreenupdate(" Scan your "," RFID Tag now! ");
//Serial1.flush();
}