On this page I'll document my improvements on the Picade retro arcade cabinet for your Raspberry Pi. It is sold by Pimoroni in UK. I wanted to improve it - not because it isn't well designed, but because I don't like a few methods they used.
The power distribution
- There are 4 modules which need power.
- The Raspberry Pi itself,
- the Picade PCB (with audio amplifier),
- the display and
- the display controller.
- Pimoroni (as well as others) recommend a 2A 5V power supply to feed the Pi. The Picade and the display controller get their juice from one of the USB ports of the Pi. The controller feeds the display by its flat flex cable.
- Your average USB port can deliver 250mA to a connected device. Upon request it can have up to 500mA.
- The picade pcb - especially the audio amplifier - is able to draw up to 0.6A. There is a forum post describing this behaviour.
- The Raspberry Pi can distribute up to 1.2A to a USB device, if you put a max_usb_current=1 line into /boot/config.txt.
- Unfortunately I don't have a datasheet where the power consumption of the display controller board is described.
- The display backlight draws 1.782W, the display panel 0.356W - at 5V, that amounts to 0.4276A.
- In total we have now more than 1A.
- There is not much room to add a USB-Wifi or a USB-Bluetooth device. I tried it and it ended up with the screen going black all the time.
- I ordered a 4A 5V power supply.
- This power supply will directly feed the display controller and the display.
- Since it comes with a coaxial power connector I'll mount the female part at the back of the cabinet to be able to unplug it.
Boot & Shutdown
|As soon as you plug the power into the Raspberry Pi it will boot. Maybe there is not always a need to boot up when you plug the power in? Simply unplugging the cabinet from the power supply will sooner or later corrupt the filesystem on the MicroSD card. When this happens you are out of luck. You might be able to correct the error by starting a fsck & repair, but you'll need a keyboard to do this. However, there is a good chance that linux won't be able to boot from the damaged SD card - then you're out. Yes, there is a shutdown option inside the Retropie menu. But there is a better way:
Maybe I would like to use the Ethernet port on the Pi. Or I want to connect a USB keyboard or gamepad. I could open the rear door, plug the cable in, route the cable through the gaps on the lower end of the door and close it. But - you guessed it - there is a better way:
- I'll use panel mount extension cables.
- Their cables have a length of 22cm - enough to reach the ports on the Pi.
- There are Ethernet and USB types available from Adafruit.
Keeping It All Together
During the build I refused to use the included M2.5 nylon screws to screw the Pi on the back plate. Instead I used 4 M2.5 brass standoffs, 4 M2.5X12mm screws and 4 M2.5 nuts. I'll try the same (but with M3 standoffs) with the Display button panel. But what to do with the power buttons, the panel mount cables and the power connector? I don't use the included tactile switches from the Pi Power Switch - they are unusable in a fixed mounted cabinet. Instead I use 16mm panel mount pushbuttons. I could drill holes into the back, but as the fixing threads on the power connector and the buttons are only a few mm high, I'd need to drill a bigger diameter half way and a smaller one all the way through. The Ethernet connector has the same issue. It is not possible to unplug an Ethernet cable when you can't reach the spring tab to release it. I found a better way:
- Since I own a 3D printer, I can print a small back plate.
- It will hold all the buttons and connectors.
- It will be about 2mm thick and a 85mm by 85mm square.
- I can screw it into a 80x80 square break out near the Pi mounting place.
- Most of the square break is already done. You only need to remove a small corner and the air grill parts.
- Since the plate is bigger than the cut out, you need not to be very accurate with your cuts.
- To fix the plate in the cutout I'll use two "wings" screwed on the back of the plate. So it will stay in place.
- The PiSupply Switch PCB gets mounted above the Raspberry Pi
- It has an LED to indicate the status. I soldered it onto the back of the PCB and drilled a hole into the back door. So I'm able to see the status.
- The buttons got wires and will be soldered on the PCB as well.
- Unfortunately the PCB comes pre soldered with a Micro USB. So I'll use a short Micro USB cable with only the power wires inside to connect the power input to the power supply.
- The power output comes unsoldered. Here I'll use a second Micro USB cable with only the power wires to feed the Raspberry Pi.
- The power supply female plug gets two pairs of wires soldered onto.
- The above mentioned short Micro USB cable and
- the wires to the display controller (cut the USB A plug and solder the wires to the plug)
This solves all the power problems mentioned above. As well as it gives you one USB port from the Raspberry Pi back. You now have 3 USB ports free and there will be about 600mA USB juice left (1.2A via max_usb_current=1 minus 600mA for the amplifier), allowing USB-Wifi or USB-Bluetooth to work properly (again).
I'll provide you with the .stl file after I finished prototyping the plate.
- Add to /boot/config.txt
max_usb_current=1 # give up to 1.2A to USB devices (newer firmware) safe_mode_gpio=4 # give up to 1.2A to USB devices (older firmware) disable_audio_dither=1 # remove static noise from speakers
- You need a python script to
- sense if the soft off button was pressed and
- signal the PiSupply Switch that the power can be cut off.
- save this script as pisupply.py in the root's home and give it a chmod +x
# Import the modules to send commands to the system and access GPIO pins from subprocess import call import RPi.GPIO as gpio import os import time # Define a function to keep script running def loop(): while 1: sleep(10) # Define a function to run when an interrupt is called def shutdown(pin): os.system("shutdown -h now") gpio.setmode(gpio.BOARD) # Set pin numbering to board numbering gpio.setup(7, gpio.IN) # Set up pin 7 as an input gpio.add_event_detect(7, gpio.RISING, callback=shutdown, bouncetime=200) # Set up an interrupt to look for button presses loop() # Run the loop function to keep script running
- Add this line to /etc/rc.local before exit 0
python /root/pisupply.py &
Bill of Material
- 4 M2.5 standoffs
- 4 M2.5x12mm screws
- Raspberry Pi On/Off Power Switch
- 2 Short USB Micro cable with only power wires
- 3 16mm Panel Mount Momentary Pushbutton (red, yellow, green)
- 2 Panel Mount USB Cable - A Male to A Female
- Panel Mount Ethernet Extension Cable
- 3D printed back plate
- some heat shrink tubing