Introduction: RetroPi Xbox Controller

While attending a conference for work, I received a Raspberry Pi Zero as a giveaway. Naturally I started trying to figure out what to do with it. Remote control a drone? Webcam collar for my cat? With a computer that small, there were lots of things that could be done.

While searching the web to see what others had done with the Zero, I came across Terence Eden's Blog where he described placing his zero inside an Xbox controller. I decided to try and make a "cleaner" version of his project.

Goals:

  • As few wires as possible: Ideally, I only want the HDMI adapter cable coming out the front. This means it will need...
  • Battery with charging circuit: I want to be able to play for some reasonable amount of time without having to have an external power source plugged in. The good news is the Zero sips power, so we should be able to get at least an hours worth of run-time from a reasonably small battery.
  • Multiplayer support: I want to be able to plug in at least one additional controller for 2 player games. This means having a USB hub with exposed jacks on the "mother" controller.
  • Power and Reset switches: I need to be able to turn it off when not in use, and I need to be able to reset the Zero if an Emulator locks up.

Step 1: Parts List and Notes

  • Classic Xbox "Duke" controller
    • Make sure to get the classic, and not a newer "slim" controller. I started with a slim, but it really doesn't have enough room.
  • Pi Zero
  • Memory Card with RetroPie on it.
    • I'm not going to cover the software bits, but I used these install instructions.
  • Small USB Hub
    • I used an old USB 1.0 hub I had laying around, but this one looks like it *might* work ok, and would offer faster speeds than the one I used. Trick is to find a slim hub with all 4 ports coming out the narrow edge of the hub. Avoid USB 3.0 hubs, as there are some issues using them with the Pi (again, I learned this the hard way.

Step 2: A Note on Testing

Before you start chopping all the big bits into little bits, take all of your pieces and test them together to make sure things work as expected. You will have to put a standard USB connector on your controller for this step. Simply cut the end off of the Xbox controller and a sacrificial USB cable, and match up the wire colors.

Why test? I'll give you an example. My original intent was to wire things together as follows:

Pi Zero > Controller > Hub (Via Controller memory port)
That way, all 4 hub ports would be available for external devices. Unfortunately for some reason, my controller would only work when plugged into the hub. I'm not really sure why, but if I had not tested first, I would have wasted a lot of time with something that was not going to work in the first place.

Step 3: Disassemble the Controller

(I didn't take nearly enough pictures, and for that I am sorry. I will try to fill in as best I can)

  1. Remove the 7 screws holding the controller together. Then pull halves apart.
    (hold controller upside down so the buttons do not spill out).
  2. Remove screws holding controller board to bottom housing.

Step 4: Prepare the Controller PCB

To maximize space under the Controller PCB for the Zero, we want to remove the existing controller cable, and memory connector. And then solder new controller wires coming out the top of the Controller PCB.

  1. Remove existing cable header
  2. Remove Memory card connectors
  3. solder new controller cables

Step 5: Prepare Lower Controller Housing

To make the Zero fit, we have to cut and trim some plastic on the bottom housing.

  1. Trim plastic from Dpad support
  2. Trim plastic tab from front support
  3. Cut and shape top left screw hole as as shown.This will be used for the reset button.

Step 6: Mount Zero

Using a small amount of hot glue, tack the corners of the Zero in place in the bottom housing.
We will come back and add more hot glue to make it permanent later.

Step 7: Prepare Connector Plate.

We are going to use the bottom part of the memory card plate to act as a base for our power and HDMI connections.

  1. We will be bending the HDMI adapter cable into a pretzel, so carefully remove the insulation from the cable and female connector as shown. Try to leave the shielding tape. wrap the bare cable with a single piece of electrical tape folded over the cable longways to act as insulation.
  2. Cut/Trim the memory card plate. Remove the top and middle pieces leaving only the bottom. Cut a notch for the HDMI connector that will be sticking out of the Zero. Make this notch as small as possible (test fit a lot).
  3. Cut off the male end of your USB extension cable, and remove the insulation and D+ and D- cables.
  4. Hot glue the USB and HDMI connectors to this modified plate.

Step 8: Wire It All Together

Now we wire all the pieces we have so far. For these steps, you will need to pay careful attention to the
orientation/wire color of the parts you are taking off and soldering. a handy USB pinout guide is available here.

  1. De-solder input connector or wire from hub
  2. De-solder 1 USB port from the hub (this is where the controller will connect).
  3. Solder header wires on input port of the hub.
  4. Solder wires from controller to the port we removed on the hub
  5. Solder input header wires to solder pads on Pi.

You will notice in my pictures things are already hot glued in place. Regretfully I forgot to take pictures before I applied hot glue. I would encourage you to test everything before making it permanent.

Step 9: Add Reset Button.

  1. Solder length of wire to contact switch and glue switch into place we prepared earlier. route wires around outside of the lower housing of the controller, using hot glue to hold in place.
  2. Solder wires to reset pins on the Zero.

Step 10: Power Wires and Bottom Final Assembly

  1. Solder wires to pins 4 (+5v) and 6 (Gnd) of the Zero's GPIO, these will be used to power the Pi.
  2. Using hot glue, attach USB hub to the controller board.
    Make sure to check for fit, especially around the joystick. You may have to trim the collar on the upper controller housing to fit around the USB hub on that side. Apply hot glue to any solder points to act as insulation.
  3. Connect HDMI to Zero, and install connector plate, carefully bending/routing the HDMI cable to fit.
  4. Securely glue down the Zero.
  5. Attach controller PCB to bottom assembly, being sure to bring the USB power and power to Zero wires through to the top.
  6. Remove middle two pins from JST socket.
  7. Solder JST to Zero/USB power wires as follows (looking at the socket pins down, opening towards you):
    1 - Gnd to Zero
    2 - +5v to Zero
    3 - Not used
    4 - Not used
    5 - +5v from USB
    6 - Gnd from USB

Step 11: A Pause Before the Next Step...

Originally, my plan was to have LEDs to indicate Power, charging, charged, and low battery status. when I received the 1000C however, I realized this was not possible. because the 1000C did not have a breakout for anything except low battery. That left me two options:

  1. solder taps onto the SMD LEDs on the 1000C
  2. use the existing LEDs on the 1000C

Option 1 is only really an option if you have experience soldering SMD, and have the specialized tools to do it. I have neither.

So I started looking at option 2 and realized the Xbox logo jewel on the controller gives me a ready made window for the 1000C.

So then I tried to remove the clear portion of the jewel from the controller so I could more easily make a cutout for the 1000C. I did some reading and the recommendations I found said to use a hair dryer to heat the front and back of the jewel, and then flex the plastic to release the glue.

DO NOT DO THIS

You will see in the next picture, but I got part of the controller too hot, and deformed the hole for the buttons. This almost ruined my controller.

My advice is to cut from below, just be careful to not scratch the clear portion.

Step 12: Prepare Top Housing of Controller

  1. Carefully measure and cut out plastic below the "jewel" to make a hole for the 1000C.
  2. Clip off screw post closest to the top left joystick. This makes room for the USB Hub.

  3. Carefully melt/cut a mounting hole for the power switch right above the "select/start" buttons.

  4. Mount switch in mounting hole.

Step 13: Prepare the 1000C

Solder three wires to the Gnd, EN and Vsh pins on the 1000C. These will go to the power switch. I used Black, White and Red respectively.

assuming you are using the same JST I bought, remove the middle two wires of the JST pigtail, and cut about half of the pigtail off. Strip and re-tin wire ends, then solder to the 1000C as follows:

  • Green: to (-) pin of 1000C's output
  • Orange: to (+) pin of 1000C's output
  • Red: to "USB" Pin
  • Black: to Gnd Pin

Solder the power switch wires to the switch as shown in the picture.

Step 14: Mount Charging and Battery Circuit to Top Housing.

(Again, I suck at taking pictures, I'm sorry.)

  1. Connect battery JST connector to 1000C
  2. Fasten 1000C into top housing using hot glue
  3. Secure Battery on top of 1000C using Hot glue.

Step 15: Done!

Connect the JST connector, re-assemble the top and bottom halves, and you are ready to game.

I'm a little worried about the USB ports on mine, it seems like they may be easily snapped off by an overly-enthusiastic gamer. I may build up some glue as reinforcement, but doing so will make the controller hard to disassemble in the future, so I may hold off until I've played with it awhile and made sure everything works.

Comments

author
dexter.dageek made it!(author)2016-08-29

For a build up method that is fairly strong, very cheap and will not hinder future tear downs I suggest the old model makers trick of super glue and baking soda. You can google instrutions so I won't type it all out but the result is light, rigid can be cut, sanded, dremeled and painted. Cheers and nice write up.

author
karride made it!(author)2016-09-07

Thanks. I had not heard of this.

author
illumation_ made it!(author)2016-09-03

Question: How hot is the device when using it for, let's say, one hour? Any experience info on that?

author
karride made it!(author)2016-09-07

I have not actually taken my IR thermometer to it, but after about an hour of playing two player Dr. Mario, the bottom middle of the controller is slightly warm.

The hottest part is actually the charging circuit, if you are charging a low battery and playing at the same time, the jewel gets hot. Not melt/burn you hot, but certainly noticeably hot.

I'll try to remember to have my thermometer next to me next time I play with the controller. Unfortunately my hair dryer damage to the top part has worsened with use and has made the Dpad unreliable, so I'll probably have to tear down and rebuild that portion of it at some point.

author
Msy121997 made it!(author)2016-08-12

Thank you

author
Msy121997 made it!(author)2016-08-11

What would you say the total cost was?

author
karride made it!(author)2016-08-12

Short answer is if you had to go out and buy everything, it is about $120

For the long answer, here is the price breakdown (in USD):

HDMI Adapter $6.50
Micro USB $5.79
JST connectors $4.99
Controller $10.37
WiFi $7.99 (Optional)
SD Card $10.00
1000C $27.99
Battery $9.95
USB Hub $13.18
Pi Zero 1.2 $20.00

Total $116.76

author
tomatoskins made it!(author)2016-08-09

What a cool idea! Thanks for sharing!