I like to tinker. My wife picked me up the new Raspberry Pi Zero. It’s an ultra small and ridiculously cheap computer. How small and cheap? They give it away free on the cover of magazines…

Ok, so what can I do with a wafer-thin Linux box? I had thought of turning it into a simple door sensor, or perhaps wiring it in to a lightswitch, or swallowing it to see if I would get super powers. Then it struck me – turn it into a games console!

Now, don’t get me wrong, this has been done many times before – but I think I’ve come up with a unique twist. Build it directly into the controller!

My original plan was to buy some USB NES controllers – they’re about the right size, but with only two buttons I’d be restricted to playing, well, old NES games. Also, buying new plastic stuff… nah! Reduce, Reuse, Recycle!

Long term readers will remember that I turned my original Xbox into a Linux running media centre. I still have the original (giant) controllers, my brilliant wife suggested that there was probably enough space in one to fit the Pi Zero.

Right, time to load an OS into my games controller ☺ pic.twitter.com/xqyuP3I3dm — Terence Eden (@edent) November 29, 2015

Let’s Go!

Getting Started

WARNING! Playing around with electric items can be dangerous. You risk damaging yourself or, worse, breaking your toys. Proceed with caution.

Equipment

Right, remember this big brute?



The Pi nestles neatly between the triggers, so it should fit.



Open it up:

I removed the chunky memory card holder. I left in the physical slots as a wedge to hold the Pi.

After unscrewing all the cross-head screws, we can see how well it fits.

Nifty!

Ah, but can you spot the problem?

The Pi is blocking that strut. Only one thing to do…

The plastic was soft enough that a penknife made short work of this.

As you can see, the inside of the controller has lots of room.

In order to connect the controller to the Pi, we need to do some wire stripping. The Xbox controller uses bog-standard USB wiring, but has a proprietary plug. So, chop the ends of that and wire it into a USB OTG cable.

I suppose I could have just wired in a regular USB plug, or bought an Xbox USB adapter. But where’s the fun in that?

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, I’m using some of the cardboard packaging.



Not exactly sustainable from a long term POV! Nor is the BluTak used to hold everything into place.

So, the controller’s cable loops back into itself and plugs into the Pi. The Pi takes in power and outputs over HDMI.

It would have been great if HDMI also supplied the power – but I don’t think that’s possible. There is enough space inside the controller for a USB battery pack should you want a more portable solution.

And… errr… that’s it really!

Emulation

The good folks at RetroPie have a pre-built image which contains everything you need in order to run a variety of emulators. It even includes some built in shareware games.

We want the build for the Raspberry Pi version 1. It automagically detected the Xbox controller, and after a few clicks I was playing Doom!

OMG! I'VE ONLY GONE AND BLOODY DONE IT!#PiZero hidden in an Xbox controller playing DOOM!https://t.co/jF3dgoKO3y pic.twitter.com/b9IrxoKxG7 — Terence Eden (@edent) November 29, 2015

The Raspberry Pi Zero is, without exaggeration, a marvel.

When I was a kid, computers were unreasonably expensive. I remember reading this passage from The Demon Headmaster series of books:



I felt so angry that the computer revolution was restricted to those whose parents or schools could afford such luxuries. The Pi is (almost) cheap enough to give away with cornflakes. Sure, the sundry items cost a little bit more – but this puts powerful computers within the reach of everyone.

The size is also… It’s almost too small! If you lose one in your home, it’s probably cheaper to buy another than waste an hour looking for it. That also means it can sneak into unexpected places – I can see kids hiding these in games controllers, hair brushes, or flick knives. Add a battery pack and a mesh-networking module and you’ve got a communications infrastructure that a school cannot censor.

Interesting times ahead!