IBM PC Keyboard Plug Repair

IBM PC 5150 or PC XT 5160 keyboard

The success or failure of a personal computer often could be predicted by the quality of the keyboard. The quality of a keyboard used to be extremely important, as it was the only input device. A high quality keyboard generally meant that the rest of the machine was well engineered; a poor keyboard could make a machine miserable to use.

Failed DIN connectorThe keyboard pictured above was used with the original IBM Personal Computer from 1981. The PC XT used a similar keyboard, while the later PC AT keyboard used a keyboard that was mechanically similar but with slightly different electronics to support the lock indicator lights. All of these keyboards used a fairly large 5 pin DIN connector. Later PS/2 style keyboards use a smaller 6 pin DIN connector.

While these keyboards air fairly well engineered, they are not immortal. One common problem can be found in the DIN connector that plugs into the PC motherboard. The solder connections in the DIN connector are prone to failing after 20 or 30 years, making the keyboard seem dead. If your keyboard only works when you are applying pressure on the DIN connector then you might have this problem. (I have had two keyboards with this same problem.) To the right is a picture of a connector that has already failed and is partially disassembled.

At first glance the connector looks difficult to repair. The pins disappear into a mass of black plastic or potting compound where the solder connections to the wires are. You can not get to the wires to resolder them to the connector. The ring of green is oxidized copper from where a copper shield met the upper part of the connector. The plug is thick molded rubber. In short, it looks like a disaster and not repairable. It is actually not as bad as it looks.

I am a pragmatist. This is not a museum piece yet so having it functional is worth more than having it as a conversation piece on the coffee table. I do like the machine and want to keep it as original as possible, so just simply hacking off the existing connector and putting a new generic connector on is not an option either. It is worth a little extra effort to repair it with new parts but to keep it as original looking as possible.

The first step is to completely disassemble the plug including the hidden internal parts of it. You are going to have to pry, twist and pull (gently) to accomplish this. The important part is to not mar the plug housing because that will be reused. I used some small screw drivers, a needle nosed pliers, and a hair dryer to get my connector apart. (The hair dryer is used to warm the plug up and make the material more pliable and easy to work with.) With a small amount of effort you can get to this state:

Disassembled DIN connector

Here you can see the four parts of the DIN connector including the hidden part where the solder connections were encased. The molded plug can be cleanly separated from the other parts.

Donor DIN plugAt this point you will need to solder the existing cable to a new set of internal DIN plug parts. I would not attempt to reuse the existing internal parts; just put them in a baggie somewhere for a historian in a few hundred years. There are a lot of DIN plugs available to choose from; I ordered a variety so that I could find one with the best fit. I wound up with the Kobiconn connector from Mouser (Mouser part number 17DN101-EX) pictured to the right. If you are searching for a compatible part it is a standard DIN connector with 5 pins in a 180 degree arc.

The internals of the new DIN connector are quite a bit different than the original but the overall length is the same.

The original plug housing is thicker than the donor plug housing as the part where the solder connections were made has a smaller diameter. When I tried to dry fit the parts together it was nearly impossible to slide the new internals into the old plug. If you need to heat the original plug housing to dry fit the parts then it is too tight. It also resulted in a noticable bulge through the plug housing that made it look as though something was wrong.

The solution to a problem like this normally starts with the letter "D". In this case, instead of duct tape I used "Dremel". A rotary tool like a Dremel is ideal for cleaning out the residual adhesive in the plug housing and for scraping part of it away from the inside, making it possible for the new internal parts to be inserted. Obviously you need to be careful not to do any damage to the original plug housing by wearing too much of it away. But if you work slowly and carefully you should be able to get the plug housing to accept the new internal parts snugly. (Keep checking the fit as you go!)

The next challenge is to solder the existing wires to the new pins. But first, lets look at the other end of the keyboard cord:

IBM PC keyboard internal cord connector Internal connector closeup
Keyboard cord internal connector Internal connector closeup

Getting inside of the keyboard is fairly easy - just lay it upside down on a table and remove two screws. The back of the keyboard will lift off revealing what you see in the pictures. You will need to do this to figure out the solder connections to the pins of the new DIN connector. For the standard PC keyboard the following mapping of wires to pins can be used:

Pinout for keyboard DIN connector         Berg connector pinout

Note that the RESET line (marked in green) is optional and it depends on the revision of the keyboard that you have. See for details, including the schematic. (And Ray - thanks for pointing this out to me!)

Solder cup side of pinsDisclaimer: Keep in mind that anything other than the original IBM PC keyboard might have a different pin mapping on the keyboard circuit board side of the cord. You are responsible for validating the pinout. This pinout is only good for the original IBM PC keyboard, and possibly only a specific set of serial numbers. Be careful!

Once you have the pinout verified the last step is to solder the new connector to the existing wires:

When you are done check the continuity of each pin all the way back to the Berg connector. If all of the pins are correct then you can test the new plug in a real machine. If that works well, slide everything back into the original IBM plug housing and you are done!

One important tip - keyboards on these old machines are not "hot pluggable", so do not insert or remove them from the system while the system is turned on.

Good luck!

Created March 3rd, 2013. Last updated November 10th, 2019. All images and text (C)opyright Michael B. Brutman, mbbrutman at