The ID-12 is an easy to use 125kHz RFID receiver. It sends the ID to a serial port of any tag that is close. I got mine from SparkFun for $30. The RFID Reader Breakout and a couple 2mm Sockets make experimenting easier. SparkFun has also various 125kHz EM4001 tags in different sizes and shapes, like a credit card sized, a button, and a glass capsule.
It is good to read the complete ID-12 Datasheet , but here is a summary. At the very least 5 connections are necessary:
|ID-12||ID-12||To Arduino or FTDI|
|7||FS (Format Selector)||GND (ASCII Output)|
|9||D0 (Data 0)||RXI|
The information can be sent in different output formats. The easiest is the ASCII mode, which is enabled by connecting the Format Selector to GND. In ASCII mode the baud rate is 9600 and each transmission is 16 bytes long. Each ID byte is encoded in ASCII hex code, so for example 0x42 is sent out as "42", which is 0x34 0x32.
The transmission starts with the STX (Start of Text) ASCII character 0x02, followed by a 5 byte ID (10 ASCII characters), a 1 byte check sum (2 ASCII characters), CR (Carriage Return) 0x0D, LF (Line Feed) 0x0A, and ETX (End of Text) 0x03:
|STX 0x02h||ID Data (10 ASCII)||ID Check Sum (2 ASCII)||CR 0x0D||LF 0x0A||ETX 0x03|
The 1 byte check sum is the XOR (exclusive or) of the 5 ID bytes. To check if a transmission is valid the program can either XOR the 5 ID bytes and compare it to the 1 check sum byte or it can just XOR the 5 ID bytes and the 1 check sum byte and the result should be 0x00.