First up, apologies for the lack of “build” photos, I wasn’t thinking about doing a post of this until I’d pretty much finished it, so what photos I did take were mostly to show some friends how I was getting on. There’s big chunks of the process missing. However, I do intend to do more Raspberry Pi projects in the future because this was really fun, so I’ll take better pics then.
I’m going to build a Pi project! How? I have NO idea.
This is the first time I’ve ever done anything like this, and I made a LOT of mistakes, backtracked, broke things, started again, etc. I also had to learn how to solder properly, and about basic electronics too. If I were to do this again, I’d definitely be able to do a better job, but as I went along I was operating under a “good enough” principle. It took about two months in total, but it was a part-time project and much of that was making mistakes. I think I could do this in a few days if I started a new one.
I had a plan to make a handheld retro-gaming console. I wanted to be able to play Megadrive (genesis) games at least and to have a pretty good battery (5+ hours was my goal, because my longest regular round-trip is approx 4 hours). I already knew I was going to use a Raspberry Pi, having seen Ben Heck do a MAME portable a few years ago. Other than that, I had no idea how to start.
I’m linking everything I can here so you can check it all out yourself. I highly recommend you do since this was a great learning experience and really fun (and highly frustrating at times) and very rewarding when it’s all done.
So, I had a Raspberry Pi and a 2.8″ adafruit TFT screen and a powerboost 500c that I bought a year or two ago when I first planned on doing something with a Pi. I never got round to it though. Had I been buying things for this from scratch I’d have gone for a bigger screen and the powerboost 1000c. I also had a Rpi B+ originally, I bought a Rpi 3 for this project since the B+ didn’t perform that well with the emulators without overclocking, the Pi3 is considerably more powerful and it’s worked brilliantly. I’m planning on using the B+ to make something else that needs a bit less graphics processing.
Awesome people have done it first.
The magic of the era is that there’s a billion resources for pretty much anything. I found many guides and projects online for doing this project, or similar things. They were really helpful in getting an idea of how to start and where to end up.
Pretty early on I decided that because of my inexperience, I needed to keep it simple. I was mostly planning on using this on trains and busses, so I decided not to bother with speakers, the Pi already has a headphone jack. That meant I could ignore the need for a speaker and an amp board right from the start. (Note, I did have an issue here, I’ve added a note right at the end about this).
Many people use existing controllers and cut them up. I did take apart an old controller, but I was daunted by the hugely complex-looking circuitry I found inside and I wasn’t confident about how to do that since I wasn’t using the exact same controller as various guides. I also found that many people have produced their own printed circuit boards for the controller parts. Since for me this was a learning project, I also discounted purchasing these excellent things since it would eliminate a big part of the learning process, I wanted to as much as possible from scratch.
For my inspiration, I settled on Ben Heck’s Portable MAME, he’s done two versions of this project, and they’re both great for my own project. Ben Heck is brilliant for electronics projects and I watched most of his videos over the last couple of months and learned so much. In this project he used tactile switches for the buttons, and that looked like something I could do. So that’s what I did!
I heavily used these resources:
- DIY Raspberry Pi Zero Handheld Game Console (Youtube: Greatscott!)
- Build Your Own Portable Raspberry Pi (Youtube: The Ben Heck Show)
- Retropie (The emulator that runs on the Pi)
- Running OpenGL-based Games & Emulators on Adafruit PiTFT Displays (Adafruit ‘How To’ guide)
- In Depth Guide : How To Setup Retropie 4.1 On Raspberry Pi 3 (Adafruit ‘How To’ guide)
- Adafruit PowerBoost 500 + Charger (pinouts)
- Ben Heck’s Raspberry Pi MAME Portable (Youtube: The Ben Heck Show)
These are the main ones, and I used this one the most since it had pretty much everything I needed. Again, knowing what I know now, I wouldn’t need to spend even nearly as long researching things! Running OpenGL-based Games & Emulators on Adafruit PiTFT Displays tells you almost everything you need to know to build something like that really.
I have a (read, ‘My very lovely partner has lent me her…‘) small portable keybord, you plug the dongle into usb and it works. This is BRILLIANT for working with the Pi. You can pick these up for about £15-20 and they are definitely worth getting. I guess I need to buy my own at some point.
I started by literally plugging the Pi into my TV (the Pi has 4 USB ports and an HDMI port, it also has onboard wifi, bluetooth and a LAN socket, so plugging it in and getting it running was really simple). NOTE! The Pi needs a 5V 2A micro-usb input, less than that and it’ll be underpowered (especially using the USB ports and TFT screen and stuff). Most phone chargers I’ve found are between .8A and 1.2A or so. I used a 1.2A usb to test it and it works OK (did flash up the low power warning a few times though), but after that I was running it off the Powerboost circuit which does supply the right current.
Installing the Retropie image on the SD card and booting it up was really simple, just follow the instructions. It worked! I also have a cheap bluetooth controller I got for the Ps3 years ago which worked immediately by just plugging it into the Pi and using the “configure controller” option within Retropie. So, within half and hour I had a retrogaming console, it’s that easy to set up.
Problem is, I wanted to make it portable…
IT’S SMALLER! And still alive, but looking like it was made by an alien to phone home.
This is the first photo of the portable version working I took, I was mainly showing a friend that it was working. What you’re looking at is the result of about 15 hours work to get the TFT screen running with Retropie.
I 3D printed a very basic frame to hold the Pi and the screen and the powerboost circuit. I also spliced in a power switch into the battery circuit using the pinout guide from Adafruit. You can see the keyboard here, and the top of the controller under that, on the right is the powerboost with the battery plugged into it, sticking out of the left of the Pi (which sits behind the screen) is the dongle for the controller.
It took me so long because I was learning totally from scratch. I ended up breaking Retropie about a dozen times fiddling with things, and I had to re-format the SD card several times. I also had to learn to use Linux and install the software for the TFT screen. However, again, now I’ve done all that, I realise that it’s a really simple process that only takes a few minutes if you know what you’re doing.
What I will recommend is that you use SSH (via PuTTY if you’re on Windows like me) or a similar program. This allows you to remotely log into your Pi from your computer, and it makes it a LOT easier to copy/paste the (often long) install commands that have to be entered from the command line. This is the guide to follow for installing the TFT screen software. It’s really simple and it works great, I wish I’d done this right from the start (took me a while to find it!)
More portable, but not exactly pretty.
Second prototype. This one is entirely portable. I built this frame from tongue depressors (jumbo popsicle sticks), or if you’re me, the sticks you use for stirring resin and things and screws and bolts. Sticking out the right hand side you can see the battery, that’s just one from an old mobile phone. They are 3.7v, but the powerboost circuit pumps that up to the 5v the Pi needs. It only lasted about and hour but it was free and great for testing purposes.
I used thermoplastic to attach the controller to the frame (the white stuff you can see there). I made this to stop all the parts falling all over the place when I was testing stuff out (and to make sure I really wanted to play retro games).
Making my own buttons.
At this point, I was able to confirm that the Retropie/Pi/TFT/Battery setup was working exactly as I wanted it. It was time to remove the controller and make my own buttons so I could make a handheld.
This was a HUGE learning process for me. The first real soldering I’ve ever done (I can solder wires together and switches on), this was soldering onto “double sided prototype boards” that I bought from Amazon. I got this because as a total noob I had no clue what to buy and they looked OK, seemed to be the right thing and came in all different sizes. They worked fine, I’ve no idea if they were the best thing to get.
I also bought Tactile switches from Ebay, these are dirt cheap and I got a bag of 50, plenty enough for me not to worry about breaking anything.
I mostly followed Ben Heck’s build where he talks about writing the buttons for his MAME portable, and he helpfully draws a diagram on the board at about 4mins into this video. I used these male to female jumper wires for the buttons the first time, since the female side fitted the GPIO pins of the Raspberry Pi.
There seems to be a few ways to attach the buttons to the Pi. Since I was trying to keep the costs down on the project, and also was slightly daunted by the idea of introducing another type of circuit into it without really understanding it, I opted to use a method of directly connecting the buttons to the Pi’s GPIO pins – using the GPIO header image above and this guide from Adafruit.
This does work. It was a nightmare to do. You can see in the early pics I was using the jumper wires, but the connectors on them were taller than the GPIO headers, so it meant that when the TFT screen and the Pi were put together they didn’t meet up (they sit on top of each other like a sandwich). This was fine for testing, but I knew that for the “real” one I’d have to find an alternative to the wiring.
Knowing what I know now, I’d use a microcontroller for the button inputs, something like a teensy board, that seems to be a really common way to do it and it not only allows you to use more buttons (I really wanted two more but didn’t have enough free GPIO pins) but it also keeps the wiring much more simple. At the time though, it was a whole other thing I’d need to learn and at this point I’d spent what felt like a billion years on this already.
Making it look more like a games device and less like droid poop.
So, this part was really fun and looooong. I decided to skip the necessity to make actual buttons by buying a PS4 controller button replacement pack. For me, this was a mistake since I spent quite a while making my case fit the buttons, and as you’ll see later, I ditched all that and made my own anyway! Live and learn 🙂
I designed mine in sketchup and 3D printed it. This was several rounds of trial and error. I debated for ages whether to make it like a gameboy or more like a Gamegear/psp, eventually I went for the PSP style because I also wanted to work in the “controller” shape on the edges.
You can’t see from these pictures, but that was a huge mistake because it meant I needed to make the middle bit really, really fat. The Pi isn’t thin, the screen on top of it makes the whole thing a good couple of cm tall. Plus I had a battery I got off ebay by this point (6000mah 3.7v lipo), which was the same rough dimensions as the Pi3 but about 1cm deep, so that means the whole thing was around 3.5cm, plus space for the wiring, it was really FAT! and uncomfortable to hold.
But, good enough for testing.
The pictures above show the first fully working version with my own buttons (Or rather the tact switches under the PS4 replacement button set) and everything. You can see wires still poking out the top and the plug isn’t actually external power, at this point I had wired a micro usb to the battery so I could plug it into the Pi and not have to figure out how to wire it in permanently.
Changing the wiring to ribbon cable.
I still needed to solve the problem of the wire plugs for the GPIO headers being too tall, I found an old IDE ribbon cable and discovered that the connector block fit the GPIO pins perfectly. Unfortunately, the TFT screen takes up about 2/3 of the GPIO header on the Pi, and outputs it on the underside of the TFT board, so one long connector block obviously wouldn’t fit. So I sawed the connector in half and cut off the little nub that stopped you putting it in backwards, and I had two bits of ribbon cable to perfectly fit my Pi’s two GPIO headers. Now all I had to do was figure out how a 2 row GPIO header ends up being a flat cable…
Googled that, and did a LOT of counting and testing. (got it wrong about a dozen times). Re-soldered all the new wires to the button boards and finally, it all fit together pretty well. Still in that awful shell that took me a week to design though…
You can see I also added the two shoulder buttons. As I mentioned before I really wanted 4 shoulder buttons (and ideally one or two extra for things like screen brightness)… next time.
You may also notice this version has two little LED’s. I love those, but they didn’t work. The red one was the low battery indicator, but it was on all the time (even when the device was turned off) and it only went off when the battery was low – so basically the reverse of what I actually wanted. The other LED was supposed to be the Activity light for the Pi, but it came on when the Pi started and remained solidly on until the Pi was turned off. I realised this was basically pointless since I could tell that much info by whether the screen was on or not! I realise I’d wired those in wrong, but I couldn’t figure out how to solve it at the time.
I kept the ugly thing for a while and played on it to get used to it, figure out what I didn’t like and what needed fixing.
I didn’t like the fatness, Stacking the TFT, Pi, some wiring and Battery together wasn’t a good idea. It made it uncomfortable.
Sadly, I didn’t take any pics of the early part of the V2 build other than this one on the right. I decided to make it a Gameboy shape since it meant I could put the battery pack and button circuits in the lower half and the top half was left for the Pi and screen, that literally halved the thickness. I designed a whole new case…
For this one I made a new shape, I redesigned quite a lot of the inside using what I’d learned from the previous one. It was much simpler and cleaner.
I removed the LED’s that didn’t really work, and instead I put holes in the case to align with the LED’s on the Pi board and things, that way I’d still be able to see the info they were conveying, but I didn’t need to do anything extra. Again, in a future version, this would be something I’d want to do properly.
The picture here is the second version of this I made (So I guess this is really v3). The first one had an inset screen and used the original PS4 buttons and D-Pad. It was only after I made that one that I decided I didn’t like the D-Pad. The separate buttons for each direction are fine for linear pressing (like on a Ps4 you mostly use those for menu options), but for retro games where you often need to use them more like a thumbstick, it was uncomfortable. Because I was changing that, I didn’t want to keep all the other buttons gold. The inset screen was supposed to have a surround that I was going to add later to make it look cool (imagine the gameboy screen surround), but it wasn’t working how I wanted and was fairly complex to build, so I made a second version with my own custom buttons and got rid of the inset screen.
And so, the final form is born.
After I’d done all that. I was pretty happy with how it felt and worked. It needed to be decorated.
I really wanted to do a retro theme in keeping with the style. I looked at a lot of 90’s computer stuff, and decided I wanted something a bit more original. I’m a huge Star Trek fan and was watching Trekyards at the time talking about the TOS era communicators and I decided to do my retro console in a “space 60’s style”. My plan was originally to give the surface a bobbly texture in black, like the TOS communicator, a silver “girdle band” running around it, and multicolour “jellybean” buttons. However… I started that, and then hated it.
My partner suggested paper mache on the case, and I loved that Idea, I did it with handmade tissue paper, it has all sorts of little knobbly bits and really nice texture. It felt great and looked good, but it wasn’t “right”. So, I painted that black, and hated it, then I had the idea to do it in a “used future” cyberpunk style because that would get that retro style I wanted. I painted it beige and used weathering techniques around the button holes to make it look really well used. I liked it more, but still wasn’t great, the bumpy texture was now working against the look. Plus, I made the mistake of using questionable varnish and it never quite dried and was eternally sticky.
Exasperated, I started sanding the damn thing down (I really just wanted to play on it by this point). And a magical thing happened. The bumpy bits sanded down, exposing the under-layers of colour, the sanding removed the terrible varnish, but almost all the weathering and beige colour remained. I liked it! It looked used and worn out, exactly how I wanted it.
I added an EVA foam padding that wrapped around the back and sides to make it feel a bit nicer to hold.
I spent a while making stickers and printed them out (I wanted that 90’s cyberpunk look, and everyone seemed to stick stickers on everything in the 90’s, apparently so did retro cyberpunks from the future too). I made tons, referencing lots of my fave things, however I only used a few of them just because there’s not much space.
The ones I did use, I weathered down a lot to make them look old. I imagined that some hacker punk got a device, maybe a scanner or something, then retrofitted it into a gaming handheld.
I also wanted the buttons to be a colour, I originally wanted red, but I don’t have very much red filament left and I didn’t want to buy any just for this little bit. I was considering painting the grey ones when I came across a pile of filament samples my filament supplier sends me. One of them was a Purple to Red thermal colour changing plastic! OMG of course that’s entirely perfect. It starts off dark purple, and with the heat from your hands it changes to bright red.
I did originally make stickers for the ABXY, Start, Select, etc buttons, but I then remembered I had a Dymo label printer, and it just seemed pretty obvious that my imagined cyberpunk future hacker would use a Dymo to label up this creation (Including the deliberately badly spelled “conect” on the USB/LAN cover).
I added little aluminium brackets screwed on, looking like it’d been broken open to hack it and crudely bolted it back together. It does make it stronger, but the main screws are through the back so the brackets are mainly cosmetic.
So, here it is:
No, wait, it’s not quite done. Turns out that Dpad is nice to use, but not perfect and in some games that required fast action it was still a bit clunky (I’ve been playing Doom a lot since I made this thing).
Originally I’d wanted a thumbstick, but actually wiring in a real one was too much for me at the time, but I suddenly realised that if I put a thumbstick hat on top of the Dpad, it would work as a DPad but with the extra functionality and leverage you get from a thumbstick. You’ll notice in the pics above the Start and Select are fractionally recessed too, since I was doing the Dpad I decided to add a tiny bit to those to make them poke up a bit more.
And here it is, the final (current) version:
I really, really enjoyed making this, even though it was very frustrating at times. I highly recommend everyone have a go, it ended up costing a total of around £100 to build (not including things like paint and filament and suchlike), but a lot of the bits I used I’ve since found you can get cheaper from China, I’ve no idea if the quality will be there, but my next project I’m going to get some of the cheaper bits to see if it’s worth it. There’s also cheaper versions of the Pi, the Pi3 is crazily overbuilt for this project, and these days there’s a lot of Pi like things (Lichee Pi, Orange Pi, Beaglebone, C.H.I.P, etc.) so there’s a lot of options. I’ve seen people make things like this using the Pi Zero too, which is crazy small and much cheaper, but there wasn’t any in stock at the time I got my Pi.
I learned so much about programming, soldering and electronics from this it was a worthwhile thing to do even if I get bored of retrogames next week.
About that headphone Jack…
So, this isn’t really part of the build, but it was an issue. When running Retropie I got a constant hissing sound through the earphones. I fiddled with the Retropie software volume but couldn’t fix it. I googled it and found it’s a fairly commonly reported problem with the Pi headphone jack. There’s a ton of theories as to what’s up there, but I couldn’t diagnose which it was.
I settled for a simpler solution. Someone on a forum suggested buying one of the headphone volume extenders (I got this one), then turn the volume in Retropie up to max and use the volume control on the cable to make it so your eardrums don’t pop.
This worked brilliantly. I assume that if you used an amp board for speakers and wired your ‘phone jack into that instead, or used some other solution that has an off-pi jack you’d be similarly OK.