Project BackgroundI have purchased many commercial RFID readers over the last few years (mostly from ebay) and virtually all of them utilize the Wiegand interface to output the card data read. Unless you have a card access controller panel the only other way to look at the data output is to use an oscilloscope or logic analyzer. Decoding and formatting all of those bits is very time consuming and boring to say the least. I decided to build a wiegand converter unit that would receive, format and display all of the data that was output. I also wanted it to be portable so I designed it to run off of a 9-volt battery that would be used to power both the converter and the commercial reader. A photo of my completed unit is shown below.
As can be seen in the photo the card being read uses a standard 26-bit format with a facility code of 19. The card number is 31718 (which in most cases is also printed on the card). The other number displayed is the hex value of the wiegand data with both parity bits removed. This is the value that I would enter into my spoofer if I wanted to use it to emulate the card.
Wiegand Interface/ProtocolA Wiegand interface typically uses three wires, a ground wire and two data wires (Data0 and Data1). When no data is being transmitted, both Data0 and Data1 are in a high-voltage state (+5V). When a zero is being transmitted, Data0 is pulsed to a low voltage; when a one is being transmitted, Data1 is pulsed to a low voltage (relative to ground). The figure below depicts the electrical signaling and timing used with a wiegand interface.
The typical pulse width for the “standard” Wiegand format is 50 microseconds with an inter-pulse spacing (“pulse interval”) of 1 millisecond.
The original Wiegand format had one parity bit, 8 bits of facility (or site) code (i.e. starting at the second bit in the sequence, and with a length of 8 bits), 16 bits of ID/user code (i.e. starting at the 10th bit with a length of 16 bits), and a stop/parity bit for a total of 26 bits (see below). The first parity bit (even) is calculated from the first 12 bits of the code and the trailing parity bit (odd) from the last 12 bits. The original 26-bit wiegand format is depicted in the figure below.
Design OverviewThe wiegand converter circuit is fairly simple, consisting primariy of an 8-bit microcontroller (Parallax SX28) and an 2x16 HD44780-compatible LCD. It was constructed on a single sided circuit board (that I etched myself) and installed into a small plastic project case that also housed the LCD and 9V battery. All of the parts used were purchased for less than $20. A schematic of the design is shown below.
Download a PDF version of the schematic here. Schematic