Building this Portable Games Console is possibly the most fun I've had using a Raspberry Pi. And it's not just the build that's fun; I've now got a fully functioning games console, so I can play all my favourite old arcade games, on-the-go!

There's a quiet a few other projects out there where people have done similar things and I've used them for help along the way. Projects like the Adafruit Cupcade and Ben Heck's PiMAME, but these often have complicated powering solutions and can be pretty tricky to build.

The power option I've gone for is the PiJuice. It's an integrated battery module specially built for the Raspberry Pi (complete with our revolutionary PiAnywhere technology – the best way to take your Pi off the grid!). It makes the whole project simple and neat and means that I don't need to mess around with charging circuits and power converters.

I started off using the PiJuice when I built the Raspberry Pi Compact Camera, and that's when I realized it's potential to be used in this Portable Games Console.

I'm glad to here of any ideas you have for other great solar or portable projects. Let me know in the comments and I'll do my best to create a tutorial!

For more information on the PiJuice head over to our Kickstarter and you could be the proud owner of a Games Console Maker Kit + PiJuice:


Step 1: Parts

Step 2: Download AdvMame for Raspberry Pi

The first stage is to download the games console image. The version used here is something called “cupcade”, developed by Adafruit, it utilises Shea Silverman’s AdvMAME emulator and is adapted to run smoothly with the Adafruit 2.2” TFT screen. The image is available for download from here and can be written to an SD card using your preferred method

It’s a good idea to check at this stage that everything is working properly, but first you'll need a game to play. Here is a set of legal ROMs to download straight from the MAME website. Download the desired ROM to your PC. With the SD card still in the PC copy and paste or drag and drop the the ROM from download into the ROM folder on the SD card, located in the advmame directory. The ROM should be left as a zip file.

Now everything should be set to play your game; plug the SD card into your Raspberry Pi and connect a USB keyboard. This is a good time to test out the PiJuice: It plugs into the GPIO on the Raspberry Pi as seen in the diagram. Fortunately, the PiJuice has a breakout so that all of the Raspberry Pi GPIO are still available and the screen just sits on top, like a PiJuice Sandwich.

Step 3: Custom Games Controller - Joystick

The output from the joystick is two analog signals for x position and y position ranging from 0 to 5V. The Arduino is used as an analogue to digital converter since the Raspberry Pi doesn't have any analogue pins.

If you wanted to try this project yourself, you'll need to do some soldering, so ensure you are comfortable with using a soldering iron safely. If you are at all unsure, ask for the help of somebody who is competent with soldering.

First, right angle headers are soldered to the Arduino on the following pins:

  • Pin A0 - for input from joystick in x direction,
  • Pin A1 - for input from joystick in y direction,
  • Pins 2,3,4 and 5 for output of a digital state to the Raspberry Pi GPIO, (up, down, left and right).
  • VCC and GRD for powering the Arduino
  • VCC and GRD for powering the joystick

Then wires are soldred to the TFT screen in the following way:

  • A red wire with female end (~7cm) to 5V pin on TFT screen to power the Arduino
  • A Black wire with female end (~7cm) to GRD on TFT screen. This is the pad marked with "WP" located on the underside of the screen.

To program the Arduino, it is connected to a computer using a USB to TTL adapter. It's programmed using the Arduino IDE. (If you do not already have the Arduino software installed it can be downloaded from the Arduino website.) Make sure that the correct board is selected under Tools>Board. This is where the the code for the analogue to digital conversion can be uploaded to the Arduino. It's available on to the PiJuice Github page.

Step 4: Custom Games Controller - Buttons

The wire connecters are solder to each tactile switch in the diagonal positioning as seen in the picture. One side of each switch is connected to ground and the other is connected to a GPIO input on the Raspberry Pi.

To connect each switch to ground I made a 4-1 junction as seen in the picture, this requires soldering and using heat shrink to wrap the junction. Another female jumper is soldered to the ground pad on the screen for connecting to the junction.

To connect the other sides of each switch to the GPIO, right angle headers are soldered onto the GPIO breakout on the TFT screen. First, two right angle pins onto pins 17 and 27, these will be the [insert coin] and [start 1p] buttons. Then, a row of headers into pins 5, 6, 12, 13, 16, 19, 20 and 21. These will make up four action buttons and four direction buttons.

Then using an assortment of jumper leads everything is connected up:

  • VCC Arduino - VC Joystick
  • GND Arduino - GND Joystick
  • A0 Arduino - Joystick X
  • A1 Arduino - Joystick Y
  • 2 Arduino - GPIO 12 RPi
  • 3 Arduino - GPIO 13 RPi
  • 4 Arduino - GPIO 20 RPi
  • 5 Arduino - GPIO 21 RPi
  • VCC Arduino - 5V RPi
  • GND Arduino - GND RPi

