Although I’ve seen many pictures of PS/2 keyboards plugged into iPhones on the Internet, no one has yet published a detailed howto on how to get this working yourself. Until now, that is.In this Instructable I will show you how you can make a PS/2 keyboard to iPhone converter, including all hardware and software instructions.
- Jailbroken iPhone – The official SDK doesn’t allow access to the serial port due to the Elf Conspiracy, so the jailbreak is required. All you need to know about jailbreaking is at the iPhone Dev Team Blog.
- Arduino Diecimila or Dumilanove (or clone), available from many places. This howto assumes that your Arduino is assembled.
- An iPod Breakout board, like this one from Sparkfun. Any similar product will work.
- A Female PS/2 (Din 6) Keyboard connector. Pull one off an old computer or buy one from Digikey or similar vendor.
- Wire, preferably several colors and about 24 gauge. I’m using a spool from RadioShack in the pics below.
- One 500k Resistor. I’m using an axial through-hole resistor from RadioShack, but you could add this to your Digikey order as well.
- Soldering Iron and Solder. If you don’t know how to solder, you can learn here and here.
- (Optional) Pin Headers, like these. I break these off and solder them to the ends of wires, so that they plug nicely into the Arduino.
- (Optional) Sweet 9v Battery harness so your Arduino becomes portable available from the Maker Store.
- (Optional) Stereo Headphone Jack from RadioShack or Digikey.
Step 1: Solder the iPhone Breakout - Part 1
Once all your ingredients arrive, fire up the soldering iron and have a quick look at the iPod Connector Pin-Out.
We’ll be making use of four of these pins for the keyboard: 11, 13, 16 and 21. The definition of pin 21 says we need to place a 500k resistor between pin 21 and ground to enable serial communications to the iPhone, so we’re going to stick a resistor between pin 21 and pin 16, which is the serial ground. We’re also going to be adding pin headers to pins 11 and 13, which will act as the TX and RX pins for serial communications. Since we’ll ONLY be sending to the iPhone, we only make use of the iPhone’s RX pin, so we’ll also be adding a piece of wire to connect pin 11, the unused TX pin, directly to the ground at pin 16.
You can also optionally add the stero headphone jack to pins 2, 3 and 4 right now and it will work whenever the breakout is plugged in. This has nothing to do with the keyboard, but if you have a 1G iPhone with the lame non-standard headphone jack, this will fix it.