Connect USB keyboard to Arduino MEGA 2560 via CP2102

I have connected a USB keyboard to this Addicore CP2102 USB to Serial (UART) Converter Module and the latter to the UART3 of Arduino MEGA2560. The code I wrote just reads the UART3 and sends them to UART0. But it does not work. To give some more information I have the following connection:

5V Arduino -------- 5Volt CP2102
GND Arduino ----- GND CP2102
Tx3 Arduino ------- RXI CP2102
Rx3 Arduino ------- TXD CP2102

Do I miss something?

The keyboard needs to connect to a USB Host.

The CP2102 is a USB Device - not a Host.

1 Like

How can I connect a USB keyboard to Arduino MEGA 2560?

I'm pretty sure the UNO shields will work on the Mega. If not they could be easily modded. I think the only difference is the location of the SPI port and most shields get that off of the ICSP connector anyway.

1 Like

Do the PS/2 to USB adaptors work for any USB keyboard? Do they have chip inside that transforms (translates) USB signals to PS/2 signals and vice-versa?

Actually, I can confirm that the one in the Amazon link works with a Mega. I forgot I've used that one before with a Mega to read from a game controller. No modifications needed and there's an official library for it.

1 Like

That is also an option. They do indeed convert the signal to something a PS2 port can recognize and there are libraries for Arduino to take PS2.

1 Like

No. I've tried it!

It seems that they relied upon some "dual mode" support in older keyboards - they don't work on newer ones.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.