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 ...
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!
- An old metal pencil tin
- Some Playdoh (or some greetings card switches or real buttons or probably best some conductive paint)
- a suitable length of ethernet cable
- insulation tape
- sticky back plastic
- a makey makey kit
- a raspberry pi
- 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.
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:
Strip off the ends of the four wires you are going to use (3 buttons and 1 earth):
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):
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:
Then wrap the whole lot up:
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:
Ask an adult to drill a hole for the cable with a 5mm metal drill bit and then file the hole for you:
Thread the wires and cable through:
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:
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:
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.
Now thread the wires through the appropriate holes (refer back to your notes again):
Then secure inside with tape:
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:
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.
Other ways of doing this:
- 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.
- 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.
- 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.)