

Lastly, we need compatible handheld barcode scanner.

Since USB Host shield uses pins 11 and 12 to interface to Arduino, I had to move corrsponding LCD signals to pins 6 and 7 the rest of the connections shall be made exactly like in the tutorial. I use standard 16×2 HD44780-compatible LCD display, connected similarly to one in Arduino LiquidCrystal tutorial. First of all, we’ll need Arduino board and USB Host Shield. Let’s talk a little bit about necessary parts. To keep the code simple, I intentionally did not implement any data processing, however, since Arduino sketch for the gadget compiles in just a little over 14K, there is plenty of memory space left for expansion. LCD is erased before outputting each new barcode by tracking time between arrival of two consecutive symbols. Arduino then outputs these symbols on LCD display. The operation is simple – when handheld scanner button is pressed, it scans the barcode and sends it to Arduino symbol by symbol. A gadget that I demonstrate today is portable autonomous barcode scanner built using Arduino board, USB Host shield, handheld USB barcode scanner and LCD display (see title picture). As a result, many modern “not-so-human” input devices behave exactly like a keyboard including boot protocol support. When USB became popular, other keyboard-emulating devices, such as barcode scanners and magnetic card readers have been migrated from PS/2 standard to USB while keeping their keyboard-emulating property. Originally, HID boot protocol was meant to be used with keyboards and mice. In today’s article I will show practical application of HID boot device building a simple gadget.

In real-life applications, it is often not necessary to implement each and every virtual function – only what is needed. However, samples were designed to demonstrate all features of the class and because of that, they are somewhat heavy. The beauty of boot protocol lies in the simplicity of device report – a data packet containing information about button presses and mouse movements. Sample sketches demonstrating sending and receiving data to one of the most useful HID device types – boot keyboard/mouse, has been released along with the library. Scanning barcodes using Arduino and USB Host ShieldĪn addition of Human Input Device Class support to USB Host Shield library 2.0, announced several days ago allows using powerful and inexpensive input devices with USB interface in Arduino projects.
