Add RetroPie to Legends Ultimate Console

by markyharris in Circuits > Raspberry Pi

5663 Views, 6 Favorites, 0 Comments

Add RetroPie to Legends Ultimate Console

ALU RetroPie
alu25.jpg

Add RetroPie to Legends Ultimate Console

After purchasing the AtGames Legends Ultimate (ALU) from Sam's Club, I was impressed by the cost vs value it provided. I was also extremely impressed by the open nature in which they designed their product. This allowed for others to add their own games and provided a cool front end in which to choose a game to play. The most common, I believe is the CoinOpsX gaming system. This Instructable is not about setting up and installing the CoinOpsX system, but here is a link to a video that does a good job of explaining how to do so and is a must have.

This Instructable will focus on adding an RPi 4 with RetroPie installed in a way where it's unobtrusive, accessible, clean and using only the stock 12v Power supply provided with the unit. No extra power cords, power supplies, or power strips needed.

This setup utilizes a back lit push button to turn on/off the RPi safely (but a separate LED would work as well). The light in the switch will provide a visible indication of if the RPi is running or not. Also, a micro-SD card activity LED is utilized to indicate when the SD card is being accessed.

A 3D printer was used to create an Access Door into the back of the unit, so the RPi can be accessed and managed without the need to remove the back of the ALU. Finally, thin ribbon 90 degree HDMI and USB cables were sourced to minimize the cabling for the needed setup.

See the list of supplies to ensure you have the needed items. Many of which may already be available. Here is a link to an Amazon List which will provide all the items that was purchased for this project, though there are many other options. Amazon Item List Link.

Supplies

Major Items Only Listed here. See Amazon Item List Link above.

  • Raspberry Pi 4 Model B
  • Retropie 128GB 135,000+ Retro Classics for Raspberry Pi 4
  • Raspberry Pi 4 Case, iUniker Raspberry Pi 4 Fan ABS Case with Cooling Fan, Raspberry Pi 4 Heatsink
  • BINZET DC Converter Step Down Regulator 5V Regulated Power Supplies Transformer Converter (5V 3A 15W)
  • Flat Slim Soft FPV HDMI Cable Standard HDMI male straight plug to Standard HDMI Full HDMI Normal HDMI male 90 degree
  • Short Flat Slim Thin Ribbon FPC Micro USB Male 90 Degree Angled up to Standard USB A Male Receptacle 90 Degree

Setup RetroPie

RetroPieWebsiteLogo.png

Retropie Image

This project uses an RPi 4B with 2 Gig memory. The image used was purchased, rather than built simply because of the expediency. However, building your own RetroPie image with the ROMs desired is certainly an option, albeit time consuming. This image was purchased from Amazon, but I'm sure there are downloadable images available that would provide similar results. Note: you can also purchase this card directly from CrispConcept.com at a lower price (plus shipping). This site also has information on setting up RetroPie that is useful. Plus if there are concerns or questions, there is a contact address available there as well.

The image purchased came on a 128 gig micro-SD card ready to use. However I would strongly suggest backing up the image before using it. If you continue through all the steps, you will be making small changes to the image and while unlikely, its possible that something goes wrong. So having a backup is a must so you can easily reflash the SD card if necessary. If needed, download Win32 Disk Imager, available here. Create a backup image and store it in a safe spot. ETA Prime has produced a video on using Win32 Disk Image to back up RetroPie as well. You can watch this video for step by step instructions for backing up your RetroPie SD Card.

At this point it would make sense to use an HDMI monitor, keyboard and joystick (if available) to test the RPi and run RetroPie before trying to modify the image to accommodate the power switch and indicator lights. This is easier to do before installing it inside the ALU. Also, this step will help to get to know the RetroPie system and how it works.

If more information and help is necessary visit the wiki page for RetroPie at https://retropie.org.uk/docs/.

​OverClock the RPi

How to Overclock Raspberry Pi 4 To 2.0Ghz! All 4 Cores - With Benchmarks

OverClock the RPi

RetroPie benefits greatly from computing speed. This is why the RPi 4 is such a great choice to use with RetroPie. Luckily, the RPi 4 can be easily Overclocked to gain even more computing power. This Instructable will reference a number of YouTube tutorials by ETA Prime that do a great job of explaining the how-to's. And in this case his video on OverClocking was especially easy to follow.

So watch and follow along with this video above to complete this step.

Note: This is optional, and can cause issues especially if allowed to overheat. This can be mitigated by using a decent case with heat sinks and a fan. The one listed in the items list seems to do a great job of keeping the temps around 40 degrees C.

Before moving on to Step 2, be sure the RPi 4 can boot up normally into RetroPie and that the games are playable. If there is an issue, please correct them before moving on. The next 3 steps will go through setting up the an On/Off Switch, On/Off Indicator and SD Activity Indicator.

Add External Power On/Off Switch

RetroPie Add A Power Button / Switch Raspberry Pi 1 2 3
ALU Power Indicator Switch_bb.jpg

On/Off Switch

In this step we'll be adding the On/Off Switch. It is recommended that this be done outside of the ALU to insure everything is working prior to installing it. Be sure to have an idea of how long the wire should be for your final install, so as not to duplicate efforts unnecessarily.

The schematic above shows the basic wiring for the switch and indicators. This should help as a resource when wiring it all together.

ETA Prime's videos typically include text instructions in the body along with a text download. I duplicated those downloads for this Instructable to make it easier to get to. But all credit goes to ETA Prime.

The 'shutdown.py' file attached here is from the attached text file for ease of use. Just copy it to '/home/pi/scripts' directory that you created in step 11 of the text file instructions. Or you can copy and paste the code in the text file to manually create the script, as described in step 12 of the text file.

The text file provides the steps outlined in the video for easy access. There is a note added at the bottom of the file that needs to be amplified here.

NOTE:
Be sure that RPI.GPIO v0.7 and not v0.5 is installed otherwise Error 'RuntimeError: This module can only be run on a Raspberry Pi!' will occur.
I renamed the directory and .egg file in '/usr/local/lib/python3.7/dist-packages' then reinstalled with 'sudo pip3 install RPi.GPIO'. This updated it from '0.5.11' to '0.7.0' and the script worked properly.
If you decide to make the change to Python 3.7, be sure to alter the command in the 'rc.local' file from 'sudo python /home/pi/scripts/shutdown.py &' to 'sudo python3 /home/pi/scripts/shutdown.py &' otherwise it won't run at startup.
BTW: You could do the same for Python 2 in '/usr/local/lib/python2.7/dist-packages' as well, at which point you wouldn't need to alter the command in 'rc.local'.

This may have been an anomaly, but its mentioned here for completeness. The video uses an RPi3 and Python v2 to run the script. Since this project is using an RPi4, this may become something that needs to be addressed.

If this error does occur after following the steps in the video, go to the command line and enter 'pip freeze'. This will provide a list of the installed libraries. Locate the library named 'RPi.GPIO' and check it's version. If its not v0.7 or later, then update this library. Visit https://pypi.org/project/RPi.GPIO/ for more information.

Verify the switch is working properly before moving on to the next step.

Add External Power On/Off Indicator

How To Add A Power LED RetroPie Raspberry Pi 1 2 3 Or Zero
ALU Power Indicator Switch_bb.jpg
alu10.jpg

On/Off Indicator

The nice thing about using a backlit switch is that it gives the project a professional touch. However, it is perfectly fine to use a regular pushbutton and a separate LED to indicate power on/off if desired.

There is no code that needs to be added to the image, however as you'll see when you watch the video you will need to enable the RPi's Serial Interface using the utility raspi-config.

