Interfacing with Parallax RFID Reader/Writer

Hi,

I have a Parallax RFID Reader/Writer hooked up to an Arduino Duemilanove but I am not able to get any response whatsoever from the RFID module. The RFID module gets power coz its green LEDs light up but no response over the serial port.

The connections are as follows:
VCC (RFID) --> 5V (Arduino)
GND (RFID) --> GND (Arduino)
SIN (RFID) --> PIN6 (Arduino)
SOUT (RFID) --> PIN8 (Arduino)

I am using the following code developed as per specs given here:
REMOVE_THIS_FIRST_AND_ADD_3_Ws:parallax.com/Portals/0/Downloads/docs/prod/rf/28440-RFIDReadWrite-v1.0.pdf

//Interface Arduino USB with Parallax 125 Khz UART RFID Reader/Writer
#include <NewSoftSerial.h>

#define rxPin 8
#define txPin 6

//Reader/Writer Commands
#define RFID_READ  0x01
#define RFID_WRITE 0x02

//Memory Locations for Data
#define DATA_ADDR_0  3
#define DATA_ADDR_1  4

//Error Codes
#define ERR_OK  0x01

NewSoftSerial mySerial(rxPin, txPin);

char statusCode;

void setup()
{
  Serial.begin(9600);
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  mySerial.begin(9600);
  Serial.println("RFID Read/Write Test");
}

void loop()
{
    //Read RFID Tag data
    Serial.println("Reading Tag Data...");
    //1st 4 bytes
    mySerial.print("!RW");
    mySerial.print(RFID_READ, HEX);
    mySerial.print(32, DEC);
    while(!mySerial.available()) {}
    
      Serial.print("Read Status:");
      statusCode = mySerial.read();
      if(statusCode == ERR_OK)
      {
        Serial.println("OK");
        Serial.print("RFID Data:");
        Serial.print(mySerial.read(), BYTE);
        Serial.print(mySerial.read(), BYTE);
        Serial.print(mySerial.read(), BYTE);
        Serial.println(mySerial.read(), BYTE);
      }
      else
      {
        Serial.print("NOT OK. Error Code:");
        Serial.println(statusCode, HEX);
      }
}

Any clues/pointers would be really appreciated.
Thanks!

Were you able to figure this out?.. i have the same problem. does your led turn red at some point? from what i read it has to. make sure u have the pin sout from the card to rx in the arduino(or the pin u used for rx in the Newsoft serial.) that way it changed the led to red.. however, i havent been able to read the tag... so if you perhaps have something.. pleaseeeeeeeee. help

I checked the connections - they are correct. SOUT goes to my Rx pin on the Arduino (PIN8) but LED doesn't turn RED at any time before or after I send a read command.

