Project GamePi: Raspberry Pi Based Portable Game Console

Hi!

DSC_3044

 

Hope you’re well. In this weeks episode of ‘Weird Electronic Devices You Can Make In Your Own Home’, we’ll be diving into a Raspberry Pi based handheld inside of a Game Boy (DMG). My inspiration to pick this one up was seeing the awesome SuperPiBoy,  as well as the wonderful PiGRRL from Adafruit. I took bits from both of those projects, and added my own small touch.

Parts:

My little bit of spice for this project were the additional 3 controls on the rear panel. Instead of using momentary switches,  I used capacitive touch sensors. I chose the standalone versions that Adafruit sells, because the form factor is favorable to this application, and for simplicity.

I started with a trashed original Game Boy. I found it in a lot buy with a broken Game Gear (I can see another project in my future… :)) for 15$. I handed off the internals to a chip tune obsessed friend, and began the conversion.

I chose not to retain any of the original parts, except for the plastics. I first measured the LCD window, and shaved it to the appropriate size for the 3.5 inch LCD. I shaved down as much of the internal plastics as I could. I then mounted the LCD in place with hot glue. The KB button PCB mounts using the original mounting hardware, no modification required.

DSC_3008

With that done, I soldered a ribbon cable onto the button PCB, and removed the 12v -> 5V regulator from the LCD PCB. I found a datasheet for the regulator on my board, but your results may vary. Apparently, there are many revisions of this device. Here’s a link to a thread which speaks out the conversion in detail (Thanks SuperPiBoy). You can see where I soldered on to the 5V OUTPUT pad on the chip footprint in the photo. Worst case, you can search the board for a chip that has 12V on one pin, and 5V on another, it is likely that’s the chip that needs to be removed.

DSC_3028

The LCD PCB ends up being slightly too large to fit into the case, but can be safely shaved down without having to move any traces. If you needed to keep going with the shaving, the buttons can be moved easily.

DSC_3007

With that done, the Mini USB breakout gets mounted where the old power switch was. It’s the perfect footprint for that spot, and with a tiny bit of shaving, gets supported by the plastic standoff post in that corner.

  • The USB 5v and GND output get tied to the LiPoly Charger 5V and GND.
  • The Charger BAT and GND get tied to the respective V+ and GND on your battery of choice. (Please though, only use LiPoly with the LiPoly charger, obviously.)
  • Pass the V+ from your battery through your SPDT switch, and then along to the PowerBoost V+ input.
  • GND on the battery can go straight to the PowerBoost GND.
  • 5V Output from the PowerBoost goes to the TP2 pin on the Raspberry Pi, and PowerBoost Output GND goes to TP1 pin on the Pi.

Congrats! Your Pi is powered. Your LCD board will also need 5V output from the PowerBoost, as well as the three capacitive sensor boards and audio amplifier.

DSC_3016

DSC_3017

DSC_3023

After a significant amount of shaving of the rear case, I was able to mount all of the aforementioned electronics. The chargers and power input devices are mounted on the recessed area of plastic for the cartridge. The capacitive pads are underneath the label area of the rear plastic. I mounted a female USB port where the old Link port was, and the SPDT switch where the volume knob used to be. I hotglued my snazzy Kitch Bent battery cover in place, and cut it’s locking tab to save space.

DSC_3020

I drilled holes in the center of the cap-pad plastics, so there can be a tactile feeling when searching for the buttons on the rear case. I also used a significant amount of nuts/bolts and standoffs to hold everything in place solidly, so the rear case is littered with bolts in different areas. I used a “Cell” format battery, so that it would sit nicely on the bottom of the case. The battery I chose also has an in-circuit thermal cutoff, so if there’s a problem charging it, it will (hopefully) prevent serious damage/fire. I cut the “fuel gauge” board off of the cell, as I didn’t need it.

DSC_3025

DSC_3026

DSC_3021

For the Raspberry Pi, I removed the Audio Jack, Composite Jack and relocated the USB port. Being a Model A, it did not have the Ethernet jack or second USB port. I soldered wires onto the respective areas to pull the signals I needed. Take care when soldering to the Composite Video pads, as it’s easy to damage the Pi’s composite output with too much heat. For the audio, I routed the Audio Jack output direct to the headphone port, as well as to the amplifier board. Since I did not have a “switched” variety headphone jack around for this project, I came up with the following arrangement. When booting, the Pi runs a program to check the state of the 3 Cap Pads. If they’re all HIGH, it will boot into “Headphone Mode” and drive the Shutdown pin on the amplifier board, freeing the headphone jack. For the speakers, I stuffed a set of Macbook (3Ohm) speakers into the area where the old GB speaker used to be. I tied them to the outputs on the amp board.

I trimmed down the GPIO pins down to half height, and soldered the Common Ground PCB and OUTPUT pins (from the cap-sensors) to their respective BCM GPIOs. I then cleaned up the wiring with a couple of wire ties, and routed the wires as best I could.

DSC_3033

DSC_3036

DSC_3035

And, that’s it!

As far as software goes, running on a Model A means that running RetroPie 2.0+ is out of the question (as ES 2.0 is apparently more graphically intense, and requires a 256/256 GPU split). I loaded RetroPie 1.10 onto a high speed SD card, and shimmed in my custom bits of software to glue everything together. Cave Story runs great! 😀

 Post-Mortem:

