4

I'm working on a project where I need to read the HID RFID cards. Behind the card it shows as HID 0008p and based on the documentation, it looks like it uses a 125 kHz frequency. I tried using different 125 kHz RFID readers, but I was unable to read the card. What reader should I use?

I used RC522, and also another 125 kHz reader with Wiegand output, both without any success.

Card Used : HID Proximity Card 0008p Additional details about the card type : HID DuoProx II 1336

Here is the code i used - This works fine with SWH 5100 reader

But doesn't work with this reader EDK-125 TTL

volatile unsigned long tagID = 0;
volatile unsigned long lastBitArrivalTime;
volatile int bitCount = 0;

#define MAX_BITS 100                 // max number of bits 
#define WEIGAND_WAIT_TIME  3000      // time to wait for another weigand pulse.  

unsigned char databits[MAX_BITS];    // stores all of the data bits

unsigned long facilityCode;        // decoded facility code
unsigned long cardCode;            // decoded card code

 unsigned char i;

void ISRone(void)
{
  lastBitArrivalTime = millis();
  databits[bitCount] = 1;
  bitCount++;
  tagID <<= 1;
  tagID |= 1;
  Serial.println(bitCount);
}

void ISRzero(void)
{
  lastBitArrivalTime = millis();
  databits[bitCount] = 0;
  bitCount++;
  tagID <<= 1;
  Serial.println(bitCount);
}

void setup()
{
  Serial.begin(9600);

  pinMode(2, INPUT);
  digitalWrite(2, HIGH);  // Enable pull-up resistor
  attachInterrupt(0, ISRzero, CHANGE);

  pinMode(3, INPUT);
  digitalWrite(3, HIGH);  // Enable pull-up resistor
  attachInterrupt(1, ISRone,  CHANGE);

  tagID = 0;
  bitCount = 0;
}

void loop()
{
  //  See if it has been more than 1/4 second since the last bit arrived
  if(bitCount > 0 && millis() - lastBitArrivalTime >  250)
  {
    Serial.print(bitCount, DEC);
    Serial.print(" bits: ");

 // 35 bit HID Corporate 1000 format
      // facility code = bits 2 to 14
      for (i=2; i<14; i++)
      {
         facilityCode <<=1;
         facilityCode |= databits[i];
      }

      // card code = bits 15 to 34
      for (i=14; i<34; i++)
      {
         cardCode <<=1;
         cardCode |= databits[i];
      }

 //   Serial.println(tagID);
    Serial.println(cardCode);
 //   Serial.println(facilityCode);

    cardCode = 0;
    facilityCode = 0;
    tagID = 0;
    bitCount = 0;

  }
}
VE7JRO
  • 2,515
  • 19
  • 27
  • 29
Ram S
  • 51
  • 2
  • 7

0 Answers0