Hope somebody was successful in using this particular module with the Arduino :-[

I have the same problem. I hope some one can help me and you with this problem. The LED doesn´t turn red. I can´t find some information what I did wrong in de code.

Interesting that nobody has managed to solve this issue despite the popularity of the Parallax RFID modules. :frowning:

Yea I hope we can come up with something. I picked one up at radio shack when I noticed they were on sale for 9$ :smiley:

I have this on the monitor

Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF
Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF
Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF
Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF
Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF
Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF
Reading Tag Data...
Read Status:NOT OK. Error Code:FFFFFFFF

Does the reader/writer have a communication rate or 9600 baud, or 2400 like the reader? I just picked up THREE of the readers for $8.47, I have some ideas some RFID projects and couldn't pass up this great deal, hopefully they'll be pretty easy to work with!

This code:

while(!mySerial.available()) {}
    
Serial.print("Read Status:");
statusCode = mySerial.read();
if(statusCode == ERR_OK)
{
  Serial.println("OK");
  Serial.print("RFID Data:");
  Serial.print(mySerial.read(), BYTE);
  Serial.print(mySerial.read(), BYTE);
  Serial.print(mySerial.read(), BYTE);
  Serial.println(mySerial.read(), BYTE);
}

Waits until at least one byte is available to read, then reads five.
Do you know what "read" returns when there is nothing in the receive buffer?
(for a clue, look at reply #6)

If the read times out or your serial port connections to the RFID module is not correct, it returns a 0. The first read waits for a status byte.

I am thinking maybe it is a serial port issue - need to find a logic analyzer to see the signals. If anybody makes some progress, please post here.

Thanks!

any result? I have no ideas what to do ....

Does it make any difference if you do

mySerial.print(RFID_READ, BYTE);

instead of

mySerial.print(RFID_READ, HEX);

I know the datasheet specifies that the RFID Read command be sent in hex and I'm no expert with the arduino or reader so I may just be talking out of my butt here ::slight_smile:

If you've made any progress would you mind sharing?

progress ! the led turned in to red ... thanks ! mySerial.print(RFID_READ, BYTE); its right !

When the module is successfully powered-up and is in an idle state, the LED will be GREEN;
when the module is in an active state (for example, searching for a valid tag or performing an operation
on the tag), the LED will be RED.

Is anybody making progress with this issue. After reading all the responses all I still see in the serial monitor is. What am I missing?

"RFID Read/Write Test
Reading Tag Data..."

0x0F: RFID_ReadLegacy
Read the 40-bit unique serial number from an EM Microelectronics EM4100 read-only tag (used with
Parallax's RFID Card Reader Serial, #28140, and USB, #28340).

Just wanted to say this does indeed work just make sure of the tag type you are using and use the correct read method. The only thing i cant figure out is how the output of the unique id is suppose to be the same as the whats printed on the side of the card or is it ? because for instance i get an output of (look in the byte column)
BYTE HEX CHAR
10 A NewLine
51 33 3
67 43 C
48 30 0
48 30 0
67 43 C
69 45 E
50 32 2
52 34 4
57 39 9
48 30 0
13 D Carrage return
but the serial printed on the side of the fob is 0013509776
Are they not suppose to be the same ?

Nm i just figured out my mistake but ill leave it here for others the output im not sure of what the first 2 lines are doing the 3C but after that is the HEX equivalent of the decimal number printed on the side of the keyfob in my case. The first and last line are the start of the tag and end as represented in documentation. Does anyone know what the first things are representing or is it just something specif set on the tag?

Last edit i swear just wanted to add that the tags are the seed studio ones

Hi Bu11Billy,

could you post your code please ?
i am cracking my head for hours on this now but i can't
get it to read a 125khz card... i am currently using the code that is posted earlier in this topic and the led on the RFID reader turns red for a second or so and then just goes green again.. it seems that it just stops at the

while(!mySerial.available())

is there anything else i need to do other then pass then !RW RFID_READ 32 ?

this is the complete code i am using now :

//Interface Arduino USB with Parallax 125 Khz UART RFID Reader/Writer
#include <NewSoftSerial.h>

#define rxPin 19
#define txPin 18

//Reader/Writer Commands
#define RFID_READ  0x01
#define RFID_WRITE 0x02

//Memory Locations for Data
#define DATA_ADDR_0  3
#define DATA_ADDR_1  4


//Error Codes
#define ERR_OK  0x01

NewSoftSerial mySerial(rxPin, txPin);
char statusCode;

void setup()
{
  Serial.begin(9600);
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  mySerial.begin(9600);
  Serial.println("RFID Read/Write Test");
}

void loop()
{
    Serial.println("Reading Tag Data...");
    //1st 4 bytes
    mySerial.print("!RW");
    mySerial.print(RFID_READ, BYTE);
    mySerial.print(32, DEC);
   
    while(!mySerial.available()) 
    {
       //this is where it halts.. 
   }
    
      Serial.print("Read Status:");
      statusCode = mySerial.read();
      if(statusCode == ERR_OK)
      {
        Serial.println("OK");
        Serial.print("RFID Data:");
        Serial.print(mySerial.read(), BYTE);
        Serial.print(mySerial.read(), BYTE);
        Serial.print(mySerial.read(), BYTE);
        Serial.println(mySerial.read(), BYTE);
      }
      else
      {
        Serial.print("NOT OK. Error Code:");
        Serial.println(statusCode, HEX);
      }
}

thanks in advance for your help ,

Stefkeh

Has anyone managed to interface with this read/writer yet?
I have tried many of things, but I plain and simple cannot get anything.

thanks,

maze