In this video, I'll describe how to use an Arduino (or ESP8266 / ESP32 / other microprocessor) as a USB Host, allowing you to use any USB HID device such as a keyboard, mouse, trackball, joystick, gamepad, barcode scanner, or magstripe reader as an input.
This provides many opportunities for novel input mechanisms beyond the typical switches and pushputtons associated with Arduino projects, and I'll demonstrate one such example - using a barcode scanner as a "decoder" that displays messages encoded in QR codes or barcodes found in an escape room :)
To customise this project for other devices, you need to define the appropriate logic in the report parser function that processes input from the device, based on the USB HID standard published here:
https://usb.org/sites/default/files/hut1_21.pdf
Timings
00:00:00 - 00:00:38 Introduction and Demonstration
00:00:39 - 00:02:10 USB Host Shield
00:02:11 - 00:03:35 Barcode scanner
00:03:36 - 00:08:03 Data and Power Interface
00:08:04 - 00:28:52 Arduino Code
00:28:53 - 00:31:46 Wrapup
To download the resources used in this project (as well as all the other escape room tutorials in this channel), please check out my patreon at https://www.patreon.com/playfultech