Starting with royboy's code and pictures http://siliconrepublic.blogspot.com/2010/08/arduino-based-human-interface-device.html
it tried my luck to implement a keyboard
emulator to send the results from my PSC barcode
scanner to the pc via a simple PS/2 plug.
Platform was an Arduino Nano and Win XP.
Good news is: It works.
But the project took me two days to reach the
According to my quick research many others had
problems getting their project to run:http://arduino.cc/forum/index.php/topic,19224.15.htmlhttp://arduino.cc/forum/index.php/topic,60574.0.html
In my case the stumbling blocks were numerous:
1) The ps2dev library documentation is very basic. No hint
is given where to start when the emulator doesn't work.
The included sample code just covers a PS/2 mouse.
2) Pull-up resistors were somewhere suggested but
3) At the moment the project only works if you use
a PS/2-USB converter. Any attempt to use it directly
with a normal PS/2 port of the PC failed, even on
4) The library is sensitive concerning timing. The
use of the standard Serial library (to get debug information)
caused an invisible, but serious problem.
5) I tried various sketches published but in the end
only royboy's worked. At the moment I can't say why.
6) The initialization of the PS/2 interface is not perfect.
I have to insert to USB plug twice to get the emulator to
transmit keyboard codes.
7) In my case I had to take the power from the PS/2 plug
not just the ground signal. That means that all four PS/2 signals
are connected (Power, Ground, Data, Clock).
To sum things up here is my way that proved passable:
- Start with the mouse sample code using an USB-converter.
- Don't include timing relevant debugging messages via Serial.
- Unplug and plug the USB-PS/2 connector.
- Let the Arduino be powered via PS/2 and unplug the standard Arduino USB connector.
The next steps form me will be
1) Take a look at the PS/2 directly with a SUMP logic analyzer.
2) Fix the initialization