Feature

Whiskey Pi

DIY Retro Raspberry Pi Gaming System

Adam Garrett

Issue 63, October 2022

A Raspberry Pi 4B-powered mobile retro gaming system built into an old whiskey glass box.

Not all projects need to be housed in a custom-designed 3D printed enclosure. In this fantastic example, maker Adam Garrett has used an old wooden whiskey glass box, adding to the retro feels.

We caught up with Adam to find out more about this fun looking gaming system.

Tell our readers a little about yourself, Adam, and what got you first interested in electronics.

I'm an IT Director with a wife and two kids who likes to tinker with electronics as a hobby. Growing up I was always fascinated with electronics. I would always disassemble old electronics just to see what was inside and examine the PCBs just because even if I didn't know what I was looking at.

This sparked my interest in tech as a whole which directed me to computing as my profession. Life took over and I stopped tinkering for many years until the 2020 lockdowns created the perfect atmosphere for me to get back into it. I like to take old things and fix them or strip out components that I can use elsewhere.

Congrats on your fun looking gaming system. We love that you used an old whiskey box to add some character. What was the motivation behind making it?

Like many other people my age, growing up in the 90s and early 2000s has rooted a love for retro gaming (well, it was just gaming when I was a kid). I wanted to take my interest in tinkering and fixing to the next level and actually build something out of new and salvaged parts. Put those two interests together and here we are.

There has certainly been a resurgence on retro games. How does your project work and what parts does it need?

At the heart of the system is a Raspberry Pi 4B 8GB overclocked to 1.8GHz with 64GB microSD card running the latest (at the time of building) RetroPie OS.

I have a microSD card extender mounted on the side for easy access to the microSD card, a front mounted power button using a momentary switch, a rear mounted laptop fan to exhaust heat generated by the RPi, a front mounted 4-port USB hub, a 7” LCD mounted on the inside of the box lid, and two speakers mounted directly underneath the LCD. I have USB-C (power) and a micro HDMI cable mounted on the rear as well.

On the RPi, I put small heatsinks on the CPU, RAM, and USB controller. I also placed a homemade fan HAT to apply a little air flow to keep these heatsinks cool.

The screen mounted in the lid is genius. Would the project work on other Raspberry Pi boards?

This should work with any model of Raspberry Pi 4B SBC. It would probably work with any Raspberry Pi but I don't have any others to test it on. As long as the version of RetroPie supports that board.

Tell us about the RetroPie OS and what kinds of games it supports

RetroPie (retropie.org.uk) is a fascinating little operating system based on Raspberry Pi OS Lite and it supports just about every game console and arcade. The front end user interface is EmulationStation and the emulation front end is RetroArch. Obviously, you won't be able to play any modern games (PS2, XBOX, GameCube, and later) on it because the RPi just isn't powerful enough, but that's to be expected. It does, however, run NES, SNES, Genesis, PS1, PC Engine/Turbografx, possibly N64, and a plethora of other retro consoles. It can even play arcade games with some fine-tuning.

Sounds like many hours of fun. Where can makers source supported games?

This is a tricky one to answer for obvious reasons. Depending on where you live and what copyright laws are in place, you'll generally only be allowed to use ROMs of games you personally own. You could backup your own games or use a ROM from some other source, but you have to own the game you intend to emulate. The best thing to do is, using your favourite search engine, search for any titles that you own. That should be enough to set you in the right direction.

Going by the fancy boot screen logo, you are handy with design. How much custom coding did you need to do?

The only custom coding I had to do was for the power button and exhaust fan, both of which are simple in practice. The exhaust fan is connected to the Pi's GPIO ports with a transistor in between. During boot, the GPIO port is set to HIGH which puts the transistor in an ON state, allowing 3.3V to pass to the fan and back to ground.

The power button can power on the RPi by shorting pins 5 and 6 on the RPi GPIO header. For shutdown, it simply sends a shutdown command to the OS.

What design or build challenges did you need to overcome?

My largest challenge which spanned across all other challenges was my very limited set of tools to work with. All I have are a Dremel, electric drill, and a hand saw.

The first challenge was how to layout and mount the components in the box. The box is relatively thin (about 5mm or less) so mounting components directly to the base layer was not an option. To overcome this, I simply cut a 1/4 inch (25mm) piece of wood into the correct dimensions, applied wood glue to the bottom, dropped in the wood cutout, and added weight for approximately 24 hours to allow it to dry. I now had much more to work with for mounting.

The next challenge was aligning and cutting out slots for the fan, button, USB hub, and rear USB-C and HDMI ports. I drew approximate outlines of each slot I would need and used the Dremel for all the cutting.

