close-circle
Close
0%
0%

Raspberry Pi 3 Gameboy

This is a DIY Raspberry Pi 3 gaming handheld running RetroPie to play all your classics!

Similar projects worth following
close
This is my very first DIY Raspberry Pi 3 gaming handheld running RetroPie to play all your classics like MAME, Nintendo Entertainment System (NES), SNES, Playstation, Gameboy Color/Advance, Nintendo 64, C64, PCengine, Final burn alpha, ScummVM, and even many many more I did not list yet! For more information, you can check out RetroPie themselves, they have everything you would like to know listed, and you can grab the latest image from there: https://retropie.org.uk/ . This project is not perfect by looks, but it is an Raspberry Pi 3 crammed into a classic aftermarket gameboy shell with additional features, like monitor the battery with a DIY arduino inside, a powerboost 1000c from adafruit to make it run off a battery for around 2 hours of runtime (and charging it with the powerboost). The input controller is a (Sparkfun) arduino leonardo pro micro which I programmed myself and hooked up with 2 psp 1000 analog sticks.

The retropie image was in my case the most appealing and most fun to work with. I have also tried alternative images like recalbox, lakka and some others. The reason I took retropie is that almost everything worked out of the box on the first startup, and to edit configurations if needed is easy to follow, which was important to me because I am less of a "linux guy", but it still is fairly easy to understand what is going on. The interface is nice and clean and easy to handle. So. I was so pleased by retropie and did have alot of fun playing, that an idea I had just totaly got me then. I wanted to put the setup I had on my desk, connected to my TV in some sort of handeld device. Then I saw it. A video of somebody cramming an raspberry pi zero into a gameboy shell. His name is known as "wermy", you can check out his build here:

Then there was no going back for me. I knew I had to build something like this! But I wanted to take it up a notch. A Pi Zero was not enough for me, so for extra beef and more features like wifi, bluetooth and more USB, integrated audio and much more, I decided to take my Raspberry Pi 3 for this project. Also, I about had in mind what games I definetly wanted to play on this, so I knew I needed more controls. So I thought about analog sticks, and was like "why not?". So I decided to take two PSP 1000 analog sticks to have one as sort of "main" stick and the other as additional sort or "control stick", sorta like the Nintendo Gamecube. So I took my old gameboy in my hands and thought where to best place them. So then I came up with a prototype sketch (sort of) I have made in photoshop and this is what it looked like:

Then I thought about what parts I needed to get to make this project and made a little list of parts I need. Eventualy, I had my parts list and tried to find everything on eBay, which I did, except for a (grey or black) gameboy case like you see above, for some reason I only found the transparent ones here in germany, so I went with a blue one, which is also fine. After the parts arrived one by one, I started building. (You can follow the build log). The end result is an awesome, fun handheld gaming console able to play back so many memories from my childhood with games like the original NES and SNES Super Mario bros. series, doom, tony hawk's pro skater, the Final Fantasy series, Ocarina of Time, and of course alot more from alot of various gaming systems, just to name some. It features an 3.5" TFT composite screen, an sparkfun leonardo pro mico which acts as a gaming controller pcb, original gameboy buttons, 2 PSP 1000 analog sticks, L1, L2, R1 and R2 buttons, an Adafruit Powerboost 1000C USB boost and charging PCB along with a cellphone battery which has 3.7V and 2500 mAh. The front button PCB is a pre-made commercial PCB gotten hold of from a store named kitsch-bent, you can check it out here for alot of gameboy accessories and spare parts: Kitsch-bent's store. The speaker is a gameboy advance speaker which is a bit smaller than the original speaker supposed to go in there, but it fits just OK as well and it has more beef and is clearer as the original. It is driven with an amplifier based on an PAM8403 chip. To regulate the volume, I also used an aftermarket "Gameboy" style wheel potentiometer, which then goes directly to the raspberry pi's audio output. I also put in an additional arduino uno (just the atmega328 chip with an 16 MHz quartz) which monitors the battery. If it drops to a voltage of 3.54 Volts, an red LED will light up, so the user knows they have around 10-15 minutes of playtime before the battery drops to 3.20 Volts and the arduino then safe-shutdowns the raspberry pi via GPIO. There is a tactile switch on the upper right, which is connected to the same GPIO pin so that you also can (and should) safe-shutdown the raspberry pi when you want to stop playing for now. If the user decides to plug a...

