This is a bit of an odd question, and is not really programming related. But I feel like I'm missing something obvious related to the wiring, setup, and/or initialization of the code for interfacing a PS/2 keyboard with an unbranded Arduino Nano product (CH341 serial interface).
I am trying to read key presses from a PS2 keyboard and echo them to the serial monitor. For this, I am using the "simple" sample programs of the PS2Keyboard and PS2KeyAdvanced libraries; both are equivalent and very similar. When I hook-up the keyboard to the Nano, its LEDs briefly illuminate, then its shuts down -- no key presses are read and presented in the serial monitor and the monitor shows the "ready" prompts printed by the sample programs.
The keyboard had a PS/2 terminal. I tested the keyboard on my computer with a Female PS2->Male USB-A converter and it works as expected; the LEDs also stay lit in its default mode (Caps-Lock ON). I cut off the PS/2 terminal and replaced it with a male USB-A terminal and the keyboard continues to function when connected to the computer.
On the Nano side, I hooked up a female USB-A terminal and wired its pins as follows: 1->5V, 2->D4, 3->D3, 4->GND. The keyboard is being powered by the Nano's 5V regulator, so I also attached a 9V battery to the VIN and another GND pin to compensate for the regulator's voltage drop when powered by USB alone. Given the mapping above, the sample PS2Keyboard and PS2KeyAdvanced code is initialized to use D3 as the IRQ pin, and D4 as the DATA pin.
I have reviewed these connections over and over and over, and I don't see anything wrong with the PS2->USB mapping above, and the connections to the board. The keyboard is simply not being detected and/or starting up properly when connected to the Nano board, with or without the USB modification I made. Incidentally, the keyboard also lights up briefly when connecting to a USB power bank (LEDs illuminate briefly then shut off).
Does anything seem wrong with this setup, and am I overlooking something simple?
My hypothesis is that this keyboard is actually an HID device and was hard-wired to work with a PS/2 port. This particular keyboard model comes in three varieties: PS/2, USB, and USB with hub. The internal controller board has an unpopulated USB-hub footprint, so I think the designer just used one PCB for all models to save cost. Furthermore the Windows 10 Device Manager shows it as an HID device when connected via USB -- should a PS/2 keyboard display as an HID or PS/2 keyboard in the Windows 10 Device Manager when hooked up through a USB port?
Please let me know if you have any insight on this problem. Thanks!