Next was the acrylic cover. Cutting a straight line with a Dremel isn't exactly easy, especially for the perfectionist type. But by taking my time and cutting slowly I was able to get a pretty clean edge. Mounting it wasn't exactly easy either. I used plastic locking shelf support pegs with the pegs shaved off. This resulted in a nice little surface for the acrylic to rest on that I then used epoxy to glue to the inside walls of the box. Drilling small holes in the acrylic cover in each corner and a hole the same size into each shelf support allowed me to screw the cover into place securely.

Then there was mounting the LCD. The lid of the box was just as thin as the bottom and the factory hinges won't handle too much weight when open so adding a 1/4 inch (25mm) wooden cutout was not an option. Doing so would also cause the LCD to protrude beyond the depressed edges of the lid into the rest of the box while closed resulting in the box not closing. What I ended up doing was I used epoxy to bind standoffs with two female ends to the inside lid. This effectively provided a mounting point for the LCD without causing issues.

Great idea using a Whiskey glass box. Was this just for aesthetic purposes?

I wanted to build something unique, classy, and relatively low-key. Something that could sit on a shelf and more or less blend in and would make someone go "ooh" when opened. I also wanted it to be mobile. A whiskey glass box was the perfect solution to all of those points.

We imagine it was easy to work with the timber structure. Working with acrylic can be tricky. Any additional advice for our readers who want to work with this material?

Cutting acrylic would probably have been easier with a table saw, which I don't have. I used a handheld Dremel and it was pretty effective. To get a clean cut with soft edges, use a marker to draw your outline on the plastic wrap and take your time when cutting along your outline. Afterwards, lightly use a grinding stone (also a Dremel bit) to make the cut edge smooth. When drilling the mounting holes just go slowly and push lightly. Too much pressure will cause the acrylic to crack. I drilled the holes over a piece of 2x4 so there was no empty space under it while drilling. This helped to relieve pressure.

Great advice, cheers. You mentioned the use of heatsinks and cooling fans. Does the RPi run hot?

The RPi itself does not run very hot, but if it's overclocked it for sure needs a little help. That's where the heatsinks and fan HAT come into play. However, once I installed the acrylic cover it effectively sealed the RPi inside with no access to cool air. As a result, the heat inside the box kept going up rendering the fan HAT and heatsinks useless (since it was blowing hot air on a hot hintsink). Installing an exhaust fan dramatically decreased the CPU temps on the Pi. To illustrate, I ran some tests.

CPU temps on the RPi under the following conditions:

Fan off and system idle: 56.4°C.

Fan on and system idle: 37.4°C.

Fan on and running Sysbench: 52.5°C.

As the data shows, adding an exhaust fan to pull out the stale hot air had a dramatic improvement on overall heat dissipation. There was a 19° difference when idle just from creating an air flow.

If our readers want to make something similar for themselves, do you have the code and build details available?

The power button script was found on a GitHub repository. It waits for a GPIO falling edge on button press then sends a shutdown command to the OS. It's a simple script but I made sure I understood everything it was doing. Why reinvent the wheel? https://github.com/Howchoo/pi-power-button

The fans also have a script. When the Pi is plugged into a power source, it never truly powers off even when shutdown. Power is always available from the 3.3V and 5V pins on the Pi header. This would result in the fan constantly running despite the Pi being powered off. To mitigate that, each fan is connected to its own transistor and GND.

One transistor is connected to 5V and GPIO 18 (for the CPU), and the other is connected to 3.3V and GPIO 26 (for the rear fan). The transistors prevent current from flowing to the fans until the GPIO pin is set to HIGH delivering a small amount of current. This sets the transistors in ON mode and closes the circuits from 3.3V to GND, powering the fan. There's a small script to trigger this event that runs on startup.

As for the physical construction, use a small metric ruler for fine details. Use tape to create a mock build to test component placement. NEVER permanently mount or modify something until you know that it’ll function 100% as expected.

Measure twice, cut once, so they say. Is there anything we haven't covered that our readers should know about the build?

This system can be easily changed on-the-fly to connect to an external display instead of the built-in LCD. I installed the HDMI input for the LCD and HDMI output from the Pi on the rear. To output to the built-in LCD, simply connect an HDMI to micro HDMI jumper from output to input. To connect to an external display, remove this short jumper and connect directly to the display. Seeing a whiskey box plugged into a TV is definitely a unique look.

Great! Finally, what are your favourite games to play and recommend?

My favourite retro game series are R-Type, Castlevania, and Metroid. These are wonderful classics that everyone should enjoy!

Thanks for your time, Adam. Happy gaming!

Adam Garrett

IT director and electronics hobbyist