What I'd like to do is have some kind of compact (and preferably inexpensive) Arduino-compatible device emulate a USB hub, and simulates plugging in a USB keyboard, pressing a key, then simulates unplugging the keyboard.

The goal here being a USB-connected device with media-control buttons for an Android device, but since plugging in a device that acts as a keyboard disables the on-screen keyboard, the idea is that it only acts like a keyboard when a button is pressed, but keeps a connection going while it's plugged in.

Is this at all possible with any Arduino-compatible device, do I need to look for a different embedded architecture, or do I need a particular kind of USB converter chip?

1 Answer 1


Since an Arduino is "just" a microcontroller with some specific bootloader and commonly programmed via the Arduino IDE, you can also program it like any other microcontroller.

There are several projects offering USB functionality as a library, in the Arduino world or outside of it. Use your favorite web search engine to find them. With such a library you should be able to tackle your task.

However, this is not a beginner's task. Please note that you might need to learn a lot.

I'd say that even the simplest AVR based Arduino should suffice.

  • Given I don't have much experience with USB terminology, what should I be searching for? Would "USB composite library" be an accurate description of this set of features? Jun 13, 2021 at 3:37
  • You could start with "avr usb library" and see what comes up. The interesting projects pop up quite early, and many of them link to other projects of the same subject. Use the keywords you find there to refine your search. -- But do I really have to tell you how to search? Jun 13, 2021 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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