There are tons of Raspberry Pi retro game emulators around on the internet, but most are quite expensive. With the new $5 Raspberry Pi Zero, in this Instructable I am going to show you how to build a completely portable battery powered Retro Game Emulator for $20.

In order to build the console in under $20, we will be using cheap Chinese parts and custom circuitry. If you are completely new to electronics and Raspberry Pi, you may have a hard time with this project and spend over $20 on replacement parts. Some surface mount soldering is also required, but if you are not comfortable with SMT components you can buy a pre-built board and make the console for $25.

Here is how the console is going to work:

A Raspberry Pi Zero running RetroPie will drive a cheap 2.4in ILI9341 SPI TFT. 9 SPST push buttons are used for input: four for the D-Pad, four for functions, and one button is used as a power off button. The whole unit is powered with a single cell lithium ion battery, either a 14500 cell or a old cell phone battery. a Cheap boost converter ups the battery voltage to 5V so it can be used by the Pi, and a MCP83731 battery charging circuit is used to do just that, charge the battery. Everything is safely enclosed in a two part 3D printed case.

Step 1: Gather Materials

Lets go over the parts you are going to need to purchase to build your console.

Raspberry Pi Zero $5

The cheapest, smallest Raspberry Pi yet, perfect for this project. Pick one up on Adafruit, Element 14 or Ebay.

2.4in 240x320 ILI9341SPI TFT Display $5.88

Cheap and easily interfaced with the Raspberry Pi. Good Quality and performance. Buy Here.

Lithium Ion Battery 14500 cell $0.99

These are practically the cheapest rechargeable batteries available. They claim to have a capacity of 1200mah, but that is bogus. My tests show around 400mah. One of these will give you about an hour of playing time. If you have an extra $10 go for one of these. Battery life will increase by a factor of 4. Or, if you have a old cell phone with a 3.7V lion battery in it, use that, and make your console $19. Or, if you are willing to make the console larger, wire a multitude of these batteries in parallel.

Prototyping Board $1

You will need about 7x9cm of perfboard, I got mine on ebay for $1.

Charging Circuit $3

To charge your dirt cheap batteries you will need a charging circuit. Check out my list on Mouser. You will also need a SOT-23 breakout board for the charger IC. If you do not have the skills required to build a board from a schematic or solder a SOT-23 component, I built a custom board you can buy on Tindie, but it will cost an extra $5. Purchase it here.

Micro USB Breakout $1.50

This will be used for charging your console. If you order my custom board above this part is not necessary. Buy here.

3V to 5V DC-DC Step Up Boost Converter $1.50

This is used to boost the battery voltage to a voltage usable by the Raspberry Pi. Buy Here.

Total Cost: $19.86

You will also need some wire, basic soldering tools, and the required adapters and dongles required to setup the Pi Zero. Most people already have this stuff so no extra cost.

Step 2: Install RetroPie

Lets begin this project by installing the emulation software onto the Raspberry Pi. We will be using RetroPi.

1. Start by flashing RetroPie to your SD card. You can down load the image that works with the Pi Zero here.

2. Plug in the SD card, and temporarily connect a HDMI screen and USB keyboard to the Pi Zero. If you have a USB hub use it and also connect a WiFi adapter.

3. Plug in a micro USB power supply and let the Pi boot up. It should display linux terminal messages, display the Retro Pie splash screen, reboot, display the splash screen again and then open up emulation station.

4. Press F4 to skip the gamepad setup.

5. We can now change the default settings with:

sudo raspi-config

6. Go down to advanced options and:

  • disable overscan
  • enable device tree
  • Enable SPI plus load kernel module by default
  • Also enable SSH.

7. Reboot the Pi.

8. After the Pi reboots, temporarily assign the first few controls:

  • D pad to arrow keys
  • A to left control
  • B to left Alt
  • Start to 1
  • Select to 5

9. Once your in the main emulator select screen, go to "Retro Pie" and setup WiFi. If you have a WiFi adapter connected, you should now have access to the internet. If you don't, just continue on.

10. Shutdown the Pi and remove the keyboard and HDMI display. Instead, connect a WiFi Dongle. Turn on the Zero and connect to it via SSH.

If you don't have a USB hub or Micro HDMI to HDMI adapter, you can configure the Retro Pi image on a Raspberry Pi 1 or B+, and then move it to the Raspberry Pi Zero once the controls are mapped and the Pi is connected to the internet.

