Hi all, my plan is to to interface with a TS0870 (HID RFID reader) using an Arduino Uno, from my research I'm thinking this be a fairly simple setup, please see below what I've got mapped out.
Regulated 12v power supply via Barrel Jack
-> VIN to +
-> GND to -
-> D0, D1 to data ports
Arduino USB to PC
-> Publish data to COM Port
PC software
-> Listen to COM port and interpret data
My assumption here is the 12v supply is going to be enough to power both the arduino and the reader (not planning on powering or controlling the LED's).. screenshot below outlines the wiring requirements of the TS0870. I would appreciate some feedback and let me know if there's anything critical I'm missing here.
Thanks! That sounded promising, looked into a RS485 shield from DFRobot but it seems it disables the UART so I won’t be able to communicate to my host PC through the USB? Is that correct?
Do you know if my original solution would work if so
May be wrong as my limited knowledge of the standards. It does have D+ and D- but they’re not USB, the ones I’ve found for sale eBay don’t have anything on the end, they’re just bare wires.
This is a trap. HID means to most people Human Interface Device and is a one of the types of interface that a USB device can handle.
However in the access control field HID is confusingly the name of a specific make of RFID reader. So you need to ignore any reference to USB.
The confusion is further confound in that both USB and several forms of serial protocols have D+ and D- pins. This is called a differential protocol where one signal is the exact opposite of the other.
Which is similar to my reader except it requires 5V whereas my reader is 9-14 VDC. If I power this reader off the VIN with 12V as originally planned is this going to work?
the two important parts are that it is 5v compatible and uses the Wiegand interface.
It probably has a voltage regulator inside so the power is OK. Do not forget to connect the negative lead of this power supply to the ground of the Arduino.
However the Wiegand, though common enough in the RFID world, is not used very often in the Arduino world.
In my project:- http://www.thebox.myzen.co.uk/Hardware/Crazy_People.html
I show the signals of a Wiegand interface. It is an old interface originally designed for magnetic cards, but it is still used in electronic readers widely today.
My project needed three readers so I had to use the "pin change interrupt" mechanism to use all three.
Later I believe some one took this code and made a library out of it. So search for a Wiegand library in the Arduino's IDE add library, or just use my code. Most Wiegand outputs require a pull up resistor, about 10K to 5V (or to 3V3 on lower voltage boards) to make them work. The software will also have to reflect this sort of signal in order to get it to work.
There is no set number of bits in a Wiegand format output, you can have any number you want, however 26 bits is a common one, as is 32 bits. The first n bits usually are fixed as some sort of facility (building code) and the last bit in the word is normally a parity bit to make the number of 1s an even number (for even parity) or an odd number (for odd parity).
In practice you can ignore all this and just take all the digits as being the identifier number, because you are not going to use anybodies else's cards.
I’ll have a read through that, to be clear the reader I’m using is not the same as the one in the article and mine states that it needs 9-14VDC. I meant it was similar in that it has the same wires and uses wiegand protocol.
I believe the format used on the tags is Tecom 27-bit but yes you are correct I’m less concerned about the individual bits in the codes and more the tag as a whole.
I may just have to bite the bullet see what I can get the Arduino to spit out.
Yes absoloutly but it makes not much of a difference. The reader I used is capable of many different types of outputs besides Wiegand 26. It can produce Wiegand 32 and even Wiegand 64. It can be set up to produce four different types of serial output as well as a barcode output, if you know how.
However, the requirement for 9 - 14V is largely irrelevant, it just means that inside your reader there is a voltage regulator that cuts down the voltage to 5V, to allow what ever processor is involved to be powered. It is nothing to get hung up about. Just supply it with the voltage it wants. The outputs need pull up resistors so the signals are all compatible with the voltage you pull up to.
OK I have not come across that one, but it is important to know how many bits are sent for one token otherwise your Wiegand reading software will not work at all.
If the Wiegand reader is producing more bytes than is expected, the reading of one token will be mixed up with the last. If the Wiegand reader is producing less bytes than is expected, the reading of one token will hang until all the expected bytes are in, which in practice means getting them from the next token presentation, again ruining the token value read.
The best way of seeing how many bits are produced is to look at the two output signals on an oscilloscope. Or as you have a potential number of 27 try that many bits, and if that doesn't produce stable results try another number in the software.
Note the number of bits the token is encoded in, mean nothing if the reader will not produce that many bits in the token package.
I had a read of your article which helped too. I think I'm confident enough to take a shot at this and see how it goes.
With regards to pull-up resistors, I had a look and think I understand the requirement for them (they essentially clean up the high/low state to prevent false positives?). Looking into the calculation, if I try running this reader off 5v I think I should be using a 5kΩ resistor?
In this case the output signals are what is known as "open collector" outputs, that means they look like a transistor with a signal going into the base, the emitter connected to ground and the collector going nowhere else but the output. So without a pull up resistor they will not produce any signal at all.
The value is not important, a 5k resistor is not a value you can actually get,the closest is a 5K1 (that is 5.1KΩ resistor). As I said before I would use a 10K resistor. That would give plenty enough current for your needs.