Read more »

Gamecontroller.ino

Main sketch for the sparkfun leonardo pro micro that is being used as game controller.

ino - 5.44 kB - 11/12/2016 at 00:56

download-circle
Download

DMG_4button_rev1_drill_template.pdf

Drill template for the additional X and Y buttons for the kitsch-bent common ground PCB used in this project.

Adobe Portable Document Format - 6.51 kB - 11/07/2016 at 23:31

eye
Preview
download-circle
Download

shutdown.py

This is the "safe shutdown" script that I use as a sort of "daemon" to run in the background on the Raspberry Pi itself to listen for a GPIO event from either the integrated shutdown switch in the upper right, or the arduino when the battery is empty. The script is written so that you need to hold the button for around 1 second to trigger the event, so you won't have an accidental suprise. (:

plain - 790.00 bytes - 11/07/2016 at 17:10

download-circle
Download

asound.conf

This is to combine both audio channels (left and right), because I only use one mono speaker.

conf - 364.00 bytes - 11/07/2016 at 17:10

download-circle
Download

SF32u4_boards-pre-1.6.zip

This is an additional library from sparkfun, which is used for my sparkfun leonardo pro micro. I use the arduino 1.0.5r2 IDE, so I have to use the pre-1.6 You can find the original file from here: https://github.com/sparkfun/SF32u4_boards/releases/tag/pre-1.6

Zip Archive - 727.98 kB - 11/07/2016 at 17:09

download-circle
Download

View all 8 files

View all 19 components

  • Adding the button PCB and the buttons

    sotasystems11/07/2016 at 23:17 0 comments

    All that is left out now are the front buttons. These are simply soldered to the leonardo micro, and that was it. As the sketch is already pre-programmed to work with buttons, no additional programming is neccessary. After that, I closed the gameboy and it was finished!

  • Adding a battery monitor with auto-shutdown

    sotasystems11/07/2016 at 22:59 0 comments

    I took an Arduino UNO, and turned it into a low battery indicator as well as an automatic safe-shutdown circuit when the battery is too low. For that, connected everything on a breadboard and used a lab bench power supply to simulate a battery and get my readings I needed. I got my voltages by recording a video of me playing on a full battery untill my battery was totaly flat, so I could see at what minutes it is safe to shutdown and 10 minutes before that it is safe to say that the battery is almost done for.

    My battery lasts for around 2 hours and 11 minutes in total.

    My readings are:

    Battery full: ~4.16 Volt (not needed, though)

    Battery low alert (red LED): ~3.54 Volt

    Battery empty, need to shutdown NOW: ~3.20 Volt

    After everything was working, I made my arduino smaller by just using the atmega as itself with a quartz, and a voltage divider as battery input and checked that everything works like that:

  • Gluing in the analog sticks and programming the leonardo pro micro

    sotasystems11/07/2016 at 22:26 0 comments

    I glued in the analog sticks and soldered the corresponding wires to them. I then wrote a program to turn the leonardo into a USB joystick with 14 buttons and two analog inputs and fiddled around a little to get my code working with those analog sticks.

    Also, to connect the pi to the leonardo later on, I took an cheap, broken µUSB cable, and got the µUSB part of it and soldered the wires coming from the pi to for easy plugging in:

  • Adding shoulder buttons

    sotasystems11/07/2016 at 22:17 0 comments

    I soldered 2 tactile switches to a small piece of perfboard, and then made another one for the other side. These will be my L1, L2, R1 and R2 switches. Afterwards, I glued them in and soldered wires accordingly.

  • Adding a safe shutdown switch

    sotasystems11/07/2016 at 21:40 0 comments

    Next up is to add a tactile switch in the upper right to make the pi safely shutdown when this switch is held for 1 second.

    the switch is closing GND to GPIO pin 37.

  • Wiring up the amp and heaphone jack

    sotasystems11/07/2016 at 21:31 0 comments

    Next up is the audio amplifier, speaker, potentiometer and the headphone jack

    The amplifier has to be modified a little bit in order for it to shut down when headphones are plugged in.

    For that, pin 12 needs to be desoldered from the board, and a wire soldered to it. It is the shutdown pin. We need to solder on a 10K or 20K pullup resistor to it and VCC, or the amp will stay off all the time:

    Then the potentiometer is wired to the pi, the amp and the headphone jack:

    And then I wired the speaker to the amp and glued everything in place:

  • Soldering on wires to the Pi and gluing it in

    sotasystems11/07/2016 at 20:58 0 comments

    I began soldering wires to the power input of the Pi, audio and video and soldered in 2 sets of 4 wires for USB. One will be used for the USB port, and the other for my leonardo pro micro:

    I then also soldered in a wire to a GPIO pin which will be used to safe-shutdown the Pi later. I later on moved it to another pin not shown in this picture, though.

    Then I finaly glued in the Pi in the cartridge slot, and the USB port also glued in:

  • Gluing in the screen and some components

    sotasystems11/07/2016 at 20:39 0 comments

    I glued in the screen in the place where it is supposed to go with it's controller (and a piece of paper underneath) and on top of that the powerboost with a piece of perfboard underneath to prevent shorts and the same for the power rail and wired everything up.

  • Making a small "power distributor"

    sotasystems11/07/2016 at 20:22 0 comments

    I made a small "power distributor" for easier hook up for devices that need power. It is wired directly to the

    powerboost's output. I made it out of perfboard:

  • Modifying the screen to work with 5 Volts

    sotasystems11/07/2016 at 20:09 0 comments

    The screen won't work with 5 Volts out of the box, so it needs to be modified a litlle.

    For that I soldered a wire to the power line and the 2nd pin of the power regulator IC and that does the trick:

    I then soldered on wires to test it out to the corresponding pins:

    And it works!

