This 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.
- 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
- 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.
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.
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