The Piboy


Project Concept:

Take the original Game Boy and replace the internals with a Raspberry Pi. Set it up to work as a portable emulation station that can be played with USB SNES controllers. If you ony want to see the picture of this project, check out the gallery on imgur.


Tools:

  • Tri-Wing Screwdriver
  • Soldering Iron and solder
  • Dremel with cutting disk
  • Electrical Tape
  • Razor blade
  • Drill
  • Respiratory protection
    • Optional:

    • De-soldering tool
    • filing tools
    • clamp

Hardware:


This project was a gift for my older brother. We grew up playing Sega and SNES games together and after learning about RetroPie I knew it would make the perfect gift. My brother isn't the techie that I am so I didn't want to hand him a bare Raspberry Pi. The gift needed to be more user friendly than that. Since we both owned an original 1989 Game Boy, I decided to use the shell of the Game Boy to package the Pi.

Carving Space for the Hardware

My first challenge was opening up the Game Boy. Quite a few Nintendo products are put together with a special screw that requires a tri-wing screwdriver. I searched several local stores but ended up purchasing one of these screwdrivers on Amazon. Once the case was opened I needed to figure out how to fit the Pi into the Game Boy case. Any position required compromises. I decided to use the lower left corner of the case since it exposed most of the ports that I needed and since the corner was square I could mount the Pi right up next to two edges of the case. A Dremel and pliers helped remove the plastic that comprised the battery compartment and some surrounding things until the Pi could rest comfortably.

I needed to cut out most of the Game Boy circuit boards in order to fit the Pi. There were two important elements I decided to keep from the circuit boards: the red LED on the front PCB and the power switch on the back PCB. I also wanted to retain as much PCB as possible to provide structural integrity. I de-soldered components in my cutting path and Dremeled off what I didn't need. After I started cutting I realized that PCB dust is probably a little unhealthy. I did some research and, yeah... It turns out that PCB dust can be EXTREMELY CARCINOGENIC. If you decide to try this project, please invest in a mask with a filter for fine dust particles so you don't get Cancer and die.

Once the PCB was cut (and re-cut to fit the Pi better) I removed the Game Boy link cable port and some plastic from the front of the case in order to fit the end of a female Micro USB end for the power port. The cable that extended the power port was made of a Motorola Micro USB Adapter and a standard micro USB male connector. To make the cable, I simply found a good length for it and matched the colors of the internal wires. I also removed the rubber casing on the male end and shaved down the rubber on the female end to get the cable to fit better in the cramped case.

I finalized the placement of the internals, found appropriately sized screws, and mounted the Pi to the Game Boy case. To mount the Pi, I drilled pilot holes where the screws needed to go and used a screwdriver to get the screws through the plastic. The plastic is relatively soft, so the screws were able to create threads in the plastic. Putting nuts on the screws mounted the Pi solidly in the case.

The front of the Game Boy case didn't fit after mounting. The yellow RCA port on the Pi was hitting plastic that guided the speaker location and the A and B button locations. After a little trimming everything fit snugly. At this point I needed to decide how I actually expected my brother to use this little gaming machine and if access to the RCA video port and 3.5mm audio port was important. An Emulation Station could benefit from connectivity with TVs that don't have HDMI. However, most everyone has upgraded to flat panel TVs with HDMI inputs. I ended up drilling holes in the side of the case that allow for cables to be plugged into the Pi if the front of the case is removed. No effort was made to ensure easy access to these two ports.

Setting up RetroPie

With everything physically in place I could began to focusing on the software side of the Pi. My Raspberry Pi uses the RetroPie SD card image. I configured RetroPie by following the instructions found at supernintendopi.wordpress.com, which were incredibly helpful. I ran into a sound issue that I solved by following these instructions. Basically, in the file /boot/config.txt I needed to set hdmi_drive = 2 to force sound through HDMI.

In order for games to save properly via the RetroArch emulator, make sure there that in the ~/RetroPie/configs/all/retroarch.cfg file there is an uncommented entry for autosave_interval. I set mine to autosave_interval = 5 meaning that every 5 seconds the emulator will make sure that save files are updated. The save files normally update when the emulator is cleanly exited, but that doesn't always happen.

Also, I managed to purchase two slightly different SNES USB controllers that required different configurations in software. Player 1 and Player 2 required slightly different mappings in ~/RetroPie/configs/all/retroarch.cfg. The retroarch-joyconfig utility can be used to figure out how buttons are mapped. After proper configuration it's possible to completely control the Pi with a controller. Well, almost. There's no way to safely shut down without a keyboard or SSH.

Soldering and Circuitry

The red LED and power switch from earlier needed circuitry to interface with the Pi as I wanted them to. I used a multimeter to deduce the circuitry of the power switch. There are four easily accessible pins on the back of the switch that are connected in pairs of two. For example, if we number the pins 1,2,3 and 4, pins 1-2 are connected in the OFF position and pins 3-4 are connected in the ON position. The red LED required more effort to hook up to the Pi because it requires 5V power to light up bright red, and the GPIO pins max out at 3.3V. Thankfully, there's a few 5V power pins on the Pi so lighting up the LED only required an extra transistor and resistor. Initially I was concerned that I wouldn't have a good place to mount these pieces but the Game Boy PCB had 3-hole circuit elements that I de-soldered and replaced with my circuit. With the circuit wired up I could easily turn the LED on and off via Python scripts. As a side note, the Dupont wires I cut up and soldered to the PCB were just slightly too tall to fit in the Game Boy case so I ended up having to trim off a few mm of plastic in order to fit them.

Much like a power switch on a PC, my switch doesn't actually cut power to the entire device. Instead, a python script that I wrote detects when the switch is in the OFF position and runs the poweroff command. This safely shuts down the Pi and helps avoid SD card corruption. The script gets called when the Pi boots by a custom \etc\rc.local file. I originally attempted to use a cron job to run the script but the poweroff command didn't work. If you plan on using the Pi in any of your projects, take a look at the wiki pages for the RPi.GPIO python package. The switch can also turn the Pi back on by jumping pin 5 and ground on the P1 header as described by the documentation on RPI safe mode. Jumping those pins normally boots the Pi into safe mode, but I disabled safe mode by setting avoid_safe_mode = 1 in /boot/config.txt.

Giving the Gift of Game

This project was a gift for my brother, and with software and hardware finally working harmoniously I needed to work on presentation. I super glued the Game Boy buttons to the case and printed out a custom and personalized cutout for where the screen used to be. Wires were tucked and I screwed in the three remaining tri-wing screws, completing the project. Over Thanksgiving break I presented the Piboy to my brother and we relived a little bit of the past with Street Fighter II and Sonic. He had no trouble figuring out how to use the tiny console, though I may have to teach him how to use SSH one of these days.

comments powered by Disqus