View all 14 project logs

  • 1
    Step 1

    1. Drilling first holes and test fit analog sticks

    Drill a hole in the center of your gameboy shell to fit the first analog stick (I used a 12mm drill and a file):


    If you are happy with it, do the same for the lower left for the second analog stick:

    Also, it is a good idea to drill the holes for the X and Y buttons NOW. I have included a drill template (DMG_4button_rev1_drill_template.pdf) for the X and Y buttons in this project which has the dimensions for the kitsch-bent common ground control PCB that we are going to use in this project.

  • 2
    Step 2

    2. Stripping down the Raspberry Pi 3

    In order to fit the Raspberry Pi 3 into the gameboy better, we have to strip it down (desolder IO's)

    For that I advice you to use at least a desoldering wick, a solder sucker, and a metal prying tool, and of course a little soldering skill is required for this step:

    I have used 350 °C on my soldering iron. Use the temparatures you are most comfortable/used with. At the end, you should end up with something like this:

  • 3
    Step 3

    3. Preparing the Mini USB breakout board

    The Mini USB breakout board doesn't fit in the original spot for charging the gameboy, it's just a little to bulky, so we have to trim it.

    For that I recommend using a hacksaw:

    Some pins might get cut off, but that is OK, because we can still use the ones near the center. To gain access to them, I recommend using a glass-fibre pen to scrape off the PCB's protective film and expose the copper, it's clean and easy:

    Test fit it again and file it if desired untill it fits fine. For me it looks like this:

    Also, as you can see there, I already have removed one data line with a knife. We have to do this for all remaining lines except 5V and GND (far left and far right), as we only need those and don't want to interfere with chargers that might get upset when connecting 5V or GND to the data lines.

    After that is done, you can solder on the wires to the 5V and GND lines:

View all 15 instructions

Enjoy this project?

Share

Discussions

Wojtek wrote 07/25/2017 at 04:51 point

is there any way to leave some usb ports and hdmi port ?

  Are you sure? yes | no

Perseveranze wrote 06/28/2017 at 08:05 point

I've been following your build for a couple days now, reading it all. I can't seem to find where you connect the 3 pin slide switch for on/off. Maybe I missed it? This is the only thing I'm missing form my build.

Thank you for an excellent build.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates