RFID very confusing


on of my first experiments in the arduino world is with RFID tags. I have no experience with RFID and the result is very confusing

Ich use this reader (UART) and sketch: http://www.seeedstudio.com/wiki/125Khz_RFID_module_-_UART

But my tag (also from seeedstudio) is labeled 0006084515 and the serial output is 01005CD7A52F

How can I translate it to the printed number?

Or has the number printed on the tags nothing to do with the internal number?

What kind of labels do you use? Often the stored ID is not related to any ID printed on the labels. The printed may be some kind of product number while the internal ID should be unique and must be different from tag to tag.

From this test combo:


Maybe the printed number has nothing to do with the internal number.

The device reads 01005CD7A52F. This is then the final number in ASCI?

Are such tag numbers usual ?

According to the linked blog the raw output data is a series of hexidecimal numbers that when converted to decimal are the ASCII character values for the ID label you are expecting.

Then my number is 01005CD7A52F = 1101069264175 ?

According to "bc", yes, this is exactly what's going on:


The printing on the tag is the decimal version of the same serial number.

You should be able to get the card serial number exactly but first you need to know a couple of things. 1) the output format of the reader. Eg. My reader outputs 2 hex bytes of header (so you know the data came from the reader) 1 hex byte command (like this is the csn) 1 hex byte length ( so you know the length of the coming badge number) and a 1 byte for a checksum. So what you find is a bit of other stuff padding around the actual badge number. Which is why when you convert it to decimal without stripping this other stuff off you get the wrong number.

2) also some cards return their CSN in big endian ( most significant byte first) eg. AABBCCDD = AABBCCDD but some use little endian ( least significant byte first) eg. AABBCCDD = DDCCBBAA. If your card is little endian you will have to swap the bytes around before converting it to decimal.