Hi all! After being a long-time browser of this site I decided it was time to publish my first Instructable. I'm very much into all things retro-gaming. I've built a full-size virtual pinball running Hyperspin which may well be my next Instructable. I'm also in the process of upgrading an early 90's Final Lap driving cabinet to be a multi-game machine.
Here I will show how I gutted an old non-working Nintendo Gameboy original, and fitted these parts instead:
- 3.5" 320x240 LCD with driver PCB
- Raspberry Pi (Model A)
- custom built button PCB
- 1x 18650 Li-Ion cell
- USB Li-Ion charger board
- 3.7V to 5V DC-DC converter board
- stereo audio amp board
- stereo speakers
I've seen other Instructables doing a similar thing, but I set myself a few challenges and desired features of my build which include:
- Fitting the Pi with little or (ideally) no modification
- Have the Pi's USB port and HDMI port remain accessible
- Have the SD card hidden away but also easily accessible
- Retain analogue control of volume
- Retain normal functions of all front buttons, also make it easy to add buttons if the need arises
- Upgrade sound with internal stereo speakers
- Have major components unpluggable (ie. not have all things hard-wired to each other)
- Retain some kind of visible power LED and charge status LEDs
- Have the Gameboy case fit back together cleanly but very securely
- Achieve a good run-time per charge, around 2hrs+
In the end I think I achieved all these goals. Initially I wanted to fit 2x Li-Ion cells but there just wasn't enough room for that 2nd cell.
I had enough experience with Raspian/Raspbmc to know how to get the Pi up and running with RetroPie. I was new to EmulationStation though. I also had not previously dealt with the GPIO pins on a Pi. But I soon discovered how useful these pins are and that it would be possible to control not only the games but also navigate EmulationStation menus as well. Each button grounds a certain GPIO pin, then software makes that action produce a keystroke, as defined in a config file.
Anyway, on with the mod!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Figuring Out How Everything Will Fit!
After checking other Gameboy mods on the internet, I decided none were done in a way that would allow me to achieve the results I was after. I spent a LOT of time juggling the Pi's position in the Gameboy case. I had to be sure it was going to fit in a way that would allow room for the LCD and it's driver board. Of course I only had one shot at modding the case and if I made a major error in my judgement of how things would fit, then the case would be toast.
So I finally decided to cut the rear case as seen in the photo where the cut lines are drawn. The single USB port would be at the top with solder side of the Pi facing the front, and the HDMI port would be along the left side where a new hole would have to be cut for it. I ended up removing the battery compartment completely, as it was just not needed anymore, but I cut it out in a way that allowed the battery cover to go back on and clip in as normal. This orientation of the Pi has the SD card at the bottom, conveniently positioned in the old battery compartment area.
I could have removed the audio and composite video ports from the Pi but as it turned out the video port did not need to be removed. As can be seen in one photo, I did cut away some case plastic to make room for the audio port so that the Pi would sit flush. At that stage I planned on plugging a cable into the port to get the audio but I ended up just soldering a 3pin header on the back of the Pi to get audio out. In hindsight I should have removed the audio port and not cut the case around it as that would have looked better.
The front opening for the LCD obviously had to be made bigger so that all of the 3.5" LCD could be seen. This was done with a Dremel-style cutting tool and needed a steady hand. Everything in the upper front part of the case had to go to make room. The LCD would eventually by stuck in place with very stick double-sided tape salvaged from a broken all-in-one printer/scanner (it held the scanner glass in place). By cutting thin strips of this tape and lining the metal surround of the LCD with it, it stuck in place very firmly.
Step 2: Trimming the LCD Driver Board
The type of LCD (from one of the many sellers on that popular auction site) was chosen based on the fact I had seen another Instructable use it for this purpose. The one I used was called: 3.5" TFT 320 * 240 Color Screen Car Rearview Monitor For Reversing Camera DVD. I've included a picture of one. There were two problems using this LCD. I'll list them here along with the solutions.
1. It's designed to run off 12V and I needed it to run off 5V. This was pretty easily solved by just attaching 5V to the point on the circuit where it is generated on-board. I found a point on the board that had 5V while running normally off 12V and then removed parts not needed up until that point. I made the mistake of removing the 'large' inductor near the 12V input. With external 5V attached, the LCD would not fire up along with the Pi. But when the inductor was replaced it worked fine.
2. The main board driving the LCD is about 10mm wider than the internal width of the Gameboy. So I looked into how this could be trimmed off the board to make it fit yet not destroy it in the process. Call it sheer luck but as can be seen in the photo I was able to remove exactly enough off each side as well as a few components and the 3 pushbuttons. One photo shows exactly where the sides were trimmed down to, another shows it sitting in place behind the LCD.
Another thing to note about this particular LCD is that it's almost like the manufacturer was supplied with the wrong driver board: the white flat cable visible is actually an extension to the cable from the LCD itself. This white cable is about 8cm long and gave me the ability to position the driver board exactly where I needed it to be.
The video signal was connected using a short length of thin coax cable. This was soldered at GND and AV1 on the driver board. I fitted a 2-way header connector to the other end and soldered a matching 90° header on the back of the PI at the video socket. I fitted it at an angle so that the connector would not interfere with the volume control.
Step 3: Making a Replacement Button Board
By removing all the Gameboy electronics, I now had no physical switches for each of the 8 front panel button. So I had to effectively create a mini-keyboard that would go in place of the original board. This would need 9 wires (8 button connections + common GND) to go to the Pi's GPIO port. I was originally going to just solder wires to the GPIO pins but found in my junk drawer an old PC back plate that had a parallel port going to a 26pin header connector. Perfect! I just had to remove the top part of the header plug which made it exactly the right height, and drill out the 26th pin which was filled in with plastic so it could not be installed the wrong way. This then fit perfectly on the GPIO header and gave access to every pin except pin1 (3.3V). The 9 wires to the button board were trimmed to length and the 2x 5V wires and 2 of the the GND wires were kept long so they could connect to the 3.7V - 5V boost board to supply power to the Pi. The wires are pretty thin so I doubled up on them so they could comfortably handle current drawn by the Pi. Rather than trim all surplus wires, I left them long and just bundled them up in a piece of heatshrink tubing so that they can be used later - I'm thinking about adding 2 more buttons to act as shoulder buttons as used by games on the Gameboy Advance, should I end up adding those ROMs to EmulationStation.
My keyboard was made by trimming some rows off a 6 x 8cm double-sided protoboard, and transferring the contact and mounting hole positions from the front panel. The gold-coloured contacts you can see in the photos are made from the battery contacts of a scrapped old Nokia phone charger. I tried using just the bare pads on the PCB as contacts but didn't get a reliable connection with all buttons. Also they would probably oxidize over time and stop working. The gold-plated contacts worked great though. I added some stick on aluminium sheilding (from a scrapped laptop) to the back of the buttons over the carbon pads because some pads were worn and didn't work reliably. By heating the aluminium sheilding while removing it from the old laptop (under the palmrest), it can be removed easily and the sticky stuff will stay on the sheilding. Then it can be cut to size as shown in the photos. So with the pads repaired with the shielding, I used some small-gauge enameled copper wire to connect each contact on the protoboard to 9 pads in a row across the top-middle. This would make a neater connection when the wires from the GPIO connector were added.
This list shows how I connected each button to each GPIO pin:
Header Pin#, GPIO#, Gameboy Function, Keystroke
7, 4, A, X
11, 17, B, Z
13, 27, START, ENTER
15, 22, SELECT, SPACE
12, 18, DOWN, DOWN
16, 23, RIGHT, RIGHT
18, 24, UP, UP
22, 25, LEFT, LEFT
14, GND, -, -
Keep in mind this is for a Model A, Rev.2 Pi. Head over to https://github.com/adafruit/Adafruit-Retrogame where you can find the Retrogame and Make files. Then we need to edit the cfg file in Retrogame so that the GPIO pins envoke the required keystrokes as listed above, then recompile it with Make.
Somewhere in this file, the comments talk about the 'Vulcan Nerve Pinch' method of exiting a game. It involves pressing 2 buttons at the same time. I discovered that in this case it relates to the Select and Start buttons. This does seem to be a bit flakey - sometimes it takes several goes before it actually exits. Because of this I'm thinging of adding a button to a GPIO pin just for this function.
Step 4: Adding Audio Amp, Volume Control and Speakers.
To add audio I needed the smallest amplifier I could find, and some small but decent sounding speakers. The amp I used is a tiny stereo class D, powered from 5V. It's so small I was able to tuck it under the button board near the 'B' button as shown in one photo. I later covered it with some adhesive plastic sheet. The photo shows a coax wire soldered to the L+R inputs - I later dumped that idea as the coax cable was too thick and difficult to solder to the volume control. I used wires from a scrapped IDE hard drive cable instead and fitted a 90° header on the amp PCB. I also fitted a tiny 2-pin keyed connector inline to the 5V wire to the amp board so it could be just plugged in later on. The speakers I used were salvaged from a dead Nokia N95 phone. I owned an N95 for years and it had the best/loudest speakers in a mobile I'd ever heard. So the speaker sections were cut away from the rest of the phone and then positioned as shown in the photos, held in place with a wire strap soldered to the board. The tiny contacts on each speaker were then soldered to the board and brought out to pads on the lower edge. The speakers port sound out to the sides of the case, so I drilled some small holes either side to allow the sound to get out (more on this later).
I could have reused the original volume control from the Gameboy but found an almost identical control on an old scrapped Toshiba laptop motherboard. One photo shows the control together with a section of the laptop motherboard that I cut out to mount it on. There was a perfect hole in the Gameboy case near the side opening that allowed my small volume control board to be screwed in place. It was then a matter of wiring 2x GND wires, L+R in and L+R out to this board. Wires from a scrap IDE hard drive cable worked well here. To make connection easier on the Pi, I soldered a 90° header on the back of the Pi at the audio connector. Then reused a 3-way plug from some old PC case front panel wiring. The same was done on the tiny audio amp board to connect L,R,GND there from the volume control.
Update 10/10/14: I have just replaced the speakers with those from an Acer Aspire netbook. I suspect the amplifier, small as it is, was too powerful for the N95 speakers and they started to distort badly. Here is the exact type of speaker set I now have installed:
The sound now is SO much better, and I've also drilled more holes for each speaker (8 holes each side). To fit these Acer speakers, I completely removed the mounting flanges on each side of them, and put a couple of layers of very sticky double-sided tape on the back of each speaker and stuck them onto the back of the keyboard at the bottom corners, then just cut the plug off and solder wires to amp board.
Step 5: Adding Charge Board, Booster Board and Battery.
I found online some tiny boards that take mini-USB in and charge a single Li-Ion cell. The photos show there was a perfect spot to install this board in the lower left corner of the front half of the case. With a hole cut and shaped for the connector to poke though, the board was held in place very tightly as it JUST fit between the walls and one of the internal posts. To make the charge LEDs visible, I salvaged some light piping from a junked cordless phone base unit, and cut and shaped it to sit over the LEDs but also poke through a hole in the bottom. This worked great and gives a nice bright red while charging, turning to green when charged.
Also online you can buy tiny boards that take 3.7V from a Li-Ion cell and boost it to 5V at around 2A. This fit perfectly at the top near the USB port and was stuck in place with a bit more of that very stick double-sided tape. The red LED on this board was then made to shine through a new hole in the front via another scrap piece of lightpipe.
The 18650 Li-Ion cell was sourced from a dead laptop battery. I just had to choose one of the 6 cells in the battery at random and hope that it wasn't faulty. If it was I had plenty more to try. The cell I chose charged in about 2hrs and is giving me a minimum of 2hrs runtime so seems healthy enough. At this stage I have no battery management circuit for the cell, this I plan to add soon. It will be a small round PCB the same diameter as the cell. There happened to be plenty of room to fit this single 18650 cell in the bottom of the case. Note how all wiring is run up one side of the case so that it is much easier to open and work on later.
The strange-looking switch used to power it all up is something salvaged from an old TV chassis. I have no idea what it's ratings are but it appeared to work fine and fitted perfectly in a narrow space in the Pi's vacant LAN socket position. Ideally I would have preferred a normal slide switch but had nothing small enough. The switch is stuck in place with a combination of super-sticky double-sided tape and a little hot glue. I may need to find a way to screw it in place if it becomes unstuck, but for now it isn't budging.
Step 6: Final Assembly!
With all the wiring done and all tested OK and working it was time to close it up! I had done several test 'closings' along the way to be sure that the case did indeed fit back together - JUST. To ensure no shorts occur when everything was sandwiched together, I got some adhesive-backed insulating plastic from a scrapped laptop and cut it to fit over the back of the button board. This was needed as the SD card socket would be pressing down on it once assembled. I also stuck plastic on the metal back of the LCD since the driver board component side would be pressing on it.
As seen in the pre-closing photo, I made up 4 small metal brackets with a threaded hole near each end to act as links between the two halves of the case. These were made from scrap laptop hinges. Once each bracket was fitted near each corner of the front case, holes were drilled in the rear case to fit screws into the bracket. With all 8 screws tightened, the case was then securely held together.
The battery cover clipped in place too, just clearing the vertical connector on the Pi near the SD card socket. I added 2 stick on rubber blocks on the lower inside of the battery cover that would put pressure on the Li-Ion cell and hold it more securely in place. You can see from the photo with the battery door off, there is still quite a bit of room in there - in fact if I hadn't fitted the speakers where I did, I could have fit another Li-Ion cell in there, although it would have slightly covered the bottom of the SD card and made it difficult to remove/insert.
You can also see the extra GPIO wires bundled neatly with some tubing for (maybe) later use.
Step 7: Things Yet to Do, Final Thoughts.
Regrets and things still to be done:
1. I would love to have got hold of a Gameboy that had not yellowed! When I was searching online for a Gameboy to mod, this one was quite cheap as it was faulty and yellowed and very grubby. It cleaned up OK but a paint job is the only way to get rid of the yellow. Still, this was my first attempt and if it failed, then better to have destroyed a yellowed Gameboy rather than one in as-new condition.
2. I did not bother adding a headphone socket as there seemed no easy way since the battery is now in the way at the bottom. I should fill in the hole, as well as the old link port and charge port holes.
3. The speakers did not sound as great once in the case and all closed up. I suspect the 3 small holes I drilled to let the sound out are way too small but I didn't want to cut big ugly speaker holes. I may try turning the holes into a long slot roughly the same size as the openings of each speaker to see if that gets more sound out.
Update: This problem has been fixed.
4. I've not added any cover or surround to the LCD yet. If I can find a thin piece of acrylic or glass cut to the size of the opening, with some kind of thin black border I think that would improve the look a lot and provide protection for the LCD.
5. Need to add protection board to Li-Ion cell. This will disconnect power from the cell if a short occurs or it the voltage gets too low. At the moment the only way I can tell that the voltage is low is the boost board LED goes out and the LCD starts to flicker on and off. Then it's time to switch off and recharge!
But overall, this was a very challenging project and it turned out every bit as good as I'd hoped! Now it's time to enjoy some hand-held retro gaming!
Note: Not long after finishing this up I discovered another small USB Li-Ion charging board online, one that has micro USB input and also incorporates battery protection circuitry. It's not much bigger than the one I used and would have been the ideal choice.