Introduction: $20 Portable Raspberry Pi Game Console

Picture of $20 Portable Raspberry Pi Game Console

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

Picture of 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, you can get a pre-built charger from adafruit.

Micro USB Breakout $1.50

This will be used for charging your console. If you order the Adafruit board 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

Picture of 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

Picture of 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

Picture of 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!

Note: Some users have been experiencing errors installing the PiTFT software. If the commands below do not work please try working through this step in the Adafruit tutorial.

1. Run the command:

curl -SLsk  | 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

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

cd rpi-fbcp/
mkdir build
cd build/

9. run cmake and make:

cmake ..

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

Picture of 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

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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

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


blabbersnitch made it! (author)2017-08-17

Finished! I couldn't have done it without this instructable. Thanks!

ShahilM (author)blabbersnitch2017-08-27

Wow! This is awesome! Could you please share the STL's and wiring, because I am really intrigued by this and would love to build something just like it.

blabbersnitch (author)ShahilM2017-09-07

I did a lot of customising, probably too much to put here in the comments section of Mach_5's instructable. But I am happy to share, so send me a personal message and I will get back to you that way.

DylanITech (author)blabbersnitch2017-10-06

This is amazing, would you pm me too?

blabbersnitch (author)DylanITech2017-11-21

Hi there. I only just saw your message regarding my Retropie build. I think emails from this site must be getting treated as spam by my mail server.

Anyway, let me know if you are still interested. I will send you some notes/stl/drawings to get you started... and then whatever you need to get you finished.

Happy to share.

Best to email me on


daraghfi (author)2017-06-24

Raspberry Pi Zero W: after following RetroPie instructions with latest packages, everything looks good. However, after going through these instructions (including the cmake gotcha), the wifi is no longer available as a device. As in, the configuration tools don't see it, and wlan0 no longer exists. Help!

We will assume some type of version compatibility issue, but could really use a pointer to get this working - thanks in advance.

CherieT1 (author)daraghfi2017-10-06

same problem here :\

also for me... for some reason, the controls only work in emulation station, not in ROMs. Anyone have any idea how to fix this?

thisdudeyaaaaaa (author)2017-09-21

if someone could build this, with a better battery, I would be willing to buy it for 30$

the SD card loaded with retropie set up for this

grant14145 (author)2017-09-18

I was wondering if you could also get extra buttons to make top buttons like L and R and wear would you put them on the board

bjrocket141 (author)2017-08-02

what if i have a SpotPear XPT2046 2.4" lcd? How would I use that for RetroPie? Thanks!

arshkhyan (author)2017-07-20

what power switch do i use becasue it is not listed

also in which position do i put the switch becasue it is not shown in the picture

Kreeperface23 (author)2017-04-22

when i type in the command for step four it says

E: Invalid operation adafruit-pitft-heplper

Mach_5 (author)Kreeperface232017-05-08

Hello! I believe Adafruit changed the way their TFT software works since I built my console. Try working through this step in their guide.

blabbersnitch (author)Mach_52017-07-18

Yes. I used this and it worked (for the benefit of others reading this). The webpage is slightly dated (the options presented were slightly different to what I saw).

I chose the manual options (option 4), then:

PiTFT screen: 2.2 - 3.2 resistive (option #2)

HDMI rotation: landscape (option #1)

Display orientation: 90 degrees (option #2)

please help

SamuelG117 (author)2017-05-24

how would i go about adding sound?

blabbersnitch (author)SamuelG1172017-07-18

You can get the audio from the out of the RPi Zero. I used this guide at Adafruit:

It describes how to assign the audio PWM outputs to GPIO pins that are present on the Zero. Read from ‘Changing GPIO ALTS’

I changed pins 32 & 33 (GPIO12 & 13) to ALT0 mode, which reassigned them to PWM audio outputs.

There is a handy ground connection at pin 34. I suggest you also install their WiringPi/gpio software as it provides a way to see what your inputs/outputs are doing.

Once I had the PWM outputs at pins 32 & 33, I summed them into a filter and fed that into a small amplifier. I used one similar to this:

and fed that into a speaker from I pulled from a broken kids’ toy.

I didn’t test as suggested at Adafruit, I just played a game and enjoyed the sweet 80’s arcade music coming from it :-)

12765905 (author)SamuelG1172017-06-07

currently rasberry pi zero doesnt support sound

YouriM (author)2017-01-04

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 "curl -SLs | sudo bash", it says I could not resolve the host. Could you please explain what I have to do next?

HarperN2 (author)YouriM2017-07-07

you just had a little typo on the command. type "SLsk" instead of "SLs" and also make sure to put "https" instead of "http"

YouriM (author)HarperN22017-07-08

Ahh, thank you very much.

HarperN2 (author)2017-07-07

My display is working fine, except for when I play a game it freezes,which is weird because when I have it hooked up to a regular monitor side by side, I can see that the game works just fine, but for whatever reason on the small display it gets stuck at "press a button to configure". Please help! Thank you :)

3dprintenbp (author)2017-01-25

My problem is i cannot do the make step after cmake. It says: "No targets specified and no makefile found. Stop."

HarperN2 (author)3dprintenbp2017-07-07

write "cmake .." instead of just "cmake". Hope this helps :)

