RFID – Wiegand2 – IQRF

RFID-IQRF-SchemaThis post describes simple RFID reader with wireless transmission to the PC. There is used Wiegand26 protocol for communication between TR-52DA and IQRF reader. This construction would be useful for installations on places, where you are not allowed to use additional cabling.

Used hardware:

  • RFID reader 125kHz module (link to Dx.com).
  • IQRF TR module TR-52DA for example.
  • Power supply for RFID reader (12V)
  • Power supply for TR-52DA (3.3-5V)
  • Level translator between 3.3V and 5.0V
  • CK-USB-04(a)

Used software:

  • E02-TR from start-up package for TR module inserted into the CK-USB-04
  • RFID-Wiegand_v1_01.c for transmitter.

Both data lines are driven by 5 volts. So there is necessary to translate levels to 3V3 for TR module. There is enough to use simple resistor divider.

Resistor divider for 5V to 3V3 translation

Resistor divider for 5V to 3V3 translation

Interconnection between RFID reader and TR module

  • RFID reader DATA1 – IQRF TR-52D C8
  • RFID reader DATA0 – IQRF TR-52D C7


Wiegand26 protocol has 26 bits of length. It contains two parity bits (the first and the last), 8bits of Facility code, 16 data bits. MSB parity bit is set, if the first 12 bits has odd number of ones. LSB parity bit is set, if the second 12 bits has even number of ones.

wiegand26 protocol

wiegand26 protocol

Normaly, both lines are pulled-up on 5V. If RFID reader wants to send “1”, DATA1 line is grounded for 50µs and then this line is returned to 5V level. Similarly, if RFID reader wants to send “0”, DATA0 line is grounded for 50µs and then returned to 5V level. Typicaly, there is 2ms between bits

please refer this document (page 5) for more information.

IQRF TR module user code periodically checks data on both data lines. If some data bit will come into TR module, this bit would be saved to the array with name “data” on the first position. Another data bit has to come in 6 ms. If not, data bits are discarded. If all 26 data bits are successfully received, “data” array is transmitter via RF.

Full source code is attached.

Post sent by Tomáš Franc

Download Attachments

1 thought on “RFID – Wiegand2 – IQRF

  1. Pingback: RFID – Wiegand2 – IQRF - Arduino collector blog

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.