PiJuice Games Console Project
This project will show you how to build a portable games console using the PiJuice and Media Center HAT. You will be able to play all of your Retro games anywhere with the PiJuice portable battery solution, combined with the Media Center HAT and a Bluetooth controller housed in a case, it is the perfect combination for a portable games project.
What you will need
You will need the following parts to build this project, some of what are only required for the initial setup procedure:
- Raspberry Pi Computer
- PiJuice HAT
- Media Center HAT
- Maker Kit Case
- Case clamp for Bluetooth controller
- Mouse and Keyboard (initial setup)
- 16/32GB micro SD card
- Bluetooth controller
Step 1 – First, you will need to separate the top half and bottom half of the Maker Kit case. You can do this easily by pushing the two shorter sides outwards and lifting upwards, sliding the top half up. The sides of the case are designed to give a little flex.
Step 3 – Add the PiJuice HAT to your Raspberry Pi board. Make sure that it is firmly pushed down on the GPIO pins.
Step 4 – Now we can add to the PiJuice HAT GPIO pins, the Media Center HAT. Push the GPIO connector on the Media Center HAT down as far as it can go.
Step 5 – Now take the Raspberry Pi with the PiJuice and Media Center HAT on and slide it into the case, making sure it aligns up with the grooves either side and also the connectors line up with the cutouts on the side of the case. Remember that the case can flex slightly either side to make it easier.
Step 6 – Carefully slide over the top, the top half of the make kit case. Slide it over the top and you should hear it click into place once it has aligned.
Step 7 – No lets place the case into the holder for the controller.
Unclip the bottom mount and add it to the controller, making sure it clips on the other side.
Slide open the holder at the top and insert the case.
The gaming software for this project is based on the latest version of RetroPie, which an operating system for the Raspberry Pi that runs a number of retro-gaming projects such as emulationstation, RetroArch and many others. It allows you to play all your favourite retro arcade games, home-console and some classic PC games.
Step 1 – Download RetroPie OS
Go to https://retropie.org.uk and download the latest image for the Raspberry Pi. Flash the RetroPie image to an 16GB or 32GB micro SD card using Etcher software. You can download Etcher from https://etcher.io .
Step 2 – Boot up RetroPie and connect to Wi-Fi
Before we begin to install the Media Center HAT software you will need to boot RetroPie and connect to your local Wi-Fi internet. You will need to connect a keyboard and mouse to the Raspberry Pi during this initial setup but then may be removed later on. You will also need to connect the Raspberry Pi to a HDMI monitor or TV until we install the Media Center HAT software.
Insert the microSD card into the Raspberry Pi and apply power either using the PiJuice or mains power. Pressing SW1 on the PiJuice will apply power to the Raspberry PI via the GPIO header.
When RetroPie boots up it will prompt you to setup gaming controls, this will also allow you to navigate its menu system. Go ahead and assign keys, you can skip others by holding down a key already used.
Once done you will see the emulationstation menu. In here enter the Retropie menu, which should be the first option in emulationstation. Once the Retropie menu opens up you should see an option which says “Configure WiFi”, select this to access the WiFi configuration menu. Select option 1 “Connect to WiFi network”.
The configuration program will then begin to scan for local SSID and show you a list. Select your WiFi router from the list and then enter your password.
Note: You can usually find your credentials on the reverse side of your router box
Once connected you will go back to the main WiFi menu where you should see an IP address assigned to the Raspberry Pi, you are now connected to your Wi-Fi.
Step 3 – Setting up the Media Center HAT
If you are in the emulationstation menu or RetroPie menu then press F4 to exit and go to the command line. In the command line enter the following command to install the media center HAT:
curl -sSL https://pisupp.ly/mediacentersoftware | sudo bash
Follow the install procedure and then reboot the Raspberry Pi. Then enter the following command to copy the framebuffer to the Media Center HAT:
sudo nano /etc/rc.local
Before the last line exit 0 add the following:
CTRL+O to save the changes and the CTRL+X to exit.
Now we need to change some of the output settings in the config.txt file so that it outputs the correct resolution for our Media Center HAT screen size, this will stop anything from getting cut off at the edge of the screen. To edit the file enter the following command:
sudo nano /boot/config.txt
In the config.txt file add the following or comment out and change the values of the following:
hdmi_force_hotplug=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt=320 240 60 1 0 0 0
Step 4 – Setting up PS3 Bluetooth Controller
- Navigate to the “RetroPie” icon in the Home Screen and select it using whatever key you mapped “A” to on your gamepad, and go to RetroPie Setup
- Once in the RetroPie GUI, choose [Manage packages] > [driver].
- Select PS3 Controller Driver (“ps3controller”), and then select [Install from source].
- If you have a Tpfoon PS3 Controller you need to go to
[Configuration / Options]>
[Install/Pair PS3 Controller (Clone support Shanwan)]
- If you have a Tpfoon PS3 Controller you need to go to
- Once installation completes, exit RetroPie setup and return to the EmulationStation Home Screen.
- Press “Start” to enter the EmulationStation Menu, and select Configure Input.
- Disconnect your PS3 controller from USB. Now hold the PS button on the controller down until you see the lights on it flash sequentially. The controller should now be connected via Bluetooth.
- Emulation Station should now detect another gamepad connected. Hold any button down on the controller to begin configuring it.
And you now have a functional PS3 controller over Bluetooth.
Some PS3 Controller clones (such as the Shanwan PS3 Controllers) will not connect over bluetooth until they are physically connected and removed from a normal USB connection. If you are having issues pairing a controller, try connecting it via USB for several seconds, disconnecting it, and then pairing it over Bluetooth.