SamuelG117 (author)2017-06-23

can you get the lcd to work without a wifi dongle or having the wireless zero?

SamuelG117 (author)2017-06-13

you didn't say, where you got your buttons from. i have some buttons from an arduino kit but they are very stiff

Glo0my (author)2017-05-18

Great tutorial! In fact i already built one for me and it works just fine! But i'm working on a four buttons version now (A,B,X,Y) and when i try to add new pins by modifying the retrogame.c file then make and reboot retropie doesn't recognize the button at all and i have to reload the img to solve the problem. Do you have any ideas to solve it? ( i add { 35, KEY_H }, between to existent line)

Mach_5 (author)Glo0my2017-05-18

GPIO35 doesn't exist, try GPIO19 if you connected to pin 35.

Glo0my (author)Mach_52017-05-19

Dammit i think i was tired. I changed it and also add the same line with GPIO 13 and it works perfectly. Thanks!

michaeldsalves (author)2017-04-22

Can I use another screen (3.5")? If yes, need change something else?

WoodrowC1 (author)2017-04-11

:thumbsup: Nice work!

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?


sammytheseal1 (author)2017-03-28

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?

CHRONO77 (author)2016-12-09

hey hope someone can help me im stuck on

9. run cmake and make:

make: *** No targets specified and no makefile found. Stop.

run cmake works but then i try to run make and come up with this ^^^

AaronJ66 (author)CHRONO772017-03-17

I had the same problem and it took me much longer than id like to admit, but run 'cmake ..' instead of just 'cmake'

Mach_5 (author)CHRONO772016-12-09

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.

ashpepe (author)Mach_52016-12-19

hello. i tried this after same make error i get a splash screen boot up then white screen? any ideas?

CHRONO77 (author)Mach_52016-12-09

will try thank you :) for you awesome fast response !

3dprintenbp (author)2017-01-24


I have setup the LCD but can only view the screen on the desktop not on emulationstation. Do you know the fix for this?

Thanks in advance

AlexR332 (author)3dprintenbp2017-01-24

Im having the same problem. it would be nice if he could answer this

3dprintenbp (author)AlexR3322017-01-25
Mach_5 (author)3dprintenbp2017-01-25

Yes, as I linked it in step 4 of my guide.

3dprintenbp (author)AlexR3322017-01-25

I got it working

3dprintenbp (author)AlexR3322017-01-25

Yeah i don't know how to fix this have spent hours looking for this problem.

BenjaminP89 (author)2017-01-18

Where do I buy the buttons? Can I make a case from wood?

AlexR332 (author)2017-01-17

Hi i have a question.

1/ would a RAspberry pi a+ work with this display

2/ how can (or can i even) change the case model so that it would fit the display and not mess up anything.

thank you

GlenP19 (author)2017-01-07

is anyone else not able to get the power shutdown switch to work?

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

section-80 (author)2016-12-09

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

where do i connect this switch?

Mach_5 (author)section-802016-12-10

The power switch isn't connected till step 8 ( but you can solder it into place in step 5

ashpepe (author)2016-12-08

will your charging pcb on tindie work with the adafruit power boost basic?

About This Instructable




Bio: Aspiring entrepreneur teaching myself engineering
More by Mach_5:TyroBot: DIY Humanoid Robot$20 Portable Raspberry Pi Game ConsoleBuild your own Home Automation and Monitoring System
Add instructable to: