Signal-Routing for “Keyboard-like” RFID / Barcode Readers – and an Arduino-based Alternative
Introduction: Signal-Routing for “Keyboard-like” RFID / Barcode Readers – and an Arduino-based Alternative
“Sophisticated” RFID chip readers or barcode readers are shipped with drivers, libraries, or special apps which provide methods for routing the output of the reader to a specific target. If, for example, the information of the RFID tags or barcodes should simply go to a file, this kind of readers provide ways to define the location and format of that file.
Many “cheaper” readers, however, simply act as a USB keyboard. If they recognize an RFID tag (or barcode) these readers simulate keystrokes that represent the resulting code. Consequently, the code will always be sent to the active window. This is fine for many applications, as long as the desired window is always in the foreground and has the keyboard focus. It does make some trouble, however, if you want to do things in parallel to receiving RFID codes / barcodes.
This tutorial gives an overview on different concepts for capturing and re-routing the keyboard events from these devices.
Supplies
If you have already bought one of these “keyboard-like” RFID readers (or barcode readers), you do not need any additional hardware as this tutorial will highlight different software-based ways how to route their output to an application that does not currently have the keyboard focus.
If, in contrast, you did not yet buy one, you may consider building your own device that does not emulate keyboard events and thus is much easier to handle. For the device proposed here, you need:
* 1x PCB Prototyping Board: 20 x 14 Holes // 40 x 60 mm
* 1x Arduino Nano
* 1x RDM6300 RFID reader with some RFID tags or cards
* 1x 100 Ohm Resistor (0,25 W)
* 2x 220 Ohm Resistor (0,25 W)
* 2x 5mm LEDs (preferably in different colors)
* 2x 5mm LED Holder Clip
* 1x Passive Piezo Buzzer
* 1x 40 Pin Female Header
* Some 0.14…0.25 mm2 cable
* 4x M4x20 Screw / 4x M4 Nut
* 4x M2x10 Screw / 4x M2 Nut
* 3D Printer or Printing Service – or Self-made Case
Please note: The RDM 6300 module is available in different versions. The major optical difference is the color of the antenna: the older versions have a plain copper antenna while the newer (?) ones come with a reddish (painted?) antenna. I have ordered the “new” one and received the “old” one… ☹. According to this source, the major drawback of the “old” one is that it stops sending the tag code after some repeats while the newer one sends the code as long as the tag is above the antenna. 1003
In my experiments with the “old” version, I did not find this behavior – the “old” one was sending the code endlessly, too. In the end, I do not know whether the version correlates with the type/color of the antenna. Maybe just make sure that the PCB shows “V2.0” on the backside. Most pictures on the internet show “V2.0” with both the reddish and the plain copper antenna. Nevertheless, mine has the funny version “V0.3” …which sounds like something that is not a release version. But anyway: this version works properly, too.
Step 1: An Overview
As a small scenario, let’s consider the following: The RFID reader is connected to a PC that hosts an Access database. Every time, someone is presenting his RFID tag to the reader, it should send the corresponding tag number to the database. It is easy to achieve this by creating a corresponding input form. The reader will simulate keystrokes including the enter key, so each time these keystrokes reach the input form, it will create a new dataset. Technically, however, the keystrokes simply always go to the foreground window, so you cannot work on anything else like editing a text document with the “real” keyboard. Activating the window with this text document would route all keyboard events here: that window would receive the events from all keyboards including the RFID/barcode reader now - even if you move that window to another screen as in the example sketch above. 1003