Go Down

Topic: Interfacing with Parallax RFID Reader/Writer (Read 13835 times) previous topic - next topic

naashak

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


Code: [Select]
//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!

diegorozo

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

naashak

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 :-[

DJ_VW

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.

naashak

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

toxic t0ast

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$ :D

DIXIS

#6
Sep 25, 2010, 11:33 pm Last Edit: Sep 26, 2010, 12:34 am by DIXIS Reason: 1
I have this on the monitor
Code: [Select]
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

KyleKaplan

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!

AWOL

#8
Sep 26, 2010, 05:44 pm Last Edit: Sep 26, 2010, 05:46 pm by AWOL Reason: 1
This code:
Code: [Select]
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)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

naashak

#9
Oct 09, 2010, 10:51 pm Last Edit: Oct 09, 2010, 10:51 pm by naashak Reason: 1
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!

DIXIS

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

akrutsinger

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  ::)

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

DIXIS

#12
Nov 04, 2010, 10:46 am Last Edit: Nov 04, 2010, 10:47 am by DIXIS Reason: 1
progress ! the led turned in to red ...  thanks ! mySerial.print(RFID_READ, BYTE); its right !

Quote
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.  



Micajah

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..."

phill75

Quote
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).

Go Up