I got this idea from reading GroupGets "SNES Pi: Zero" project here. I'd long missed the boat on just buying one, but I wanted to make my own version using a European style SNES cartridge that has a great slit shape in the centre to add some flashy LED lighting to the outside of the case.
The Pi Zero is the perfect form factor for a cartridge sized build - but cramming the other off-the-shelf components in is a bit of a squeeze. I've linked to the exact products I used which I found mostly on Ebay from Chinese vendors to keep costs down. The whole thing cost around £30 including the Pi0, SD card, LEDs and left over components (where they came in multiples).
Modifying the CaseThis took by far the most time. I used a sharp Stanley knife to cut the thinner plastic tabs to make room along the bottom of the cartridge for the ports. The most difficult bit was removing the middle "slit" to make room for the LEDs later.
The plastic in the middle area is actually quite thick. In the end I used a drill to drill holes along the length of the slit, a knife to cut and smooth between the holes, and then sandpaper to smooth everything down.
The result wasn't perfect (you can just make out an "overzealous" section on the inside) but it was smooth and the translucent plastic I planned on filling the middle with would hide the worst sins.
Something I would definitely change next time, is the acetate plastic I bought to fill the middle with. I bought polypropylene translucent A5 sized sheets, which were cheap. I then spent a fortune on the correct glue which would actually stick the horrid stuff together! It's a low energy plastic that's incredibly hard to glue to itself or anything. Buy something else!
I did manage it in the end and the result worked out OK - bit scruffy, but with a light behind it you can't tell. I went for a triple layer to get a decent thickness and good level of diffusion for the LEDs when they were put behind it. Just test it before you finalise everything by putting the LEDs behind different thicknesses and seeing what effect you like the best.
I made the decision early on to use a knife to carefully strip down the components like the USB hub as much as possible to make enough room to fit everything in, including the LED shim.
I used superglue for the best bond between the plastic cases of the HDMI converter and USB ports (which I stripped off and cut down from the hub). Then backed up the HDMI port with plenty of hot glue so that it'll take lots of plugging/un-plugging action with minimum stress.
I used superglue to secure the USB hub to the case. The USB ports were secured with hot glue for the micro USB power-port, and the same for the hub port ends back into their bases. I used enough again to ensure nothing would move and to insulate the vulnerable wiring connections (hot glue is brilliant for this, it's a great insulator).
Note that I've also stripped the plastic sheath from the micro USB end of the 2 port hub. I needed to do this so that it would bend over enough to connect into the Pi from the bottom. Just be careful with the connections, as this does make them more delicate.
Looking good, everything fits so far!
SolderingFirst up - USB power. There are two options here in the current setup:
1. Obtain a micro USB male connector, strip the wires back to just the positive and ground connectors and solder onto the micro USB breakout.
2. The Pi Zero has two test ports for the power USB located on the back of the board (see the link for image). You can solder directly to these and then connect up to the micro USB breakout.
I chose option 2, as an extra connector would take up precious space, and I needed as much as possible for the LED shim, which wasn't fitted yet. It's simple to do, the only disadvantage, is you now can't just remove the Pi0 from the case.
Neat! Now the slightly more technical bit...
Shiny LEDs!I chose Pimoroni's LED shim because... well it's perfect for this build! It's super thin and there's very limited space left. It's also almost the perfect length of the cut-out slit. And it's still plenty bright enough with RGB control for shiny shiny rainbows..!
I secured it in place with two blobs of hot glue at either end, holding it nice and snug.
The shim communicates over I2C and needs power (5V), 2x ground connections and 2xGPIO connections. See the pin-out diagram for details.
Don't forget that now, glued in place, you're looking at the bottom of the shim - so double check where to solder before committing! Hopefully my picture will help a little too, if you're unsure.
I fed four of the wires into the holes from behind and soldered on the top - I was really obsessing about ensuring the wires took up minimum space at this point. The 5th I didn't have room behind the shim to feed it through, so that one was just soldered on the top.
<< Before you go much further, you may want to test your solder joints with a multi-meter. Maybe even solder the other side of the connection and skip ahead to the OS & software setup. You don't want to find out later you've a dodgy joint which you can no-longer access easily ;-) >>
Finally I capped the soldered joints off with a thin layer of hot glue to act as an insulator and stop the wires shorting on each other, or on-top of the Pi0 once fully assembled.
Last stage - repeat the soldering, but on the Pi0 this time - double check before you solder again, but as you're looking at the top of the Pi0 this time, it's a little easier. I left just enough wire that the case could be opened fully and laid flat,
Note: I moved the micro USB connector from the USB hub to be behind the Pi0 at this point. This helped me to get everything as flat as possible and also gave a little more space on top pf the Pi0, to shut the case securely.
Hardware done!
OS & SoftwareHead over to RetroPie's website and download one of the prebuilt images, with Emulation-station pre-installed. This takes care of everything to-do with running the emulators for you and when booted, the Emulation-station UI auto-runs. I use Etcher to write the images to an SD card.
Before you go-ahead and pop the SD card back in the Pi0, I'd suggest first plugging it back into your computer and doing a couple of steps first. Locate the mounted SD card on your computer, you should be able to see a "boot" directory.
1. Enable SSH: Add an empty file in the boot directory named "ssh". Ensure it doesn't get given a file-extension by your computer, it's name must just be "ssh" (without the quotes...).
2. Enable USB Networking:
- Open config.txt in an editor and add the following at the very bottom of the file, on a new line. Save the file.
dtoverlay=dwc2
- Edit cmdline.txt, and after the text "rootwait", insert a space, and the text below. Save the file when you're done.
modules-load=dwc2,g_serial
I do this because it makes it simple to connect the Pi0 to your computer via USB and ssh onto it - particularly before you've setup wifi for the first time. You can also setup WiFi from the Emulation-station menus, so it's up to you really how you do it! Just don't forget to connect to the computer via the data USB port on the Pi0, not the power one!
Lighting the LEDsI'm going to assume you've now booted up the Pi0, set it all up and enabled WiFi. If you get stuck - go back to the RetroPie/Emulation-Station docs or give it a quick google.
SSH onto the Pi0
ssh pi@retropie.local
The default password is "raspberry". Once logged in, execute "passwd" to change it.
Next install the Pimoroni LED shim library and all its dependencies with:
curl https://get.pimoroni.com/ledshim | bash
This will take a little while. When complete you'll have a directory in /home/pi with a bunch of helpful examples to get you started with lighting up some rainbows! Before you go any further I'd check that you can run some of these example scripts and all is OK. If you have any problems, I'd start by ensuring the LED shim is detected over I2C:
i2cdetect -y 1
Which should show the address of the LED shim (0x75). If it still doesn't show up, then you may have a problem with your soldered joints... Test your connections, fix any issues and try again.
Loading LightsI made a simple python script which runs on boot and displays pulsing red lights until it detects emulation-station is running, then flashes green. When the script exits (e.g. the Pi0 is shutdown) the lights are turned off safely.
I've uploaded my code here if anyone wants to do something similar. If you use it and like it, drop me a comment and let me know :)
I also have a longer version which stays on and displays CPU usage until shutdown. Happy to share that if someone finds this and wants it - just drop me a comment below.
This was my first "build" - I really enjoyed it, and really pleased with how it panned out. I have a spare SNES case and some other bits that I'm on the lookout for what to do next or how to improve the project :)
Comments