USB Keyboard to Serial ! Who can help?

Hi there,

i want to connect a USB Keyboard to an arduino for a serial output !
I just want to see my typing in the Serial Monitor !

Who can helb with thatone ? I can´t find anything about it, in the internet.

I´m also wondering why my usb keyboard is not turning on if i plug it into a 5V USB Charger ??? No LED on it turns on! If I plug it into the computer, it works just fine. Does it need some kinde of turn on signal via usb for the keyboard ???

Who knows...???
Cheers :slight_smile:

which Arduino?

Which Arduino board do you have ?

Doesn´t matter ! anyone that works. I just got a Leonardo and Uno right next to me to play with.

Doesn´t matter ! anyone that works.

do you really need an Arduino? Keyboard on an RPi will work out of the box :slight_smile:

if you can go PS/2 mode on your keyboard it's not too complicated to adapt to any Arduino

if you want USB, you'll need an USB Host capability and tinker around - never tried it

Yes, I need an Arduino. Pi is to expensive for my project. I found somting for a Leonardo. Serial to USB, but this is the wrong way. I need it the other way around.
Can´t find anything about it. It looks like I´m the first who want to do this.

You can connect a USB keyboard using the PS2 library

I tryed that. Did not work for some reason !?!

Without a wiring diagram, the code you used, and knowing which board you want to use, you are unlikely to receive meaningful help.

For instance, some boards use 3v3 logic and will not work with PS2 library without a logic level converter

A Leonardo can mimic a keyboard, present as a keyboard (USB).
To use a USB keyboard, a USB Host (or a USB Host Shield) is required.

I have a UNO,NANO,LEONARDO, BLUEPILL, NODEMCU. Those are the ones I have in my hand, right now ! But no USB-Shield. Hmm !? So, you think it´s not possible without USB-Shield ??

You want to connect the keyboard to the Arduino and the Arduino to a PC.
For that you can use an Uno and the PS2 library, as I said:
Connect Arduino UNO to USB Keyboard - Arduino Project Hub
You've said you tried it and it didn't work, but you still haven't posted code or a wiring diagram.

you could explore a BT keyboard connected to an ESP32

see this for example to find the code

What I realy want to do is, connecting a USB Bar Code Scanner that behaves like a keyboard to a plc via RS232. The problem is that I don´t have any idea how to do that. What Arduino is the best for this project ? Is there already a sketch ? Do I need a USB-Shield or not ??? I need help, even to start this project. All I know is, I need to convert the USB to RS232. There is a lot about it the other way around. RS232 to USB. But this is not what I need. I´m always picking heavy tasks ! :slight_smile:

You need USB Host capabilities
The easiest way to get that is to add a USB Host capable hardware

Otherwise see USBHost - Arduino Reference for example

Well,then I will have to order an USB-Host Shield. Sucks!
But at lest I have a small idea how to do it, now.

Thanks for your response.

whoop-there-it-is-whoop

Which explains why your attempts failed.

Next time consider leading off with what you really want to do. You'll get to the answer quicker and save everyone a bit of time.

I'm not familiar with PLCs; don't they have RS232 inputs (anymore)?

Yes, they have RS232 inputs (still), that´s the reason I need a usb-serial converter to connect Bar Code Scanners and Keyboards. :slight_smile: