DIY – Pi Game Controller

Got a Raspberry Pi but want a cool USB controller to play Pong on?
Why not design your own. Here's how ...

pi controller image

This controller only has three buttons and uses Playdoh but when you design your own there are many other options. These are discussed at the end of this tutorial. Playdoh is very colourful but it does lose its shape if you get excited!

Shopping List

  1. An old metal pencil tin
  2. Some Playdoh (or some greetings card switches or real buttons or probably best some conductive paint)
  3. a suitable length of ethernet cable
  4. insulation tape
  5. sellotape
  6. sticky back plastic
  7. a makey makey kit
  8. a raspberry pi
  9. various tools (including an adult with a drill)

Makey Makey evaluation
These kits are awesome for inventing stuff and quite inexpensive. When you are ready, just replace your keyboard with the USB cable from the Makey Makey and you are good to go. The only issue is that you have to be earthed and there is often a lot of messy cable. Both of these problems have been solved in this project.

Project Instructions
Get a 3m length of ethernet cable (This has 8 wires, all nicely packed together and colour coded. It is also cheap.) Open out one end to reveal about 4cm lengths of the wires:

pi controller image

Strip off the ends of the four wires you are going to use (3 buttons and 1 earth):

pi controller image

This controller is going to have a left and right button and a fire button which will be assigned to the left and right keys and the space bar. Therefore attach the wires to your Makey Makey like this (The crocodile clips come with the Makey Makey kit):

pi controller image

Now, note down which wires go where and then tidy up the cables at this end and ensure they are insulated from each other. First insulate each wire with insulation tape:

pi controller image

Then wrap the whole lot up:

pi controller image

Next prepare the other end of the cable by carefully cutting off the cable's jacket to reveal about 25cm lengths of wire. Top tip: snip down about 1cm from the open end of the cable. Then you should be able to tear the jacket open for another 2cm. By this stage you can hold the bunch of wires and use them to rip through the rest of the jacket. DO NOT try and cut round the cable's jacket and hope you will not nick the insulation of the 8 wires - you will! Look back at your notes to see which wires you are using and cut off the others. It should end up looking like this:

pi controller image

Ask an adult to drill a hole for the cable with a 5mm metal drill bit and then file the hole for you:

pi controller image

Thread the wires and cable through:

pi controller image

The next job is to secure the earth wire to the inside top of the pencil tin. This will be the bottom of the controller and will be earthed simply by you holding it – genius!

To ensure you get a reliable contact, scrape off the varnish before attaching the wire with sellotape. Remember to leave some slack for opening and closing of the tin:

pi controller image

Close the tin and turn upside down. Measure and cut a section of sticky back plastic (such as used to back exercise books at school) to cover the whole of this surface:

pi controller image

Here is the tin with the sticky back plastic applied. This provides electrical insulation between the tin (the earth) and the buttons. Three holes have been drilled with a 2mm drill. You can now dismiss the adult, he or she is no longer necessary. Adults can be useful however, for putting the drill away and doing other tidying tasks while you work.

pi controller image

Now thread the wires through the appropriate holes (refer back to your notes again):

pi controller image

Then secure inside with tape:

pi controller image

Nearly finished now. Shut the tin and strip and curl your wires like this. Do not worry if you keep snipping it as this does not really matter as long as there is some wire to connect to your button:

pi controller image

Finally add your blobs of playdough to make the buttons. Just ensure that they do not touch each other or spread over the edge of the sticky back plastic.

pi controller image

Other ways of doing this:

  1. Instead of playdough, you could use conductive paint to really customise your controller. Be careful the paint does not leak through the holes in the lid which would then make contact with the metal tin.
  2. Use real buttons that you can buy or take off broken electrical toys or old games controllers. We have several N64 remotes that no longer work and I am sure most homes have something similar.
  3. Another alternative is to pull open an old, no longer functioning, console controller and attach the ethernet cable wires to the buttons you want to use. You should also be able to drill a hole and take the Earth wire out a 2mm hole from inside the controller to one of the handles. You can then carefully thread it back in another 2mm hole and secure it again inside the controller before re-assembling. You will then be earthed everytime you pick it up.

(Feedback and suggestions for improvement are very welcome.)

Contact: chris@codingclub.co.uk


Python Basics:


Python Programming Art:


Python: Next Steps:


Python: Interactive Adventures:


Python: Building Big Apps:


Black Flag:


Other Info:

Quick Index

© in the Site, Chris Roffey 2012
© in extracts from Python Basics, Cambridge University Press 2012
© in extracts from Python Next Steps, Cambridge University Press 2013
© in the characters derived from Python Basics. Cambridge University Press 2012
© in the characters derived from Python Next Steps. Cambridge University Press 2013
© in the characters derived from Python Building Big Apps. Cambridge University Press 2013
© in the characters derived from Python Programming Art. Cambridge University Press 2014
© in the characters derived from Python Interactive Adventures. Cambridge University Press 2016