Introduction: Raspberry Pi Portable Games Console

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:

https://www.kickstarter.com/projects/1895460425/pijuice-a-portable-project-platform-for-every-rasp.

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!

Comments

author
Quadrivium (author)2017-08-16

I cannot find a PiJuice for sale, could someone please direct me to a website that sells them?

author
manish679fd (author)2017-08-09

hey i too have started working on PI recently and have PI 3 with me. Can you please update your post for PI 3.

author
bear toy (author)2017-03-19

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

thx thx thxxxx XD

author
joelm145 (author)2017-02-27

Hi,
How can I connect a Blackberry Bold Q10 nano-keyboard to a raspberry?
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

author
aleindoodler48 (author)2016-03-04

that is awesome how long did it take

author
joshigovind12 (author)2015-12-21

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!

author
MarkusS1 (author)2015-09-18

Hello! Nice Project :)

I hope you can help me!

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!

Please Help me!

Have a nice day :)

author
JesusG33k (author)MarkusS12015-11-04

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.

author
MarkusS1 (author)JesusG33k2015-11-04

Thank you for your reaponse! I fixed it recently... I installed "GPioneer" 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 :)

Have a nice day!

author
yishaisilver8 (author)2015-04-09

What are the games that go on here?

author

Loved it super sonic cool

author
PiJuice (author)yishaisilver82015-04-13

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:

http://www.mame.net/roms/, I've found the best out of these to be "Star Fire". There's also plenty of websites offering tons of other advmame ROMs that you can find, but these are less legal.

author
JanoriaC (author)2015-09-27

Sorry but i cannot be nice when it comes to this project because it requires one thing that is STILL ON PRE ORDER..

thats right, one of the requirements for this, The "PiJuice". is still on pre order.

Sorry but Until such time as it comes out to public use, This is not going to be a nice comment.

author
Zolf (author)2015-05-06

put some retro pi and a raspberry pi 2 in there! 

author
Alicew4 (author)2015-04-20

Good work!

author
yosuf.harb (author)2015-04-07

is there a way to do this without having linux?

author
Istarian (author)yosuf.harb2015-04-09

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..

-- Transferring Files to the Pi

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: https://www.instructables.com/id/Transfer-file-fro...

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: http://marge.phys.washington.edu/software/SSH_Fil...

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.

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.

author
PiJuice (author)yosuf.harb2015-04-08

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.

author
Termagant (author)2015-04-05

Is there any particular reason you powered the Arduino off the TFT board instead of just running it to the Pi?

author
PiJuice (author)Termagant2015-04-08

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.

author
hobbyman (author)2015-04-05

Liked your design :) Once i also worked on something like this.

2012-09-22-11.12.27.jpg
author
PiJuice (author)hobbyman2015-04-08

Sweet! is that two player?

author
alex_the_creator (author)2015-04-03

Pretty cool :), love playing vintage video games. Can't wait to order it.

author
PiJuice (author)alex_the_creator2015-04-04

Hi Alex, glad you like it. The PiJuice module is actually available for pre-order if you go through the Kickstarter link.

author
Teodor2014M (author)2015-04-02

this is sikh

author
tmv22 (author)2015-03-26

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.

author
PiJuice (author)tmv222015-03-26

Hi tmv22, I believe the ROMs are the same. If they work on your PC they should work fine on the Pi.

author
albill (author)PiJuice2015-03-26

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.

author
tmv22 (author)albill2015-03-27

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!

author
PiJuice (author)albill2015-03-27

Oh, I wasn't aware of that, it makes sense though. Thanks albill!

author
Slime Eel (author)2015-03-26

Would this work with a different version of the raspberry pi?

author
PiJuice (author)Slime Eel2015-03-26

Hey, Yeah this will work fine on all raspberry pis!

author
grimcashew (author)2015-03-26

Marvelous

author
vulturestack (author)2015-03-26

Excellent

author
dirtspicy (author)2015-03-26

Thats fascinating...

author
quickspotty (author)2015-03-26

Thats brilliant

author
EvolvedAwesome (author)2015-03-26

I love the way this turned out! I also took a look at your guys kickstarter and IM <3ing what I see. Awesome Job guys!

author
shashwat.patkar (author)2015-03-24

Nice Project
Did you try putting retropie on it

author
PiJuice (author)shashwat.patkar2015-03-25

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 "old school" feel!

author
JavaProgrammer (author)PiJuice2015-03-25

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.

author
PiJuice (author)JavaProgrammer2015-03-25

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.

author
JavaProgrammer (author)PiJuice2015-03-25

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.

author
intru100 (author)2015-03-25

Super fun!

author
ShubhamS14 (author)2015-03-25

It's Amazing,.....

author
davidjohnson87 (author)2015-03-24

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..

author
PiJuice (author)davidjohnson872015-03-25

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.

About This Instructable

119,458views

964favorites

License:

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 LaptopRaspberry Pi Solar Weather StationRaspberry Pi Portable Games Console
Add instructable to: