# ps/2 to usb wire color code



## iranjeet (Oct 26, 2014)

My usb wire contains 4 wires 
red
white
green
black

and ps/2 keyboard wire contains 4 wires 
red
grey
brown
yellow

i want to connect those , please help which color code goes with wich wire.
Your help will be highly appreciated.


----------



## cwwozniak (Nov 29, 2005)

Hi iranjeet, and welcome to TSG.

Here is a description of which USB connector pins are used for which voltages and signals. The colors shown are typical only. As far as I know, USB cable manufacturers are not required to follow this particular color code. This may be particularly true if the manufacturer is making the cable with plugs at both ends. They just need to make sure the pins are wired to each other correctly, with what ever color wire they choose to use.

Pin #1 = +5 volts (Red)
Pin #2 = DATA- (Green)
Pin #3 = DATA+ (White)
Pin #4 = Ground (Black)

Here is a description of which PS/2 pins are used for which voltages and signals. There is are no color standards or typical wire color assignments for PS/2 cables. You would need to use an ohmmeter or continuity checker to match wire color to pin#.
Pin #1 = Data
Pin #3 = Ground
Pin #4 = +5 VDC
Pin #5= Clock
Pin #2, #6 = No Connection

You will note that the signal names are different. This is because PS/2 and USB use different communication methods. The internal hardware in some keyboards and mice is able to detect if a USB or PS/2 connection is being used and adjust their communications accordingly. These devices do allow the the use of a simple pin-to-pin adapter with the following interconnections.
USB #1 <-> PS/2 #4 
USB #2 <-> PS/2 #1 
USB #3 <-> PS/2 #5 
USB #4 <-> PS/2 #3

*NOTE: *Attempting to use a simple pin-to-pin cable adapter with a mouse or keyboard that does not support automatic detection will not work at all or not reliably. An adapter with built-in conversion electronics would be needed in such instances.


----------

