PS2 Adaptor

The PS2 Keyboard Interface module allows the user to connect a PS/2 keyboard (or mouse) to an Arduino or other microcontrollers. The module facilitates connection by integrating a PS2 port with standard header pins for power and data lines. The PS2 port is a 6-pin mini-DIN connector. When connected to a keyboard, alphanumeric characters may then be read by the host microcontroller.

See the applications notes for suggested software/library.

 6 pin DIN PS/2 port
 Standard headers for power and data lines
 Power indicator  < 3mA power consumption
 Designed primarily for Arduino users

PIN FUNCTIONS The module has a 4 pin 2.54mm pitched header with the following functions.

Pin LabelFunction/Operation/Remarks
VCC+5Vdc. This is the keyboard power. The LED indicator on board will light up when power is applied. Since the module alone draws less than 3mA at 5V, and with keyboards typically being low power, this pin may then be connected to the Saleng Uno/Arduino’s 5V pin. Check your specific keyboard and application for exact current consumption.
GNDGround pin.
DATData pin. Connects to host microcontroller.
CLKClock pin. Connects to host microcontroller. When using the recommended library, please connect this to an external interrupt pin. In the Saleng Uno/Saleng BYOA/Saleng Mini 88/Arduino Uno/Nano/Pro Mini/Mega, you may use pins 2 or 3.  If the host is the Saleng Mini 644, contact Layad Circuits for instructions. Note that there are other available libraries and this may not be a requirement.


Because PS2 keyboards are typically 5V logic, use level shifters when using 3.3V microcontrollers to safely connect the keyboard to your host.


The basic usage and test setup is explained in this note. Using the module, a PS2 keyboard shall send the equivalent ASCII value of the key which has been pressed. The Arduino shall then display this on screen. The program and library is based on the PS2Keyboard library by PaulStoffregen.