wiegand arduino code

hi all,

i'm working on a project for using the proximity card reader with arduino uno, the signal of card reader is wiegand, actually this my first time to work with wiegand and i need some help.

the application that i work on is to make the uno read multiple cards on the same card reader and detect the serial no. of each card and enable/disable a relay output.

Card A will enable relay A. Card B will enable relay B. ... and so on.

i think the trick of my code is detecting the different card cods and work accordingly, is that possible ??


I have a project which uses wiegand code readers, it is here:-

http://www.thebox.myzen.co.uk/Hardware/Crazy_People.html You can download the code and look at it.

One forum member Jamesmartin took this code and used it to make it a bit more suited to being just a simple Wiegand reader.


first i need to know how uno will read the card code? in what data type will the code be transferred? for example if i have card with no. 45440 11826167-2 how will Data 0 and Data 1 signals will be transferred?

There is a full description of how the wiegand format works in that crazy people project. If you draw out the number in binary then move from left to right every 0 will have a pulse on the zero output and for every one there will be a pulse on the one output of the reader.

Guys, what is the maximum distance of wiegand signal?

I connected 1m wire between the card reader and the uno and I lost the signal!

Sometimes the readers have an open collector output. This means you need a pull up resistor on the inputs. The internal pull up resistors are very weak, so I would put an external pull up resistor on each input using a value of between 1K and 4K7. You should get more than 1 meter.

when i connect the reader direct to the uno, the system works good and when i use 26 bits cards i get this result :
RFID Readers
Read 26 bits. FC = 244, CC = 19843
Read 26 bits. FC = 244, CC = 41201
Read 26 bits. FC = 244, CC = 46029

but when i extend the cable for more than 80-100 cm i get this results :
Read 52 bits. Unable to decode.
Read 52 bits. Unable to decode.
Read 52 bits. Unable to decode.

the bit counter counts 52 bits, why this happened ?
and sometimes i get rubbish bit counts.

So did you put the pull up resistors on like I said?

Yes I added 1k resistance but the same result. Im afraid I connected it wrongly.

Can you post a picture of your setup then showing the wiring. ( no bigger than 1000 pixels wide )

find the image

Those are Pull Down resistors (going to Ground). You want Pull UP resistors (going to +5V).

If you can give the make and model of the card reader we might be able to help more.

I'm using BTS-01H card reader, it is a low quality reader i bought it just to make test on my project, i will be using Siemens HD500 EM in my project but the shipment from Siemens on it is way. im afraid the reader i use is making this problem. could the card reader type affect the wiegand signal ??

Did you change the resistors to pull up ones?

The pull up resistors extended the signal to 5m only, in my project I have 65m I think the problem is with the card reader that I use now because Siemens and honeywell card readers can reach up to 150m using shielded cable.

That is a long way for a TTL signal.

What voltage can that reader stand being pulled up to. The readers I made had an open collector output that pulled up to 12V and a transistor on the recieve end to switch the input. We could get a 1Km range with that.

You do not seem very keen to cooperate with this question, it is like pulling teeth. What are you doing here. I ask for a picture and get a diagram. What value pull up resistors have you tried? At what end of the line are these pull up resistors? What is the width of the pulses being produced by the readers. Have you got a link to the data sheet?