3

I want to connect an RFID reader to an Arduino board. The RFID reader has several wires attached, and the manual mentions them as follows:

  • Red: VCC +12V
  • Black: GND
  • Green: D 0/RX/4R+
  • White: D 1/TX/4R−
  • Blue: LED/CS
  • Yellow: Beep

There is also another black wire attached, but the manual does not mention it. This is an image of it:

Image of RFID reader

I have the red wire connected to the 5V pin and the black wire to the GND pin on Arduino board. Then I have the white wire connected to the RX pin on the Arduino board.

I'm trying to Serial-read the RX port using this code:

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

void loop() {
    if (Serial.available() > 0) {
        int b = Serial.read();
        Serial.print(b);
        Serial.print(" ");
    }
}

When I try to read a keyfob, only this is printed – nineteen times 248:

248 248 248 248 248 248 248 248 248 248 248 248 248 248 248 248 248 248 248

To me it looks like there's something wrong with the connection somewhere.

How can I properly read this RFID reader? If above assumption is not correct, is there something I should know?

MC Emperor
  • 131
  • 7

2 Answers2

1

Have you tried other baud rates? Could you paste a link to the manual or upload the manual itself? From what i could find quickly, the module supports 3 modes: RS232, RS485 and Wiegand 26/34. So the manual should provide some means of selecting a particular mode (perhaps the CS pin?). I suspect you arent actually using the RS232 mode, which is why you are getting strange results. If you can't find a way to select a mode, you could try brute-forcing it and try the WG26 mode next. This code from seeedstudio seems to do the job http://www.seeedstudio.com/depot/datasheet/RFID_630_WG.pde or you could look at the Wiegand protocol on Wikipedia and write your own code, since its relatively straight forward. Also a google image search turned up this link to Aliexpress: http://www.aliexpress.com/item/Waterproof-Security-Door-Access-Control-Wiegand-26-125KHz-RFID-ID-Card-Reader-EM4100-102A/1362129655.html; this is your reader, right?

SoreDakeNoKoto
  • 2,412
  • 2
  • 12
  • 23
  • That link looks much like his pic, and says "Output mode: Standard Wiegand26 Format For Access control " so maybe http://arduino.stackexchange.com/questions/12927/parallel-connection-to-wiegand-26bit-rfid-readers would help. – Dave X Dec 23 '15 at 00:55
  • 1
    Yeah, thats what i thought when i found the Aliexpress page, but his post says it supports 2 other modes according to his manual, so i'm not so sure. However, if there is a default mode, its probably the WG26 mode. From the link you provided, it looks like theres already a library (no surprise) that translates Wiegand https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino so its another option, i guess – SoreDakeNoKoto Dec 23 '15 at 01:06
0

From my personal experience, you should give some init time to the rfid reader to init.

Try to use a digital output to control the chip reset, and give it some milliseconds to init.

I had a similar behavior with a rfid reader and the reason was this I just told.

Good luck!

Quim
  • 41
  • 2