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() {

void loop() {
    if (Serial.available() > 0) {
        int b = Serial.read();
        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?

  • Which RFID reader? Please post a part number or photograph. Please post all your code.
    – Nick Gammon
    Oct 9, 2015 at 3:20
  • @NickGammon It's a cheap-ass RFID reader from China. They usually don't put a manufacturer's name or model number on it. I also have posted all my code, but that doesn't make it more clear.
    – MC Emperor
    Oct 9, 2015 at 9:52
  • Do you not have a phone with a camera in it? Anyway, this might help: RFID reader - HZ-1050
    – Nick Gammon
    Oct 9, 2015 at 10:08
  • Are you 100% sure the fobs' standard matches the reader? Check if the ISO standards are the same.
    – aaa
    Dec 22, 2015 at 23:54
  • @FuaZe Yeah, if I plug the RFID reader into an Access controller, everything's working.
    – MC Emperor
    Dec 23, 2015 at 11:37

2 Answers 2


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?

  • That link looks much like his pic, and says "Output mode: Standard Wiegand26 Format For Access control " so maybe arduino.stackexchange.com/questions/12927/… would help.
    – Dave X
    Dec 23, 2015 at 0: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 github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino so its another option, i guess Dec 23, 2015 at 1:06

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!

Not the answer you're looking for? Browse other questions tagged or ask your own question.