this post was submitted on 06 Apr 2025
9 points (100.0% liked)
Electrical and Computer Engineering
1108 readers
4 users here now
Electrical and computer engineering (ECE) community, for professionals and learners. Discuss ECE related topics here, for instance digital design, signal processing, circuit analysis, electromagnetics, microelectronics, power electronics, RF electronics, etc.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would definitely not go with an Arduino. You want to send keyboard data to a PC, so you have to emulate a USB keyboard device. The run-off-the-mill Arduino only has a USB chip capable of being a USB serial (UART) interface - it is a seperate, single-purpose chip connecting the USB to the controller.
What you need is a microcontroller board where the controller is also doing the USB stuff directly, so it is capable of being any device, at least those where a USB stack for the controller already exists.
Maybe have a look at a Raspberry Pi Pico (which is not a "normal" Raspberry Pi, but a separate and rather cheap board with a small controller). If you google for "rpi pico as keyboard", you'll see a number of projects where people have already done this, so you might even get a ready-made software or at least something close to it.
Arduino MCU? Probably not. There's better choices that are easier to use. Like the RP2040 (and RP2350) based boards.
Arduino firmware tools and language? Definitely recommended. There are lots of libraries and a great community that one can turn to for help. Most common 32-bit MCUs (RP2xxx, ESP32, STM32, nRF, etc) have Arduino support.
But the key issue is to have a USB Keyboard device, there the RPi Pico is definitely the way to go, and I have seen that one of the project seems to have been written in micropython, which should be easily adaptable.
I have to admit, though, that my experience with RP2XXX under Arduino IDE is limited insofar I have tried it and found it lacking. Since then I use the default IDE.
A good USB chip can go a long way on an MCU. The old Arduino boards did indeed have a lot of problems. Despite that, the Pro Micro is pretty popular for mech kbs. Personally, I'm not a fan. Not because of its USB (the ATmega32U4 chip has an integrated USB 2.0 peripheral) but because it uses an 8-bit AVR chip. To me, 8-bit is a bit dated for a beginner, when 32-bit MCUs are so cheap.
To your point, the Adafruit KB2040, an MCU using the same footprint as a Pro Micro but with an RP2040, only has a USB 1.1 PHY (much lower bandwidth). It is generally a better choice though because it both has a USB PHY and is 32-bit with a much higher clock frequency. The keyboard HID information doesn't take much bandwidth and isn't much different from when it was first released in 1995 as a standard. So, as long as the MCU supports acting as a USB HID device, you're good to go.
An RPi Pico is a great and cheap board but, I'm less of a fan due to its lack of USB type C. That's why I'd recommend just about any other third-party board based on the RP2040 (or RP2350). For anyone who is not unreasonably annoyed by the connector type, the Pico/Pico 2 is great. For wireless, probably something based on an ESP32S3 or Nordic nRF series (Nordic is more proprietary but much better on power efficiency - a Nice!NanoV2 is a great wireless keyboard MCU).
I've got a RPi Pico with the RP2040 right here, and it does not have a type C connector but a B Micro.
And USB1.1 is more than sufficient for a keyboard - even at the usual low speed setting for a keyboard (1.5mbit/s) you'll be hard pressed to fill that up with your typing.