Now for the fun part. Depending on the Switch/Light being used, it may be necessary to add a transistor into the circuit to properly drive the backlight of the switch. So let's look at two possibilities.

  • If the light source is a 3.3v LED, then no transistor will be necessary. You would just follow the instructions as shown in the video and ignore anything dealing with a transistor in these instructions.
  • If the light source is a 5v LED (or Incandescent bulb) then a transistor will be necessary because the RPi GPIO pins are only providing 3.3v.

If you decide to use a light source that requires 5 volts, then the wiring diagram and circuit board picture attached above should guide you. You will probably notice the use of a capacitor on the diagram. This is not strictly required, but it was found that the On/Off Indicator light would 'flicker' badly without using it. For more information on the transistor used, visit this datasheet.

Note: The video used a GPIO Ground at pin 39. It is fine to use any available GPIO Ground pin if desired. You can use https://pinout.xyz/ as a resource to find other such ground pins.

Once you have completed these steps, your On/Off Switch should be able to control your RPi, and your On/Off Indicator should show you when the RPi is on vs off.

Add External SD Card Activity Indicator

Add An External Sd Activity Light Raspberry Pi 3 Retropie Or Raspbian
ALU Power Indicator Switch_bb.jpg

SD Card Activity Indicator

Some may find this unnecessary and this could easily be skipped. But it is always nice to have real feedback from the RPi as to what might be happening. This comes in handy when its necessary to diagnose a problem.

This step doesn't require a python script per se, but as you'll see when you follow the video the 'config.txt' file will need to get a new instruction added to the bottom. The text file attached below will provide the lines needed, or you could manually type the instruction into the 'config.txt' file if you prefer.

Here's the instruction that will be added;

# Use external LED as SD ACT LED

dtoverlay=pi3-act-led,gpio=19

Notice that it references 'pi3'. It was found to work just fine with an RPi4 without any change needed.

Be sure that the hardware is connected and working before moving on to the next step.

Downloads

Connect RPi for Power

alu8.jpg
alu3.jpg
ALU Power Indicator Switch_bb.jpg

Power for RPi

To keep the the ALU clean we won't be using the normal RPi's 5v power supply. Instead we will be using a 12v to 5v regulator to supply the needed power from the ALU's normal 12v power block.

Luckily we can power up the RPi by feeding +5v and Ground to the proper GPIO's. Looking at https://pinout.xyz you'll see that pins 2 and 4 are both 5v pins and pin 6 is ground. So we will be supplying +5v to pin 2 and Ground to pin 6 (or another ground if its handier) for the regulator.

As you'll see in the next steps, the regulator will be mounted to the back cover. So its recommended that a connector be placed on the wires coming from the RPi to the back cover for easy removal of the back cover, and easy access to removing the RPi through its access door.

Install RPi in Legends Ultimate

alu18.jpg
alu15.jpg
alu17.jpg
alu19.jpg
alu16.jpg
alu4.jpg

Install RPi in Legends Ultimate

Now that everything is working on the bench, its time to install into the Legends Ultimate unit (ALU).

  • Pull the Back Cover off, disconnecting the 3 cables from the back cover, one Cat5 and two 12v power cables.
  • Remove the screws securing the Front Joystick Panel from the case below the monitor. You may want to disconnect the cables and move this out of the way for now.
  • Using the flat HDMI and USB 90 degree cables purchased, insert them into the proper ports on the front of the unit and route them down between the case and Front Joystick Panel.
  • Use adapters to connect these cables to the RPi4, use the HDMI port closest to the power port on the RPi. The USB gets connected to one of the USB ports on the RPi.
  • Use double sided sticky tape to secure the cables somewhere under the plastic electronics box which is shown on the right of the picture of the opened ALU above. Be sure to leave slack on the ribbon cables in case its necessary to remove either the connectors from the ALU.
  • If you decided to use a Mini Keyboard, now would be a good time to plug the keyboard's wireless dongle into one of the USB ports as well.
  • Mount the RPi on the little shelf in the back of the ALU. Position it behind the panel on the back cover that the power supply connects to. We will be cutting an access hole above this panel in the next step.
  • Use Velcro to secure the RPi on the shelf.
  • Replace the Front Joystick Panel, but don't replace the back cover.

