Arduino UNO-R3 + Parallax RFID Read/Write Module

I know many people have asked this before, but I still need help.

RFID datasheet:
EM-4100 Card :,ProductName

I have followed the tutorial on The red led on the RFIG lighted up and the serial monitor displayed “RFID Read/Write Test”. However, no matter how I tab the card, nothing happened.

For your convenience, the code is below:

#include <SoftwareSerial.h>
#define txPin 6
#define rxPin 8
#define RFID_LEGACY 0x0F

SoftwareSerial mySerial(rxPin, txPin);
int  val = 0; 
char code[11];     //Note this is 11 for the extra null char?
int bytesread = 0;

void setup()

  pinMode(2, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(txPin, OUTPUT);     //pin 6
  pinMode(rxPin, INPUT);      //pin 8

  Serial.println("RFID Read/Write Test");

void loop()

  //mySerial.print(32, BYTE);

  if(mySerial.available() > 0) {          // if data available from reader 

    if((val = == 10) {   // check for header 
      bytesread = 0; 
      while(bytesread<10) {              // read 10 digit code 
        if( mySerial.available() > 0) { 
          val =; 
          if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading 
            break;                       // stop reading 
          code[bytesread] = val;         // add the digit           
          bytesread++;                   // ready to read next digit  

      if(bytesread == 10) {              // if 10 digit read is complete 
        Serial.print("TAG code is: ");   // possibly a good TAG 
        Serial.println(code);            // print the TAG code 
      bytesread = 0;

      delay(500);                       // wait for a 1/2 second 

NOTE I am using Arduino 1.0.1 software - NewSoftSerial and BYTE cannot work

Please help. Thanks

  pinMode(txPin, OUTPUT);     //pin 6
  pinMode(rxPin, INPUT);      //pin 8

You told SoftwareSerial that these were it’s pins. Why are you now diddling with them?

What, exactly, did you connect between the Arduino and the RFID reader? Show a picture.

A status/error byte and a varying number of
data bytes will be returned depending on the command called.

Why don’t you read this data?

The code was from, I merely followed what was stated there.
Is there something wrong with the code?


A status/error byte and a varying number of
data bytes will be returned depending on the command called.

Where did you get that?

Is there something wrong with the code?

Yes. You should not be diddling with the SoftwareSerial instance’s pins.

You should most likely NOT be sending !RW and the other value every pass through loop.

You should be reading the response from the device, each time you send it an instruction.

Where did you get that?

The RFID datasheet.

Thanks for telling me, but I am at a loss right now, what can I do to get the RFID to work properly? Sorry to trouble you
I got to get to bed now, will be back in around 12 hours. Apologies

what can I do to get the RFID to work properly?

Start with demonstrating that it is connected correctly.

Are you positive that the cards that you have are compatible with the reader?

[u]RFID[/u] |VCC| -> Arduino +5v |SIN| -> Arduino pin 6 |SOUT| -> Arduino pin 8 |GND| -> Arduino GND

I also have a 16x2 LCD monitor connected to the Arduino which I intend to use as a display later

1|VSS| -> Arduino GND 2|VDD| -> Arduino +5v 3|VO | -> Arduino GND pin 4|RS | -> Arduino pin 12 5|RW | -> Arduino GND 6|E | -> Arduino pin 10 7|D0 | -> Arduino - Not Connected 8|D1 | -> Arduino - Not Connected 9|D2 | -> Arduino - Not Connected 10|D3 | -> Arduino - Not Connected 11|D4 | -> Arduino pin 5 12|D5 | -> Arduino pin 4 13|D6 | -> Arduino pin 3 14|D7 | -> Arduino pin 2 15|A | -> Not Connected 16|K | -> Not Connected

EM-4100 Card :,ProductName

According to this, the card is compatible to the RFID, but it can only be read.

I also like to ask: Should the SIN pin act as an Enable for the RFID to read?

Hi PaulS I just did some try outs here and I meraculously succeeded in getting the program to work.

Here's the story: I decided to try out the program back at that reads the newer EM4x50 tags. Again nothing happens when I scan the cards for obvious reasons. So I used the first program again and somehow the whole thing works properly.

Probably the input wires were a little loose or there is a small mistake in the code when I tried to use it earlier. But everythings fine now.

Sorry for all the trouble I caused and thanks for trying to help me out.