(The ordering of the buttons is not important at this stage)

  • Button 1 - GND RPi and GPIO 5 RPi
  • Button 2 - GND RPi and GPIO 6 RPi
  • Button 3 - GND RPi and GPIO 17 RPi
  • Button 4 - GND RPi and GPIO 27 RPi

The next step is to get the software to map GPIO input to keyboard function.

Step 5: Retrogame

To use the GPIO as input for the controls rather than a keyboard I used some software in the background. The is called Retrogame written by Adafruit.

Download the Retrogame zip file from here onto a linux pc.

Open up a file viewer with root privileges and copy and paste the Retrogame file into the home>pi directory.

Now you can edit the file on the Raspberry Pi using an SSH client with your Raspberry on the local network. Unzip the Adafruit-Retrogame-master.zip and open up retrogame.c (sudo nano....).

In retrogame.c there's a table which outlines which GPIO replaces which keyboard function. These can be changed to suite your own needs mine is set to match the picture above.

retrogame.c is compiled and ran using "sudo make retrogame.c" and "sudo ./retrogame"

Again, this is a good time to check that everything is working properly, before the whole thing is assembled. With retrogame running, start up a ROM, fingers crossed...

We're Gaming!

To make retrogame.c run on boot edit rc.loacl and add "home/pi/Adafruit-Retrogame/retrogame &" before the final "exit 0" line.

Step 6: Assembling the Console

Now that everything is all working, and powered completely off the grid, with the aid of the PiJuice, the final stage is to put everything together.

If you wanted to follow this guide, you could always build your own simple chasis to house all of the components. It wouldn't be too hard to make something suitable.

I'm really happy with the finish off this project and all fits nicely into one single unit. However, this is just a prototype! We're making a number of improvements so that it's going to be even easier for other people to build.

If you want the official completed Games Console project kit including chassis and PiJuice module then you could always head over to the Kickstarter page and pre-order the "Maker Kit" to get the essential parts required to build the compact camera, games console and Portable PocketPi.

Like I said earlier, if you've got any ideas for some cool projects, let me know!