In the next step we will modify the Back Cover.

Modify Legends Ultimate Back Cover

alu14.jpg
alu11.jpg
alu12.jpg
alu13.jpg
alu20.jpg
alu21.jpg
alu22.jpg

Modify Legends Ultimate Back Cover

So as not to have to remove the back cover whenever access to the RPi is needed, an access hole is cut just above the plastic close out panel that the power supply and Ethernet cable connect to.

Attached are 3 STL files that can be used to 3D print the parts needed. They are;

  • ALU Access Door.stl - Door.
  • ALU Cut-Out Template.stl - Used to help mark the back cover for accurately cutting.
  • ALU Cover Short.stl - Optional, but it hides the HDMI, USB and short thumb drive on the front of ALU.

If a 3D printer is not readily available there are a few online services that the files can be sent to for printing. They are typically pretty reasonably priced. One such service is 3dhubs.com. The typical material used is PLA, and I believe it is the cheapest material to use as well. It also provides flexibility that is necessary for the release mechanism on the access door.

Another option would be to contact a local High School, Community College or University. Most now have a 'Makers Lab' and they may make their 3D printers available to the local public. They are reasonably priced as well.

Of course a door could be made out of most any material that is available. But the printed door add a nice finished look to the project.

At this point its time to take the Cut-Out Template and place it in its desired location. Keep in mind that the two 12v wires that connect to the inside of the back panel loop upwards and could be in the way if you position the hole too low on the back cover. See the picture above for an estimate. Obviously its possible to position the access hole towards the center of the back cover as well if desired.

Mark the hole using the INSIDE of the cutout template. Then when cutting, cut on top of the line, not on the inside of the line. In other words, 'eat the line' don't 'save the line'. The template was dimensioned just slightly too small so that the builder could fit the cover properly. Better to be too small, then too big.

Using your favorite wood working tools, cut out the marked area. Using a drill to provide the radius in the corners and then a skill saw worked quite well. The back cover material is not much more than cheap pressboard, so there will probably be some tearing on the back side. Use a razor to clean all that up. Then use black paint or a black marker to color the cut areas to match. This provides for a cleaner install.

This is also the time to drill the hole(s) necessary to position the Power On/Off Switch, Indicator and Activity Indicator. Depending on the arrangement, you would need anywhere from 1 to 3 holes sized to the components being installed. The location is flexible, but it is suggested to make it close to the side of the cabinet so access in real life is easy.

Once completed, the next step will be to install the Voltage regulator on the back cover.

Note: For those sharp-eyed individuals who noticed that the ALU Cover shown in the picture had the words backwards, the STL file is correct. So when printed the cover will show 'Legends Ultimate' rather than 'Ultimate Legends' as displayed in the picture above.

Install Voltage Regulator on Back Cover

alu9.jpg
alu6.jpg
alu7.jpg
rp1.jpg
alu1.jpg

Install Voltage Regulator on Back Cover

There is a simple circuit board mounted to the back of the panel that the 12v Power Supply connects to. This simply takes the input voltage and allows two connectors to tap off the 12v source. We will be tapping into this circuit board to allow for a 3rd 12v source to be provided to the 12v to 5v Voltage regulator.

There are 4 fastener holes molded into this regulator and interestingly, the front two (the two closest together) happen to fit the two end-screws that are already holding the plastic panel. It is highly suggested that an aggressive double sided sticky tape be used to hold the opposite end of the regulator to the back cover.

