Wednesday December 12 2018

HID/USB Keyboard Repeater with Playback

Video Demo:


Quick Links:

Arduino UNO Sketch Code
USB Host Shield Library 2.0
DFU Programmer Source Code
USBSerial Hex File
HIDKeyboard Hex File


To make this, all you need is the following:


First Step:  DFU

I have tested this on Ubuntu 12.04, and do not use any other OS, so I can only give you instructions for such.

Here is the link to the official site on DFU with the UNO (but be warned, if you have R3, it’s out of date).
Link to Arduino DFU Stuff

For those rocking Ubuntu:

First step is getting the DFU programmer code (to be compiled) HERE
(and ALSO get these two hex files: SERIAL and HIDKeyboard).

Unzip the dfu source to:
and put the hex files in

Then follow the readme directions to install DFU and test
(Please note that every time you reset the DFU, you should plug-cycle the UNO board).

*To put the UNO into DFU mode you need only short the two exposed headers closest to the USB slot*

After testing, put the UNO back to normal (i.e. reseted / plug-cycled / and with USBSerial.hex uploaded), this should be the same as a fresh UNO.

Step Two: USB Host Shield:

After buying and assembling (super easy to assemble), all you need are the libraries.  Unzip THIS compressed folder into your …sketchbook/libraries/ folder,  so you end up with libraries/USB_Host_Shield/

Step Three: Program and enjoy

  • With the UNO not in DFU mode and with the serial hex file uploaded to the 16u (so basically from a fresh UNO).
    • Use the regular IDE to program the UNO with the sketch: HERE
  • Put the UNO into DFU mode and use the dfu-programmer to upload the keyboard hex file and reset
  • Plug-cycle
  • Plug in the switches so that REC->LOW@D2, Play->HIGH@D3 (details in the code)
  • Plug in the LEDs (details in the code, and additional pics later in this post).
  • Enjoy:
    • Demo shows how to use, but the code is also very simple.

For reference, here are some pics of my implementation: