HELP: RDM630 RFID 125 kHz Reader + Arduino Mega

Hi everyone! Newbie here.
I have a problem in reading my RFID Tags. I just followed what is instructed in this website, RFID(RDM630) and Arduino | Physical Computing 2010
unfortunately, it wont work for me.

My materials are:

  • RDM 630 RFID 125 kHz Reader
  • Arduino Mega
  • EM4100 RFID Tags

This is the code on the website: ( but I edited the tags numbers)

#include <SoftwareSerial.h>
#include <avr/pgmspace.h>
//----
// Tags are stored in program flash memory
// 32k minus sketch size determines the amount of tags that can be stored
// Tags include the two CRC bytes (14 bytes total)
prog_char tag_0[] PROGMEM = "0002900109"; //add your tags here
prog_char tag_1[] PROGMEM = "0002900110";
prog_char tag_2[] PROGMEM = "0002900111";
prog_char tag_3[] PROGMEM = "0002900112";
prog_char tag_4[] PROGMEM = "0002900113";
prog_char tag_5[] PROGMEM = "0002900114";
prog_char tag_6[] PROGMEM = "0002900115";

PROGMEM const char *tag_table[] =
{   
  tag_0,
  tag_1,
  tag_2,
  tag_3,
  tag_4,
  tag_5,
  tag_6 };
//----

SoftwareSerial rfidReader(2,3); // Digital pins 2 and 3 connect to pins 1 and 2 of the RMD6300
String tagString;
char tagNumber[14];
boolean receivedTag;
int lockPIN=7; // pin 7 is controls the door

void setup() {
  
  pinMode(lockPIN,OUTPUT);
  Serial.begin(9600);
  rfidReader.begin(9600); // the RDM6300 runs at 9600bps
  Serial.println("\n\n\nRFID Reader...ready!");
 
}

void loop()
{
  receivedTag=false;
  while (rfidReader.available()){
    int BytesRead = rfidReader.readBytesUntil(3, tagNumber, 15);//EOT (3) is the last character in tag 
    receivedTag=true;
  }  
 
  if (receivedTag){
    tagString=tagNumber;
    Serial.println();
    Serial.print("Tag Number: ");
    Serial.println(tagString);
    
    if (checkTag(tagString)){
      Serial.print("Tag Authorized...");
      openDoor();
    }
    else{
      Serial.print("Unauthorized Tag: ");
      Serial.println(tagString);
      delay(1500); // a delay of 1500ms and a flush() seems to stop tag repeats
      rfidReader.flush();
    }
    memset(tagNumber,0,sizeof(tagNumber)); //erase tagNumber
  }
    
}

// ----
// checkTag function (give it the tag string complete with SOT and EOT)
// compares with tags in tag_table
// and returns true if the tag is in the list

 boolean checkTag(String tag){
   char testTag[14];
   
   for (int i = 0; i < sizeof(tag_table)/2; i++)
  {
    strcpy_P(testTag, (char*)pgm_read_word(&(tag_table[i])));
    if(tag.substring(1,13)==testTag){//substring function removes SOT and EOT
      return true;
      break;
    }
  }
   return false;
 }
 //----
 
 void openDoor(){
  Serial.print("Opening door...");
  digitalWrite(lockPIN,HIGH);
  delay(1000);
  Serial.println("Re-locking door");
  digitalWrite(lockPIN,LOW);
  delay(1500);// a delay of 1500ms and a flush() seems to stop tag repeats
  rfidReader.flush();
}

Nothing happened when I swiped the tag, and the led wont blink too :slightly_frowning_face:

What a pleasant change! A good question! Someone starting with good code, presumably with a view to tweaking later.

I said "good code": It seems that it SHOULD tell you it saw a tag, even if there's some problem with the tag id. So that's not it.

Where did you buy your reader? Did you buy tags same source? Sure they are "the right" tags for that reader?

What wires go from your reader to your Mega? You did connect the grounds, didn't you?

Put a button on an unused pin. With a pull up resistor. Add code to loop() to turn on the LED when you press the button. When that's working, look closely at your code's provision for winking LED if reader sees tag. Maybe it IS seeing a tag... but not telling you.

Tear it all to bits. (Sorry). Write a little program to send "I see it" from the Mega to the serial monitor when you press the button. Be sure you're okay with THAT part.

Be sure that either everything is 5v, or 3v3, or that you've taken any necessary interfacing steps.

But stick with it! I love my RFID front door lock. Have used it at two locations for years now. No fighting with keys for me. (Consider electromechanical strikeplate....

... if you go that route. And your home's security.)

tkbyd:
What a pleasant change! A good question! Someone starting with good code, presumably with a view to tweaking later.

I said "good code": It seems that it SHOULD tell you it saw a tag, even if there's some problem with the tag id. So that's not it.

Where did you buy your reader? Did you buy tags same source? Sure they are "the right" tags for that reader?

What wires go from your reader to your Mega? You did connect the grounds, didn't you?

Put a button on an unused pin. With a pull up resistor. Add code to loop() to turn on the LED when you press the button. When that's working, look closely at your code's provision for winking LED if reader sees tag. Maybe it IS seeing a tag... but not telling you.

Tear it all to bits. (Sorry). Write a little program to send "I see it" from the Mega to the serial monitor when you press the button. Be sure you're okay with THAT part.

Be sure that either everything is 5v, or 3v3, or that you've taken any necessary interfacing steps.

But stick with it! I love my RFID front door lock. Have used it at two locations for years now. No fighting with keys for me. (Consider electromechanical strikeplate....

Electromechanical strike plates (electronic access control)- ec1ems

... if you go that route. And your home's security.)

Yes, the tags and reader come from the same source.. I also googled that rdm 630 reads em4100 tags. I searched for the specifications. And I have done the connections just like on the figure on the website.. Especially, the GND and SOURCE, the TX to pin 2 Arduino and all. I just cant figure it out.