Once the regulator is in place, cut to length two wires. and solder one end of each to the locations shown in the picture. If there is doubt, use a multimeter to verify +12v and Ground. The other ends of the wires will be secured in the proper location on the Regulator. Be sure to connect these two wires to the 12v side of the regulator. The cover of the regulator is labeled clearly.

Next, if the On/Off Indicator chosen was a 3.3v LED, then there won't be a separate board with a transistor and capacitor to mount, so connect the 5v supply to the RPi. Again, its highly suggested that a connect be used so removing the RPi from the machine will be much easier.

If however, a transistor and capacitor circuit board was built to drive a 5v light source then mount that to the back of the back cover somewhere close to the regulator. Aggressive double sided sticky tape works quite well here as well. Provide the 5v and ground from the regulator to both the RPi and to the circuit board.

In the pictures above, notice that there is a discreet LED which is the SD Activity Indicator and a Push Button Switch which also houses a back light indicator. So the Transistor/Capacitor board simply take the +5v and Ground from the regulator and supplies it to the Switch's Back Light whenever the GPIO pin on the RPi provides the signal to the Base of the Transistor through a 1k ohm resistor.

Assemble and Test

alu5.jpg
alu2.jpg
alu3.jpg
alu4.jpg
alu23.jpg

Assemble and Test

At this point, the Back Cover should have the access hole cut, the regulator installed along with the On/Off Switch and Indicator(s). Everything should be wired to connectors so that the RPi has a pigtail of wires coming off ready to mate with the connectors coming from the regulator on the Back Cover.

  • Install the Back Cover into place.
  • Connect the two stock 12 volt cables to the Back Cover close out panel.
  • Connect the stock Ethernet cable to the Back Cover close out panel.
  • Connect the HDMI and USB cables to the RPi (these are coming from the front panel from early in the instructions).
  • Connect the connector coming from the RPi for the Switch and Indicators to the connector coming from the regulator on the Back Panel.
  • Finally, connect the stock 12v power supply to the back panel close out panel.

Test the Setup

  • Turn on the ALU and insure it boots up normally.
  • Press the button on the front of the unit that switches it from ALU HDMI to an External HDMI. It should come up with a message stating that there is no signal after a moment.
  • Press the On/Off Switch mounted to the Back Cover.
  • The Monitor should now show the RPi booting up into RetroPie. (The controllers won't work yet, so don't worry)
  • Check the On/Off indicator and SD Card Access Indicator on the Back Cover to insure they are working properly.

If all is working then its time to play games. Otherwise, back up and check things. Especially the wiring to see if anything separated.

Setup Controllers

There are a few ways to enable the controllers for use on the RPi. Specifically using Bluetooth or OTG (On The Go). These are settings available from the settings menu (see attached pic for example).

Note: AtGames seems to be actively improving the firmware and so the settings menu has and will continue to change from time to time.

This build utilizes the OTG option for using the controllers. This is why the USB is connected from the front to the RPi through the ribbon cable.

Enable OTG

  • When the RPi has been turned on and the HDMI source button has been switched to show the RetroPie display, switch back to ALU display.
  • Move joystick to select the 'Settings' as the top right of the screen.
  • Move the joystick down into the body of the settings.
  • Locate the OTG setting and hit the 'A' button
  • A message will come up at some point stating that the 'Legends Ultimate is no longer available', which signifies that the machine is now in OTG mode.
  • Switch the HDMI input back to the RPi and check to verify that the joystick now works.

At this point the RPi can now be controlled through the Joystick Control Panel plus if a wireless keyboard was installed, this will control the RPi as well.

It should be noted that depending on the circumstances, the machine may drop out of OTG mode which will be seen as the Joystick is inoperative. This happens from time to time and can be frustrating. To re-enable the OTG mode, switch back to the ALU's HDMI input and re-select the OTG mode from the settings menu.

Now its time to play. Good luck and have fun!

One last thank-you to ETA Prime for his expertise and clear How-To YouTube videos. Without this information, this Instructable would not have been possible.