Step 3: Setup the TFT Display: Hardware

Now lets add a display. We will be using one side of female jumper wire to connect the the screen, and bare wire soldered onto the Pi Zero. Use the images above as a reference.

1. Connect VCC on the TFT to pin 2 (5V) on the Pi.

2. Connect GND on the TFT to pin 6 (GND) on the Pi.

3. Connect CS (chip select) on the TFT to pin 24 (GPIO8) on the Pi.

4. Connect RESET on the TFT to pin 17 (3.3v) on the Pi.

5. Connect DC on the TFT to pin 22 (GPIO25) on the Pi.

6. Connect SDI (MOSI) on the TFT to pin 19 (GPIO10) on the Pi.

7. Connect SCK on the TFT to pin 23 (GPIO11) on the Pi.

8. Connect LED on the TFT to pin 1 (3.3v) on the Pi.

9. Connect SDO (MISO) on the TFT to pin 21 (GPIO9) on the Pi.

Step 4: Setup the TFT Display: Software

Now that the TFT is connected to the Zero, we can install the TFT kernel and test it out.

This step of the Instructable is based on this Adafruit Guide. Thanks Phillip Burgess!

1. Run the command:

curl -SLsk https://apt.adafruit.com/add-pin | sudo bash

2. Update:

sudo apt-get update

3. Install new bootloader:

sudo apt-get install raspberrypi-bootloader

4. Install TFT scripts:

sudo apt-get install adafruit-pitft-helper

5. Run helper script:

sudo adafruit-pitft-helper -t 28r

6. When you are asked if you want a console on the PiTFT, select no. Select yes for using GPIO 23 as a power button.

7. Now we can install fbcp for the display. Start by downloading it:

git clone https://github.com/tasanakorn/rpi-fbcp

8. Go into the directory and then create a build directory:

cd rpi-fbcp/
mkdir build
cd build/

9. run cmake and make:


10. And finally install it:

sudo install fbcp /usr/local/bin/fbcp

11. Now lets make fbcp start upon boot.Open up the file:

sudo nano /etc/rc.local

and add the line below right before "exit 0"

/usr/local/bin/fbcp &

12. Finally open up /boot/config.txt with:

sudo nano /boot/config.txt

Uncomment these three lines:


Edit the pitft line to this (just changing the speend and fps)


and add this line:

hdmi_cvt=320 240 60 1 0 0 0

Step 5: Setup the Buttons: D-Pad, A, B, X and Y

Once the screen is up and running, we can continue on to the buttons. This portable console uses 10.

1. Start by placing four buttons in the D-Pad formation on the perfboard as shown in the images above.

2. Bend one terminal of each button to each other to create a ground rail. Solder them all together.

3. Anchor the remaining 4 pins with solder.

4. Take a 5 wire ribbon cable and solder one wire to each anchored pin plus one to the ground rail.

5. Using a Dremel tool or a small saw, cut around the buttons. Leave clearance for mounting holes.

6. Solder the Ground wire to Ground on the Pi Zero (pin 9 using the board layout)

7. Solder the UP key to pin 11 on the Zero (GPIO17)

8. Solder the DOWN button to pin 12 on the Zero (GPIO18)

9. Solder the LEFT button to pin 13 on the Zero (GPIO27)

10. Solder the RIGHT button to pin 7 on the Zero (GPIO4)

With the D-Pad complete, we can begin work on the function buttons. they are in the exact same layout as the D-Pad, but instead of a D-Pad part over it, we have four individual buttons.

11. Start by doing steps 1-6 above to make a second button board.

12. Solder the A button to pin 40 (GPIO21)

13. Solder the B button to pin 38 (GPIO20)

14. Solder the Start button to pin 37 (GPIO26)

15. Solder the Select button to pin 36 (GPIO16)

Now that the buttons are connected, boot up the Pi and open an SSH terminal.

1. Start by downloading my modified version of Adafruit's Retrogame software:

sudo git clone https://github.com/spadgenske/Adafruit-Retrogame

2. Next, open the startup file:

sudo nano /etc/rc.local

3. Before the exit 0 line and the line you inserted in the previous step, add the line:

/home/pi/Adafruit-Retrogame/retrogame &

Save the file and reboot, and now your buttons should act just like your keyboard!

Step 6: Setup Power Button and Low Battery LED

Now we can add a power button and a LED to warn us when the battery is getting low. This is pretty simple:

1. Connect a leg of the button to ground.

