What is the cheapest way to interface a USB 2.0 keyboard to an Arduino Uno?

The keyboard does not support PS/2 emulation (interfacing a PS/2 keyboard to Arduino is easy). So this means the Arduino will read the USB keyboard's keystrokes - whatever their speed of input is.

If it can be solved using an IC then DIP is preferred as it quicker to work with for soldering and pluggin into breadboard.

  • Have you considered USB/UART bridges, like FTDI ones? I might be wrong but lots of them are used in UART communication and other stuff – Artūras Jonkus Oct 29 '16 at 17:33
  • Don't it's a bad idea. Or if you must, use a teensy LC in place of the Uno. – Chris Stratton Oct 29 '16 at 17:36
  • @ChrisStratton I know it possible to do becuase thheres a one chip solution-its here hobbytronics.co.uk/usb-host-board-v2 – Dat Han Bag Oct 30 '16 at 0:09
  • but I cant figure out the circuit from that photo-maybe iots based around a max 3421e? teensy LC at its cheapest is a cost of a few arduino Unos-so I dont think its that cheap. – Dat Han Bag Oct 30 '16 at 0:09
  • 1
    What to figure out? The description text says: "The USB Host Board is based around the Microchip 24FJ64GB002 microcontroller which contains a built-in full-speed USB host controller". – Ale..chenski Oct 30 '16 at 0:21

The cheapest way is to get a plain PS/2 (or PS/2-USB convertible) keyboard instead of USB1.1 (I hope you mean the standard LS keyboard, since USB2.0 HS keyboards hardly exist), and interface it to GPIOs in accord with known solutions.

The Arduino Uno is designed around Atmega8u2 and ATmega328P chips, which can act as USB device only, FS and LS. To interface it with a dedicated USB keyboard (which is a USB device), the you need to have the Arduino as a USB host. Probably it is possible to emulate some limited hardware host functionality for LS mode (1.5Mbps) over GPIOs, but it will be a remarkable effort.

| improve this answer | |
  • For the senario I am interested in I cant switch over to PS/2 unfortunately-as I mentioned in question if it was PS/2 it would be easy to do. I have a guess it can be done with using a single chip that acts as USB host in conjunction with arduino uno. – Dat Han Bag Oct 30 '16 at 0:04
  • You asked for a cheap way. Of course, you can use a dedicated USB host controller based on MAX3421E chip (to SPI), aka "Arduino USB Host Shield", but it will cost you $20-$30, instead of an old junk PS/2 keyboard from some trash. – Ale..chenski Oct 30 '16 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.