Saturday, May 25, 2013

RFID via USB for the Beaglebone Black or pcDuino Using the Innovations ID-20LA & Sparkfun RFID USB Board

The Innovations ID-20LA is a 125 kHz RFID tag reader that works with input voltages from 2.8 to 5 volts. The Sparkfun RFID USB Reader (Board) provides a socket for the ID-20LA (with its 2mm pin spacing) a mini-USB (B) connector, and broken out pins for a serial connection.

Using the mini-USB connection, it is very easy to connect it to the Beaglebone Black.  The Ångström Linux distribution that comes installed on the Beaglebone Black includes the FTDI-SIO driver/kernel module, so no additional drivers are needed. When connected to the Beaglebone, the RFID reader is mapped to the serial device /dev/ttyUSB0.

For a Python script to read from a serial device, you do need to install the PySerial package (opkg install python-pyserial).

Python Code

import serial
serial = serial.Serial("/dev/ttyUSB0", baudrate=9600)

code = ''

while True:
        data =
        if data == '\r':
                code = ''
                code = code + data


When working with the pcDuino, everything is the same as for the Beaglebone, except for the command to install the PySerial package. On the pcDuino use the command apt-get install python-serial.

1 comment:

  1. Very usefull tutorial. We forward your post to If you have any other new post about pcDuino( or any other LinkSprite's( products, please feel free to let us know. If you have a new post, could you please give us a backlink?