<p>hay could you please up date this RPI3 model B i'm about to get one and i think this is a grate idea and if you don't i under stand i'll try my hand at building own</p><p>thx thx thxxxx XD</p>
<p>Hi,<br>How can I connect a Blackberry Bold Q10 nano-keyboard to a raspberry?<br>I want to make my raspberry portable console with a nano-keyboard of a Blackberry Bold Q10 but i don't know how to connect it XD</p>
<p>that is awesome how long did it take</p>
<p>Hey! I haven't begun this project yet, for I'm still thinking about something else I could do with my pi. My question is, I know it'll be possible to add more buttons, but how would I know where to place them on the Arduino? Is there a guide for this? Thanks!</p>
<p>Hello! Nice Project :)</p><p>I hope you can help me!</p><p>There's my proplem: when i try 'sudo ./retrogame' i get an error with this message: Pin config failed. Try 'sudo ./retrogame'. - of course, i used sudo!</p><p>Please Help me!</p><p>Have a nice day :)</p>
<p>Try re-installing your image, and make sure it's a compatible/updated release. I haven't used Cupcade, I've only used Emulation Station so I can't give much help.</p>
Thank you for your reaponse! I fixed it recently... I installed &quot;GPioneer&quot; on a fresh raspbian and configured it via the web-interface. Then i installed the Adafruit-PiTFT Driver on top of it. Finally i installed retropie with its install script. Now everything works just fine :)<br><br>Have a nice day!
What are the games that go on here?
Loved it super sonic cool
<p>Hey yishaisilver. The games that currently work on this are emulators of lots of old school arcade games. Here's a link to the legal ROMs that you can download:</p><p>http://www.mame.net/roms/, I've found the best out of these to be &quot;Star Fire&quot;. There's also plenty of websites offering tons of other advmame ROMs that you can find, but these are less legal. </p>
<p>Sorry but i cannot be nice when it comes to this project because it requires one thing that is STILL ON PRE ORDER..<br><br>thats right, one of the requirements for this, The &quot;PiJuice&quot;. is still on pre order.<br><br>Sorry but Until such time as it comes out to public use, This is not going to be a nice comment.</p>
<p>put some retro pi and a raspberry pi 2 in there! </p>
<p>Good work!</p>
<p>is there a way to do this without having linux?</p>
<p>That depends on what you want to do and the answer would be yes, probably. I don't think the RPi A+ has ethernet so you'd need a slightly different transfer strategy than doing it over a network..</p><p>-- Transferring Files to the Pi</p><p>One way would probably be to use the appropriate USB/Serial cable to connect to the RPi's serial terminal and go from there. This is an example that uses Linux: <a href="https://www.instructables.com/id/Transfer-file-from-PC-to-Raspberry-Pi-Using-USB-Se/" rel="nofollow"> https://www.instructables.com/id/Transfer-file-fro...</a></p><p>It should be possible to do the same from Windows with a terminal application on Windows that can talk the serial protocol and do file transfers though. TeraTerm should work adequately. See this tutorial: <a href="http://marge.phys.washington.edu/software/SSH_File_Transfer.html" rel="nofollow"> http://marge.phys.washington.edu/software/SSH_Fil...</a></p><p>You'll still need the lrzsz (https://ohse.de/uwe/software/lrzsz.html) package installed on the RPi as noted in the above tutorial because it handles receipt and transmission of files on the Pi end. Getting it to the pi shouldn't be too hard. An easier way than they describe (to get the files on the Pi) is probably to pop it on a USB stick using your Windows PC and then, once connected over SSH/Serial to your pi, mount the stick and copy over the files.</p><p>If you have a keyboard, mouse, and screen for your pi you can skip transferring files over serial (although you may still want that setup for work on the device once it's constructed.) and just move them as above with a USB stick.</p>
<p>I am not aware of any way around it at this stage, unfortunately. You may be able to use SFTP to transfer the retrogame file to your raspberry pi SD card through a network and then SSH into the Pi to unzip and manipulate the code, but I haven't tried this so I can't say for certain. </p>
<p>Is there any particular reason you powered the Arduino off the TFT board instead of just running it to the Pi?</p>
<p>Hi! The only reason is just for ease really. Not all of the GPIO are available as they are either used or at least physically blocked by the screen's header. And to it just made sense to solder to the screen for this reason. </p>
<p>Liked your design :) Once i also worked on something like this.</p>
<p>Sweet! is that two player?</p>
Pretty cool :), love playing vintage video games. Can't wait to order it.
<p>Hi Alex, glad you like it. The PiJuice module is actually available for pre-order if you go through the Kickstarter link. </p>
<p>this is sikh</p>
<p>i have MAME ROMs for my windows pc n working fine. can the rpi uses the same ROM? i ask because the MAME on my android phone doesnt even recognize some ROMs from my PC.</p>
<p>Hi tmv22, I believe the ROMs are the same. If they work on your PC they should work fine on the Pi. </p>
<p>Actually, that's not true. The most common MAME version for the Pi is based off of 0.37 (I believe), which is ten years old. MAME ROMs for more recent versions of MAME may very well not work.</p>
<p>yes, im experiencing some issues with MAME in my rpi v1. some games would not work. and when they do work, they are very slow. i hope rpi v2 will be better. so for now, i have my rpi v1 back to XBMC n that works great!</p>
<p>Oh, I wasn't aware of that, it makes sense though. Thanks albill! </p>
<p>Would this work with a different version of the raspberry pi?</p>
<p>Hey, Yeah this will work fine on all raspberry pis! </p>
<p>Thats fascinating...</p>
<p>Thats brilliant</p>
<p>I love the way this turned out! I also took a look at your guys kickstarter and IM &lt;3ing what I see. Awesome Job guys!</p>
Nice Project<br>Did you try putting retropie on it<br><br>
<p>Thanks! Glad you liked it. Retropie is great except it uses OpenGL graphics which is incompatible with the TFT screen we have been using. It's a shame especially since the Raspberry Pi 2 came out because they now have a PS1 emulator! One solution you could try is to use a small hdmi screen instead of the TFT. I really like MAME though because I love the &quot;old school&quot; feel!</p>
Actually there is a way to use that screen with retropie and openGL(Minecraft!). It involves making a background process program that constantly copies hdmi output to the lcd. there's a simple name for each and it a very simple program(look it up for more info). It just may slow your FPS by 8 or so. :( There is also small cheap composite monitors for a car backup camera you can connect to the Rpi(via headphone jack or contact on bottom), and they do support openGL. I am working on a similar project(A little more complex though) and I will post it soon and you can see what I mean.
<p>Thanks, I will look it up when I have more time. And Thanks for the advice regarding the contest! I've now added the project.</p>
Also you did not enter this in the pi/e day contest, I would add it if I were you. It's not automatic you have to say that you are entering it. on the mobile app it's on the last page before you publish. Not sure about the website.
<p>Super fun!</p>
<p>It's Amazing,..... </p>
<p>Really, like your concept i am having http://www.sfcable.com/3902-SF-07.html which is broke and now i want to make use it's parts.. to make a new console..</p>
<p>That's a cool idea. Take it apart and have a look inside. I've found that the circuits inside can often be quite complex, but you wont know until you look! And in any case there's probably a few bits and bobs from the controller you could use. </p>

About This Instructable




Bio: PiJuice is a product from the company, Pi Supply. Pi Supply is a Maker emporium located in the UK that ships maker products worldwide!
More by PiJuice:Raspberry Portable Pi Laptop Raspberry Pi Solar Weather Station Raspberry Pi Portable Games Console 
Add instructable to: