The older USB 1.0 and 2.0 cables have fewer wires than the newer 3.0: here’s a quick guide
You should be now have a reasonably good idea of the controller that we’ll be working with. ‘The Duke’ has dual joysticks, six buttons, a D-Pad and two triggers, and it’s compatible with most retro games systems.
If you’re using a different controller, double check that the Pi is likely to fit inside before you crack it open. As you’ll see here, the Pi nestles neatly between the triggers of this controller — the original Xbox controller is one of the largest.
The controller is held together by half a dozen cross-head screws. Be careful when opening the case as the buttons and rubber contacts are loose within the controller — they will spill everywhere!
With the shell removed, you should be able to undo the screws holding the main circuit board in place. Gently unclip the connectors powering the vibration motors in order to completely remove the board. You might find it easier to use pliers for this — just be very gentle as you pull!
GENTLY DOES IT
You can see for yourself just how well the Pi fits here; it can be squeezed under the memory card slot. If you want to hold it firmly in place, use some BluTak as a temporary solution. Also, if you’re using an older controller, it’s worth giving it a bit of a clean. Remove the rubber contacts and gently swab under them using the isopropyl alcohol swabs.
CUT TO FIT
Depending on the model of controller, you may find that the Pi blocks one of the internal plastic struts. The plastic is soft enough that a craft knife will easily cut it down to size, though. Start with small strokes, shaving off a tiny bit at a time until you have enough room. Make sure the plastic dust is cleaned out before you reassemble the controller. If you have a can of compressed air, you can use it to easily blow away the shavings.
CONNECTING IT UP
If you’re using a controller that has a regular USB port on it, you can just plug it into the Pi via a USB OTG converter. If you’re using the original Xbox Controller, it’s slightly tricky. Microsoft, in its infinite wisdom, has decided that the original Xbox should use USB, but with an incompatible plug design. This means, in order to connect the controller to the Pi, we need to do some wire stripping. Fun! The wiring inside the Xbox controller’s cable uses bog-standard USB wiring colours, so once you’ve chopped the plugs off the controller and the OTG cable, it’s pretty straightforward to connect them together.
Strip the wires by a couple of centimetres and then connect them together. You should have Red, Green, White, and Black. The Xbox cable also has a Yellow wire which you can ignore. It is worth noting at this point that you need to be sure that you have a USB data transfer cable and not just a plain old power cable — the former will look like the photo on the right, but power cables will be missing the two data wires.
With the wires stripped, we temporarily used regular sticky-tape to make the connections between the OTG cable and the controller — for a more permanent installation, you can use electrical tape or simply solder the wires together.
One thing to note: you’ll need to insulate the bottom of the Pi against all the contacts on the controller. For this quick hack, we’ve used some of the cardboard packaging — but any nonconductive material will do.
From there, it’s as simple as screwing the case back together. Make sure that the controller’s buttons and joysticks don’t slip out of alignment. Keep track of which coloured buttons go where and you should be fine.
The Pi will need three wires connected to it in order to work. The controller cable needs to be connected to the USB OTG port. An HDMI cable goes from your TV to the mini HDMI port on the Pi. Finally, a 2A micro USB power supply needs to be plugged into the Pi’s power socket. We’ve used a standard mobile phone charger, but you can use a USB battery pack if you want to reduce the number of wires trailing around your room.
A WORD ABOUT POWER
You might be wondering whether it’s possible to get the HDMI cable to supply power from the TV to the controller. Sadly, the HDMI specification doesn’t permit power to flow in that direction. If your TV has a USB socket on it, you could use that to supply the Pi with power — just make sure the socket itself is powerful enough. The Pi needs at least 1 Amp, and ideally 2 Amps. Many TVs will only output 500mA which isn’t enough to run the Pi.
OK, it’s looking good — you’re nearly ready to play. The next step is to get some emulation software on this thing.
“If your TV has a USB socket, you could use that to supply the Pi with power – just make sure it’s powerful enough.”
Green The circuit can get the difference between the two data signals rather than between a single wire and ground. It’s a more effective transmission Black This is the other wire associated with the power — the ground wire, which is the counterpart to the 5V wire Yellow USB mini/micro cables will also have an additional wire that isn’t required for our particular project Red The red wire is one of two handling power. This one is a 5V power line that provides voltage to the circuit White This wire is one of two used for differential data signals. This white wire is the positive component and the green wire is the negative one
Be careful that you don’t lose any small parts when opening up the controller
You can solder the OTG cable and controller together, but sticky-tape will also do the trick