When shaving the case down to fit the LCD, I neglected to do something about the standoffs for securing the two halves of the case together. This lead to complications at the very end of the project, because there was no reliable way to join the halves together. I fixed this by hot gluing a bolt down in two corners of the case. I then fed a machine screw up into the case, and into the bolt. My screws ended up being the perfect length to pull the bolt, without going all the way through. It hurts the project’s aesthetics, as it’s clear the halves no longer join seamlessly, but it has an acceptable amount of mechanical strength.

The Capacitive Sensors are HIGH when active, and LOW when dormant. The opposite is true for the Common Ground Button PCB, which (when the internal pullups are activated) are HIGH when dormant and LOW when active. This lead to complications using Retrogame (the Adafruit C utility used to convert the physical button presses into keyboard events), as the ‘always-active’ buttons would pin it. I’m in the process of writing a program that is compatible with mixed button conditions, and will update this post when I push it to my git.

DSC_3042

 

 

 

Project CarFire: RasPi-based In-Car Music Streaming Box

Hi. This is a short little project I whipped up on my lunch break today.

IMG_2474

I recently saw this hack floating around the Intertubes. The basic run-down is that an Airport Express (A1392) has it’s power supply replaced with a 12V->5V->3.3V step down sequence, so it can run off of a car’s DC power. It is then setup to pipe audio to the car’s audio system. It’s a really neat hack, I wish I had thought of this when I drove down to Florida from New England.

I decided to spin my own version of this from components I had lying around. I wasn’t keen on spending 100$ on a new Airport Express when I could whip my own up for free! I used a WAP54G, as I have many of them lying around, and it runs on 5V direct. This is nice because the RasPi also uses straight 5V, which means I’d only have to step the voltage down once.

Disclaimer:

I am not responsible for your actions if you choose to follow this tutorial. Miswiring could cause serious property damage, risks to your vehicle, and life. Seriously, be very careful. Your cigarette outlet is protected by a fast-blow fuse (on most vehicles), but that does not give you a license to do anything stupid. You’ve been warned.

Parts:

Raspberry Pi with 4GB SD Card (Rasbian Preloaded)3.5mm Male to Male Cable
Micro-USB Cable
USB Extension Cable
Voltage Regulator (I used the LM317, but any ~14V->5V will work.)
Linksys/Cisco WAP54G V2
Garmin GPS Power Cable/Cigarette Power Adapter Without Regulator

Prerequisites:

Install DD-WRT on your WAP54G/WRT54G

Install Rasbian On Your RasPi

Install/Compile Shairport

Make sure you set Shairport to start when your Raspberry Pi boots, and test that it comes up properly. Configure your DD-WRT with a DHCP server, and disable the Internet Connection. Being that the WAP only has 1 Ethernet port, you cannot easily do other routing. However, with the WRT this is not the case. I’m not sure if you can run a DHCP server on the default Linksys firmware on the WAP, but I don’t believe you can. DD-WRT is much more powerful, I recommend it.

We start by chopping the end off of the Garmin power cable. My power cable came from a Street Pilot C550, which has a barrel jack connector. I am not covering the other type found on later Garmin models. The barrel is center positive.

Cut the Garmin adapter wire 3/4 the way to the barrel jack connector. Strip the wires on the side with the cigarette adapter. Red goes to IN+ on your LM317 board/circuit. White goes to IN-. Solder these in place, if you haven’t already. If you have an adjustable regulator, move your trimpot until your output is 5V.

Strip and solder the Red and White wires on the barrel connector side of the cable to OUT+ and OUT-. The barrel will fit into the power supply on the WAP54G! So, no other adapting necessary. If you have a WRT54G, your router uses 12V input, and this will not work at all. You will have to power your router straight from the 12V coming off the cigarette socket.

The Garmin cable has a built-in quick-blow fuse, that’s hidden under the tip of the cigarette socket adapter. If the red indicator LED on the socket adapter is mysteriously not working, check this fuse by unscrewing the cap.

Now, snip the male end of your USB extension cable off. Strip the female end’s insulation, peel back the shield, and snip the green and white wires. Solder the Black wire to the OUT- on your VREG circuit, and the Red wire to OUT+. Plug your Micro-USB cable into the Female end and test to see that your RasPi starts up. If it doesn’t, or if you see your USB device enumeration going crazy, try a different Micro-USB cable. If the problem persists, your VREG may not be supplying enough current. The WAP and the Pi together should pull close to 1 amp under full load, and a bit less when quiet.

Connect an Ethernet cable between the RasPi and the WAP, and make sure that it assigns the RasPi an IP address when the interface is brought up. Now, attach the RasPi and the VREG to the casing of the WAP somehow (I chose to mount everything on an aluminum plate… Not very efficient or elegant, but I think it looks awesomely crazy.) Tape up all of your connections to prevent shorts, and verify that it works! Name your wireless network something snazzy. I named mine ‘CarFire’. I also added a giant heatsink, since the processor on the WAP was getting pretty hot. Necessary? Absolutely not. Hilarious? Yes, very.

IMG_2484

IMG_2482

IMG_2481

IMG_2485