2. Connect the other leg of the button to pin 16 (GPIO23)

3. Connect the positive leg of an LED to pin 15 (GPIO22)

4. Ground the other leg of the LED through a 470ohm resistor.

5.Solder in a SPDT switch for power. We will make connections to it later.

Step 7: Build the Battery Charging Circuit

This is the hardest step in the build. If you are not comfortable with reading a schematic or surface mount soldering, you can purchase a PCB with it all done for you on my Tindie store, but it will increase the cost by $5.

1. Purchase the necessary components. You will need:

  • 1x 470ohm resistor
  • 1x 2k resistor or 2 1k resistors
  • 2x 4.7uF Capacitors or 1 10uF cap
  • 1x LED
  • 1x MCP73831/2 Battery Charge Controller (SOT Package)
  • 1x SOT-23 Breakout board
  • some .1" headers

If you order from Mouser, here are the part numbers.

Follow the schematic in the image above to build your charger. To test it out, connect a 3.7v lipo to the battery in, and 5v to VCC. The LED should come on, charging your battery. When the LED goes out, the battery is fully charged.

This schematic and the board mentioned above are Open Hardware. You can get the KiCad files here:


Step 8: Building the Power Circuit

Now we can finish up the electronics by building the power circuit.

1. Connect the negative terminal on your battery to GND ("-") on your charging circuit and the - IN terminal on the boost converter.

2. Connect the positive terminal on your battery to VBAT ("+") on the charging circuit. Also connect it to one terminal on the power slide switch.

3. Connect the other terminal of the slide switch to + IN on the boost converter.

4. Connect VCC on the micro usb breakout to 5V on the charging circuit.

5. Connect GND on the charging circuit to GND on the micro USB breakout.

6. Connect + OUT on the boost converter to 5V on the Pi.

6. Connect GND on the boost converter to GND on the Pi.

Step 9: 3D Print Enclosure

The electronics will all fit in a two part 3D printed enclosure. I printed them out in ABS on my Lulzbot Mini, but they can be uploaded to 3D Hubs or Shapeways if you don't have a 3D printer, but will put you well over the $20 budget.

If you would like to modify the models, a variety of formats are on my Github:


Step 10: Putting It All Together

1. Lay the battery under the Pi standoffs if you are reusing a cell phone battery, or place the cylindrical cell between the Pi and the wall on the left side.

2. Hot glue the charger circuit to the right side.

3. If you are using the cylindrical cell, hot glue the boost converter under the Pi. Otherwise hot glue it on the left side.

4. Screw in the Power switch row with M2.5x 3mm machine screws.

5. Screw in the Micro USB breakout with M2.5x3mm machine screws.

6. Screw in the Raspberry Pi with M2.5x6mm machine screws.

7. Place the 3D printed button inserts in their holes.

8. Screw in the function buttons.

9. Insert the 3D printed D-Pad

10. Screw in the D-Pad buttons with M2.5x6mm screws.

11. Screw in the TFT display with M2.5x6mm machine screws.

12. Carefully screw both halves together with 4-40 machine screws.

If you are using my pre-built charger circuit instead of making one yourself, skip step 2, and instead of step 5 screw the charger circuit in the Micro USB breakouts place with M2 screws.

Your portable retro game console is complete! Feel free to contact me for help or suggestions.

