-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Welcome to the RFIDTagReader wiki!
RFIDTagReader is a Python class to be used with one of the 125 KHz ID Tag readers from ID-Innovations like the ID-12LA or ID-20LA, like you can get from sparkFun, or the RDM630.
First, make sure you have the reader connected and configured properly.
The reader uses a serial connection to send data. You can hook it up directly to the serial input pin on the pi, or you can also buy a breakout for the reader that contains a usb-serial converter and plug it into a USB port on the pi. Sparkfun has a nice tutorial on setting up the USB breakout here:
SparkFun RFID Starter Kit Hookup Guide https://learn.sparkfun.com/tutorials/sparkfun-rfid-starter-kit-hookup-guide
If you want to forgo the usb breakout, you can directly connect the serial port input (RXD, GPIO 15) to the reader. There are some gotchas with using the serial port on a pi 3:
Configuring The GPIO Serial Port On Raspbian Jessie Including Pi 3 - Spell Foundry http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/
You will also need to provide power and ground, and manually set the format select and reset bar. (The usb breakout does these things for you.) You will want to look at the data sheet : https://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf
There are 11 pins on the bottom of the reader.
GND - connect to ground on the Pi RES - connect to power from the pi (when set low, this pin resets the reader) antenna - only used for ID3, others have built in antenna antenna- only used for ID3, others have built in antenna CP - not connected for reading tags, only for magnetic stripe data Tag in Range - output that goes high when a tag is in range, else is held low. Optionally connect to a GPIO pin on the pi format select input -connect to ground to select tag reading mode D1 - serial data output, in inverted format - don’t connect D0 - serial data output, connect to RXD on the pi. Putting a 1K or 2K resistor is recommended READ - outputs a train of pulses when tag is read, optional connect to piezo buzzer or LED power - connect to either 3.3 V or 5V power pin from pi. With 5V, data returning to the pi are near 5V, and the pi is a 3.3 V device, so safer to power with 3.3V. The reading range, especially for the larger antenna of the ID-20LA, may be slightly better with 5V, though. With either the USB breakout or the direct connection, you will be reading serial data. The data output is ASCII - 9600 Baud, No Parity, 1 stop bit. Each time a tag is read, the following data is output, STX (02), DATA (10 ASCII) , CHECK SUM (2 ASCII), Carriage return, line feed, ETX (03). You need to parse the junk and leave just the data, which will be the tag ID in hexadecimal format.
When a tag enters the range of the reader, the tag value is sent to the serial port, and the Tag In Range pin goes high. No new data is sent to the serial port until the tag leaves the reading range (whereupon the Tag In Range pin goes low), and a tag reenters reading range. If you want to know when a tag leaves, you need to plug the Tag In Range pin into a GPIO pin on the pi and monitor for when it goes low.