A keyboard is a lovely way to enter character data into a computing system. It's much better than the toggle switches or hexadecimal keypads on the earliest computers. These days nearly all keyboards use USB connections. While easy to use with a computer, using USB with a microcontroller system is a bit more challenging with the limited resources available and the complexity of the USB protocol.
This guide provides the software, in CircuitPython and Arduino, to interface a USB keyboard with select microcontrollers with USB host capability.
The code presented uses a USB code to character map for a United States 104 key keyboard standard. This can be changed to decode non-US layout keyboards to the correct character input, although that mapping must be done by the user.






Page last edited April 24, 2025
Text editor powered by tinymce.