<p>when i type in the command for step four it says</p><p>E: Invalid operation adafruit-pitft-heplper</p>
<p>Can I use another screen (3.5&quot;)? If yes, need change something else?<br></p>
<p>:thumbsup: Nice work!</p><p>Im surprised you didnt use something like a 2800mah battery bank stick for the charging / battery for the unit. You can get them on ebay for like $2?</p><p>(http://www.ebay.com/itm/Portable-USB-External-2800mAh-Battery-Charger-Power-Bank-fo-Cell-Phone-RED-/112361607073?hash=item1a29460fa1:g:S7sAAOSwnbZYFDUN)</p>
Hello, I want to add a USB port, headphone jack, and a HDMI port for hooking up to the TV. Anyone know how to do that?
<p>hey hope someone can help me im stuck on</p><p> 9. run cmake and make:</p><p>make: *** No targets specified and no makefile found. Stop.</p><p>run cmake works but then i try to run make and come up with this ^^^</p>
<p>I had the same problem and it took me much longer than id like to admit, but run 'cmake ..' instead of just 'cmake'</p>
<p>Since there is no makefile, that does mean the cmake command didn't work. Are you in the build directory? I also see Adafruit changed their guide. Maybe try their auto script with the PiGRRL 2. <a href="https://learn.adafruit.com/running-opengl-based-games-and-emulators-on-adafruit-pitft-displays/pitft-setup">https://learn.adafruit.com/running-opengl-based-ga...</a></p>
hello. i tried this after same make error i get a splash screen boot up then white screen? any ideas?
<p>will try thank you :) for you awesome fast response !</p>
<p>Hi Mach,</p><p>I'm very keen to make this as my second project, and want to buy two of your custom boards for the charging circuit. My skill level is novice and just reading the steps... I'm stuck on Step 6. <br><br>&quot;4. Ground the other leg of the LED through a 470ohm resistor.</p><p>5.Solder in a SPDT switch for power. We will make connections to it later&quot;<br><br>How does it look at the back of the board?</p><p>Sorry if this is a very stupid question, I'm new to this haha.</p><p>How do I use your custom board too?</p><p>For step 8, how do I connect one thing to two things? like: </p><p>&quot;Connect the negative terminal on your battery to GND (&quot;-&quot;) on your charging circuit and the - IN terminal on the boost converter.&quot;<br><br>Do i do this? <a href="https://www.instructables.com/id/Soldering-multiple-wires-for-a-distribution-joint/" rel="nofollow">https://www.instructables.com/id/Soldering-multipl...</a></p><p>Thanks!</p>
<p>Hi, </p><p>I have setup the LCD but can only view the screen on the desktop not on emulationstation. Do you know the fix for this?</p><p>Thanks in advance</p>
<p>Im having the same problem. it would be nice if he could answer this</p>
<p>Buddy i think i have found the solution.</p><p><a href="https://learn.adafruit.com/running-opengl-based-games-and-emulators-on-adafruit-pitft-displays/pitft-setup" rel="nofollow">https://learn.adafruit.com/running-opengl-based-games-and-emulators-on-adafruit-pitft-displays/pitft-setup</a></p><p>Follow this it helped my out</p>
<p>Yes, as I linked it in step 4 of my guide.</p>
<p>I got it working </p>
<p>Yeah i don't know how to fix this have spent hours looking for this problem.</p>
<p>My problem is i cannot do the make step after cmake. It says: &quot;No targets specified and no makefile found. Stop.&quot;</p>
<p>Where do I buy the buttons? Can I make a case from wood?</p>
<p>Hi i have a question.</p><p>1/ would a RAspberry pi a+ work with this display <a href="https://www.amazon.ca/gp/product/B01CQIPEO0/ref=ox_sc_act_title_7?smid=A3IRH1M32QHQ71&psc=1" rel="nofollow">https://www.amazon.ca/gp/product/B01CQIPEO0/ref=ox...</a></p><p>2/ how can (or can i even) change the case model so that it would fit the display and not mess up anything.</p><p>thank you </p>
<p>is anyone else not able to get the power shutdown switch to work?</p><p>I installed the image a few times, but it seems like the command to set up the display that asked if I wanted to assign the GPIO for the shutdown command fails. like the dir does not exist...but i followed each step...did this work for anyone else? I got the keyboard to work...and the SPI screen...but not from the instructions here. I had to follow another scrip to get the spi screen to work..I am sooo close here.. but would like a key press to do a safe shutdown..</p>
Hey Mach_5! First of all, it's a great instructable: very detailed, well explained, etc. Though I have a problem setting up the screen. When I type in the command &quot;curl -SLs http://apt.adafruit.com/add-pin | sudo bash&quot;, it says I could not resolve the host. Could you please explain what I have to do next?
<p>5.Solder in a SPDT switch for power. We will make connections to it later.</p><p> where do i connect this switch?</p>
<p>The power switch isn't connected till step 8 (<a>https://www.instructables.com/id/20-Portable-Raspbe...</a> but you can solder it into place in step 5</p>
will your charging pcb on tindie work with the adafruit power boost basic?
<p>Yes it will work just fine. You could also use the powerboost 500c, and my charger circuit is unecessary. </p>
<p>I dont find any <strong>Raspberry Pi Zero at $5 </strong>on ebay :/</p>
<p><a href="https://www.adafruit.com/products/2885" rel="nofollow">https://www.adafruit.com/products/2885</a><br><br>this is where i ordered mine from as well as several other parts, hope this helps you<br><br>yours truly,<br>Eternal Link</p>
<p>Also wanted to post https://www.youtube.com/watch?v=E12CRrtb6po this here, very insteresting. If by any means sharing this is not allowed feel free to delete the comment.</p>
<p>Why don't you just sell all the parts together? So is easy for us. And we can buy them from you and you make some profit in the way.Will the charger you sell work with a galaxy s4 battery? is 3.8V and 2600 mha</p>
<p>The charger should work with the S4 battery as long as it is lithium ion. I have been considering selling a complete kit, but don't think their is quite enough demand, plus I would have to charge more. The charger should work fine with the Pi 3, but the DC-DC boost converter may not (It *should* work, but the Pi 3 draws more current and I can't guarantee success). If it doesn't work this is a good replacement option: <a href="https://www.adafruit.com/products/1903">https://www.adafruit.com/products/1903</a> </p>
<p>Thanks for answering. Yes, is Li-ion battery. You never know how much demand something has until you tried. And if you can build one for $20 Imagine what you can do with $50.... Neverless I think the sweet spot is $50. I mean $50 dollars to have all the consoles prior to n64 in your pocket. Fry meme ritght there, shut up and take my money. </p>
<p>Can the charger also power a pi 3 b?</p>
<p>hi i am testing it on a bread board first and the screen and buttons work perfectly but when i enter a game such as super mario or pokemon nothing happens when i press the start button or any other button? i have followed all instructions for the buttons. is there something i have done wrong?</p>
<p>I had the same problem. I found this problem after I had put everything together (the everything was in the case)</p><p>I solved it by reimaging the sd card and using the buttons on the device for the first mapping.</p>
<p>could you add 2 more buttons or bumpers</p>
<p>also how would i make the ports accessible to add a usb headphone jack and access the hdmi to plug it into a tv.</p>
<p>could you add two more buttons or bumpers</p>
Hi! I have some questions<br>1. Can u put videos in it, or do we need to use other model of raspberry pi to do it? as a video player. thanks
<p>You can play videos on the SPI display, but it is kinda small and I don't know what software you would use for navigation.</p>
<p>Kodi would work pretty well.</p>
<p>ok thankyou bro!</p>
<p>Can i use one of these [https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/TP4056.pdf] as a charging circuit? Ive got a couple of them lying around, all of them are set to 1000 ma output to the cell.</p><p>Also, i want to use an old controller i have laying around, its a fake ps2 controller for pcs, it connects via usb. can i just connect it per usb and not worry about any of the software that makes the controls in your build function or would i have to connect everything per gpio and adjust the software you used? if you dont want to waste too much of your time just tell me wich one it is, ill figure out the rest by myself ^^</p>
<p>The charger chip will work just fine as long as you use lithium ion batteries, assuming your following the Typical Applications schematic on page 3. A USB controller will work just fine you just need to map the buttons differently in RetroPie.</p>
<p>Thanks for the tuturial. Am busy with the same parts but got stuttering gaming quality. Couldn't found out what it was until I found your tutorial! Thanks for that. One thing though, maybe it's a good idea to name the display somewhere in the parts list &quot;ILI9341&quot; so that other people can find this tutorial on the web when searching for info on that display.</p>
<p>I want to create <strong>X,Y</strong> button. Can you help me ?</p>
<p>will the display only work with the zero? io tried the pi 2 with no succesful screen</p>
<p>It should work with the Pi 2, maybe double check the connections. You also may have a defective screen.</p>
It displays the console when i say yes to displaying it. But nothing but black screen if i say no. So the screen works, but just not displaying it.. ill try again with raspi zero i guess :/<br><br>
<p>Hi Mach_5, I built as instructed and my function buttons were assigned as stated. The a, b, select and start work in emulationstation, but once I get into the game, (tried snes super ghouls and ghosts) the function buttons don't work. Can't even get out using vulcan nerve pinch and have to reboot from putty. I checked the retrogame.c script and the gpios are assigned to the correct buttons, and check my button connections to proper pins and ground, so I am thinking it is a config issue. Any thoughts? Thanks. </p>
<p>I'm having the same issue, I've gone through and set every button and in the config they work but going into any game on any emulator there is no response from any of them</p>

About This Instructable




Bio: Aspiring entrepreneur teaching myself engineering
More by Mach_5:$20 Portable Raspberry Pi Game Console Build your own Home Automation and Monitoring System Build Your Own Smartphone 
Add instructable to: