© Mark Frauenfelder and Ryan Bates 2019
M. Frauenfelder, R. BatesRaspberry Pi Retro Gaminghttps://doi.org/10.1007/978-1-4842-5153-9_6

6. Installing the Electronics

Mark Frauenfelder1  and Ryan Bates2
(1)
Studio City, CA, USA
(2)
Pittsburgh, PA, USA
 

Now that the arcade has taken on its proper identity, it’s time to install the electronics (LCD, speakers, and amplifier), Raspberry Pi, and connect all to power. I like to start with the LCD, but if you have large hands, I would wait to install the LCD and jump ahead to the subsystems and subassemblies section. The LCD covers up a significant entry point to the inside of the cabinet. If you have trouble working in small spaces, you’ll find the following rather similar to decorating a cake inside a dimly lit tissue box.

Installing the LCD

The LCD mounts the same we designed it. Place the four screws into the cabinet, and slide the top and bottom LCD braces into place like in Figure 6-1.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig1_HTML.jpg
Figure 6-1

LCD mount installation; top and bottom TFT brackets

Slide on the plates that hold the LCD TFT in place (Figure 6-2).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig2_HTML.jpg
Figure 6-2

LCD mount with retaining brackets

Next install the ‘H’ panel (Figure 6-3), preferably with LCD's driver board already mounted to it.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig3_HTML.jpg
Figure 6-3

LCD cross brace “H” panel installed

Attach the ribbon cable from the driver PCB to the TFT panel shown in Figures 6-4 and 6-5.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig4_HTML.jpg
Figure 6-4

Back of TFT with LCD driver PCB, note cable connector

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig5_HTML.jpg
Figure 6-5

Connected driver PCB cable to TFT

I use some nylon spacers underneath this PCB (Figure 6-6); the through-hole components have some long legs poking out the bottom; nylon spacers help this board rest comfortably on the wood bracket.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig6_HTML.jpg
Figure 6-6

Nylon spacers for LCD driver PCB

Finish with nuts to complete this subassembly (Figure 6-7).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig7_HTML.jpg
Figure 6-7

H bracket with LCD driver PCB installed

Grab the LCD button panel wood piece. Add two spacers (optional) so the PCB rests flat and the through components are lifted off the wood (Figure 6-8).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig8_HTML.jpg
Figure 6-8

LCD button panel bracket with nylon spacers

Attach the button PCB with machine screws and nuts like in Figure 6-9.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig9_HTML.jpg
Figure 6-9

LCD button panel installed

Use the ribbon cable to connect the button panel control to the LCD driver PCB (Figure 6-10).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig10_HTML.jpg
Figure 6-10

LCD button panel ribbon cable connection to driver board

The button assembly is mounted with machine screws and nuts as shown in Figure 6-11.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig11_HTML.jpg
Figure 6-11

LCD button panel installed inside cabinet; inside view

This is a good time to install the cover plate for this area—below the marquee where we have a number of buttons. See Figure 6-12 and Figure 6-13.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig12_HTML.jpg
Figure 6-12

LCD button panel installed inside cabinet; front view

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig13_HTML.jpg
Figure 6-13

LCD button panel cover (trim) plate installed

Subsystems and Subassemblies

We’ve started connecting cables to dedicated PCBs.

From now on, I’m going to use illustrative representatives of some of these components as they are introduced (Figure 6-14). These diagrams show the parts and highlight only the essential ports, headers, and plugs required to wire the arcade.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig14_HTML.jpg
Figure 6-14

LCD driver and button panel, actual (top) and representative diagram (bottom)

Figure 6-15 shows what we’ve connected so far: mainly, only dependent connections in between the LCD, driver panel, and button panel.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig15_HTML.jpg
Figure 6-15

LCD, button panel, and drive PCB connections

The HDMI-compatible LCD I’ve chosen is video only. Later versions support audio, but this batch does not. Next is audio.

Figure 6-16 is off-the-shelf 2watt stereo audio amp board. There are many DIY audio amps out there; this is just one. This PCB gives enough audio output to fill a small bedroom (with the right speakers), so this should be plenty for this sized arcade machine. The board also have built-in volume control with buttons and external headers to route volume controls somewhere else.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig16_HTML.jpg
Figure 6-16

Audio amp (left) and diagram (right)

Matching speakers is easier when you have narrowed down your amplifier choice. This amp is compatible with speakers that have 4 to 8 ohms impedance. The speakers you select should be midrange speakers (Figure 6-17). This means these speakers can reproduce frequencies in (mostly) the full audio spectrum. Full-range speakers do not perform particularly well compared to dedicated speakers for dedicated low (subwoofer) or high (tweeter) frequencies. But we only have room for one pair of speakers, hence the choice for full range speakers. On this scale, this is our first big sacrifice, but you’ll likely won’t notice we skipped out on audiophile sound on 8- or 16-bit soundtracks. So, what speaker should we use? As big as possible. I’d pick the largest speaker (in physical size) you can fit in your cabinet. The size is proportional to the volume it can produce. This cabinet can comfortably fit all these sizes shown in Figure 6-18. Pictured are (from left to right) 3″, 2.5″, and 1-inch-diameter full-range speakers. Cheap speakers sound, well, cheap. The speakers pictured are about $4–$6 each or $8–$12. This is defiantly on the low range of things, but far from the bottom of available options. Considering I am not an audio engineer, I’d just be doing high-end audiophile speakers a disservice.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig17_HTML.jpg
Figure 6-17

Various speakers for this cabinet size

The 1 inch speakers will fit underthe marquee as we planned. These 1 inch speakers are for those who insist the speakers should be under the marquee. Figures 6-18 and 6-19 show a cross section of how I mounted these 1 inch speakers.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig18_HTML.jpg
Figure 6-18

One-inch speaker mount method

The mounting holes molded into the speaker baffle are ridiculously small; a #2 (~M2) screw doesn’t fit, so I opted for the sandwich method. More measuring is involved, but the mount is cleaner and more versatile if you wish to swap these speakers for say LED rings in the same location. (Hint, we’ll do that too.) The panel highlighted in green slips over the end of each speaker and retains them by being locked into the control panel with the centered nut and bolt.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig19_HTML.jpg
Figure 6-19

One-inch speaker mount method, alternate view

But what if you want that larger speaker sound?

The 2.5 and 3″-diameter speakers will fit inside this cabinet. They will face the back of the LCD and project to player. Since they are inside mounted the cabinet body, there will be accidental acoustic properties of our cabinet, both good and bad. Some ranges have a richer, fuller bass sound; other ranges will be a bit muffled. I have other plans for the interior space of this cabinet, so instead of using the 3″ speakers, let’s settle on 2.5″. We need to build the subassembly shown in Figures 6-20 and 6-21. This is done by mounting the speakers and amp with machine screws. Don’t forget to solder wires of the left and right speakers and connect them to the respective audio amplifier.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig20_HTML.jpg
Figure 6-20

Speaker and amp subassembly, rear view

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig21_HTML.jpg
Figure 6-21

Speaker and amp subassembly, front view

Since we are looking at the rear of this speaker subassembly, the stereo left speaker is actually wired to the right (your directional right) output and vice versa (Figure 6-22).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig22_HTML.jpg
Figure 6-22

Solder speaker wires

Don’t forget to mount two standoffs on this assembly. These are 1 inch female/female aluminum standoffs shown in Figure 6-23. These will come in handy later when we need an easy way to fasten the rear panel to cabinet.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig23_HTML.jpg
Figure 6-23

Aluminum standoffs

Use the two identical brackets shown in Figure 6-24 and mount the speaker subassembly into the cabinet, but don’t actually do it! We still need access to the interior the cabinet, so set this speaker assembly aside for now.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig24_HTML.jpg
Figure 6-24

Mount speaker subassembly with brackets

Updating our connection diagram brings us to Figure 6-25.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig25_HTML.jpg
Figure 6-25

LCD and speaker wiring so far

Control Panel Assembly

It’s time to assemble and wire the control panel for our arcade. There are two routes we can take with the control panel in conjunction with the Raspberry Pi. Because the Raspberry Pi has GPIO pins, we could use some software to poll the GPIO pins and interpret button presses and joystick inputs as keyboard inputs. The other route (and more universal) is using a keyboard encoder. The keyboard encoder is exactly as it sounds; it takes discrete inputs and encodes them to keyboard signals. You press a button, and the Raspberry Pi (or any PC that accepts USB HID devices) see a keyboard key activated. This is simple and essential component to build large-scale Multiple Arcade Machine Emulator (MAME) cabinets. It’s also my recommended way for MAMES with two or more players. I prefer keyboard encoders for single-player RPi cabinets too; that’s more because many of these encoders include wiring harnesses and I hate wiring. We will look at each approach.

In either regard, we need to populate our control panel and assemble the layers. First, mount the joystick (Figure 6-26) with flat head screws and split washers to keep the nuts secure during heavy use.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig26_HTML.jpg
Figure 6-26

Control panel with joystick, bottom view

If you printed, cut it out and place it on the top of the control panel. Place the clear acrylic over and fasten with the binding posts (Figure 6-27).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig27_HTML.jpg
Figure 6-27

Control panel assembly with binding posts

Insert your buttons of choice. I’m using some smaller general-purpose push button above the arcade to save not just space but cost. You should have something like Figure 6-28 or 6-29 now.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig28_HTML.jpg
Figure 6-28

Assembled control panel, no artwork

You can place the joystick dust cover (the flat, black plastic disk) on now and screw on the ball top if you like.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig29_HTML.jpg
Figure 6-29

Assembled control panel with artwork layer

Flip the control panel over; now it’s time to wire each input to the keyboard encoder, pictured in Figure 6-30. If you bought your encoder on eBay, hopefully (and usually) it came with a wiring harness.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig30_HTML.jpg
Figure 6-30

Generic keyboard encoder top and bottom of PCB

This takes all the pain out of a rather tedious and repetitive task. Figure 6-31 shows a fully wired control panel. Each button gets a wire pair and plugs into its respective place on the encoder. More arcade keyboard encoders will have some generic wiring labels (button 1, button 2, or K1, K2, K3 in our example) to guide you.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig31_HTML.jpg
Figure 6-31

Wired control panel underside with a keyboard encoder PCB

Note the USB type B female connector on this keyboard encoder. The included USB cable will connect the encoder to your Raspberry Pi (Figure 6-32).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig32_HTML.jpg
Figure 6-32

Wired keyboard encoder with USB cable

We haven’t installed the Raspberry Pi into the cabinet yet and for good reason. Another option for implementing arcade controls is done by wiring directly to the Pi’s GPIO headers. It’s best to do this with easy access to the Pi, before it’s mounted into the cabinet.

The extra software you need is Adafruit’s Retrogame found here at their github repository: https://github.com/adafruit/Adafruit-Retrogame

I recommend following the associated instructions from Adafruit: https://learn.adafruit.com/retro-gaming-with-raspberry-pi

Installation can exist on top of any RetroPie; install with the following script:
cd
curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh >retrogame.sh
sudo bash retrogame.sh
Adafruit’s Retrogame utility can be configured with a config file located:
/boot/retrogame.cfg

Because this file exists in/boot, you can edit it easily: either locally on the Pi or remotely via SSH.

The configuration file maps whatever you have connected to useable GPIO pins and simulates keyboard keys as buttons are closed, triggering GPIO pins low. Within the config file, you can assign GPIO pins and what corresponding keyboard key is triggered. Table 6-1 is an example sort-of-universal-for-most-emulators config file I use. It reads as Keyboard KEY | GPIO pin#| Arcade Input.
Table 6-1

Retrogame one-fits-most sample configuration

Keyboard KEY

GPIO pin #

Arcade Input

UP

2

Joypad Up

DOWN

3

Joypad Down

LEFT

4

Joypad Left

RIGHT

17

Joypad Right

A

22

"A" button

B

27

"B" button

X

23

"X" button

Y

24

"Y" button

F1

8

"Menu" button for retroarch

RIGHTSHIFT

10

"Select" button    (Console)

ENTER

9

"Start" button    (Console)

1

18

"Start 1P" button    (MAME)

ESC

7

"Escape" key to exit ROM

R

11

"R" button

L

25

"L" button

Wiring the joystick and buttons inputs to the RPi is simple since no pull-up resistor or additional hardware is needed. It is a tedious task to wire ten buttons with four directional inputs, all with a duplicate path that returns to ground. There is something we can do to assist with what goes where.

I’ve wired this before, hundreds of times. And I despise it. So, to ease the pain, I’ve got a few pro-tips or quality-of-life improvements. We’ve already settled on a button/keyboard mapping as defined in the example config file. Trust me, you want to settle on something before continuing.

We are going to make another cheat sheet! Just like the one in Chapter 6, but instead of GPIO numbers, we just put the intended arcade controls on the sheet. See Figure 6-33.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig33_HTML.jpg
Figure 6-33

GPIO cheat sheet for arcade inputs

Print this out to scale and smash it onto the RPi’s GPIO headers. Now we don’t need to go back and forth translating what button input is assigned to what GPIO pin. Following the cheat sheet, the “Start” button is wired like in Figure 6-34.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig34_HTML.jpg
Figure 6-34

Arcade connections to GPIO headers; Start button wired

Just repeat the signal and ground wire connection for the rest of your buttons and joystick inputs. Speaking of joystick inputs, this is another one of those mirrored image brain teasers. If you’re looking at the bottom of your Sanwa joystick (you likely are at this step), the directional inputs are arranged like in Figure 6-35.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig35_HTML.jpg
Figure 6-35

Joystick and GPIO input labels

I usually transcribe this in pencil on the underside of the control panel as I’m wiring. Basically, do as much prep work in advance to avoid wiring something wrong. This is usually (it will happen to you) where a wiring issue will arise.

Keeping with the unfortunate theme of wiring diagrams, if you wire all your arcade inputs to the RPi, it’ll look something like Figure 6-36, but with fewer straight lines. If you are a messy point-to-point wirer, rest assured! We’ll just stuff that mess away in the cabinet to definitely not have to troubleshoot later. My button layout is just that, my button layout. If you want to move placements around or enable hotkeys, do so! Please take some time to stare at this diagram. It’s very helpful and also took too much to draw.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig36_HTML.png
Figure 6-36

Raspberry Pi arcade input wiring diagram

Note

The button labels in Figure 6-36 are not only a general emulator/console mapping but also the literal keyboard keys they trigger. The exceptions are Enter and Right Shift; these trigger "Start" and “Select”, respectively. The “x button = x key”, “a button = a key” idea was to not confuse myself. This scheme has caused me some, but not a lot of confusion in hindsight.

You’ve either got no wires connected to your RPi right now (you’re using a keyboard encoder) or a pile of spaghetti poking sticking out of the Pi’s GPIOs. Either way, the control panel is complete. This is a great time to mount the Pi into the arcade. Place the control panel into the arcade and add the locking bar like in Figure 6-37.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig37_HTML.jpg
Figure 6-37

Underside, control panel lock bracket

Add two screws into the rear of the control panel cross brace, and loop a rubber band over these around the control panel locking bar (Figure 6-38). I still have not drawn a rubber band here.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig38_HTML.jpg
Figure 6-38

Rubber band that I don't know how to draw to lock the control bar

This will keep the locking bar in position. Place the long screw through the top of the control panel; fasten with a thumb or nut (Figure 6-39).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig39_HTML.jpg
Figure 6-39

Thumb screw to lock control panel into cabinet

Next, focus to the rear of the cabinet (Figure 6-40).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig40_HTML.jpg
Figure 6-40

Side, before mounting Raspberry Pi

Add the Raspberry Pi riser plate along with four mounting screws (Figure 6-41).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig41_HTML.jpg
Figure 6-41

Riser plate for Raspberry Pi

Add nylon spacers (optional) so pressure is transferred into the RPi PCB and not the through components protruding under the RPi. Mount the Pi, add nylon spacers, and fasten with nuts (Figure 6-42).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig42_HTML.jpg
Figure 6-42

Mounted Raspberry Pi

With the integration of the main control panel, we need to populate and wire the remaining buttons in the cabinet. Figure 6-43 shows some extra hardware needed.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig43_HTML.jpg
Figure 6-43

New switches and buttons. From left to right: 5.5x2.1mm DC barrel jack, latching on/off switch, latching button (green), and momentary button with LED (red)

Figure 6-44 shows where we add some extra function buttons under the marquee, two of which we will use for amplifier’s volume up and volume down. The remaining two will be latching switches, of which are placeholders for optional features later on.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig44_HTML.jpg
Figure 6-44

Added function buttons under marquee

First solder wires to the buttons and switch contacts. Feed the wire into the mounting hole followed by the attached buttons and switches (Figure 6-45). Attach the plastic retaining washer from the inside.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig45_HTML.png
Figure 6-45

Extra function buttons installed in cabinet

The rear of the cabinet has two large access panels (Figure 6-46) to help us wrangle these wires.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig46_HTML.jpg
Figure 6-46

Inside cabinet with wired extra function buttons

The volume buttons are wired like in Figure 6-47, giving us volume control from the front of the cabinet.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig47_HTML.jpg
Figure 6-47

Speakers, amplifier, and volume button wiring diagram

With the rest of the hardware placed in the cabinet along with the appropriate controls (on/off switches) installed like in Figure 6-48, it’s time to wire power. These switches will control power, the backlight marquee lights. On the rear of the panel, we also mount the DC input jack, where main power enters the cabinet.

There’s a lot to talk about in the next steps, so new heading!
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig48_HTML.jpg
Figure 6-48

Power switch, input power connection, and switch

Powering Wiring

The section is most likely the most complicated part in the arcade build. The task ahead has a lot of details within it, and if you’re unfamiliar with basic electronics, it’s like you could be following a guide with no intuition of right or wrong. The room for error is high due to the number of wiring connections, and the margin for error is even higher for those unfamiliar with circuit basics. Because this task is complicated and laborious, I’ve tried to simplify it for myself because I’ve had to wire many mini arcade cabinets. I made this custom PCB (Figure 6-49) that does two things: First it distributes power and routes all power terminations to screw terminals. This makes for easy integration of on/off switches and provides simple connections to various components of an arcade (Figure 6-50).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig49_HTML.jpg
Figure 6-49

Ryan’s custom Power Block Arcade PCB, for wiring mini arcade machines. Pictured left is PCB; right is schematic

This makes for easy integration of on/off switches and provides simple connections to various components of an arcade (Figure 6-50).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig50_HTML.jpg
Figure 6-50

Arcade electronics and switches we need to wire

No need for cumbersome wire splitting and routing. This PCB provides a straight connection to every integral component (LCD, amplifier, LED backlight, power switch, etc.). It also simplifies the connection of the step-down converter. We’re going to power this arcade off of one single AC adapter that outputs 12VDC. We can power most of the arcade electronics at 12V; that’s including the amplifier, backlight LEDs for the marquee, and the LCD screen. However, the Raspberry Pi cannot take 12 volts. We have to step down this 12 volts to 5 volts. The way we do this is with a step-down or buck converter module. This is an adjustable module, so you must first power it with the input voltage and connect a voltage meter to the output. Using the adjustable trim pot in our step-down (buck) converter (Figure 6-51), turn this until the output is around 5.15volts (Figure 6-52).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig51_HTML.jpg
Figure 6-51

DC-DC step-down converter with trim pot being adjusted

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig52_HTML.jpg
Figure 6-52

DC-DC step-down converter adjust to output 5.2 volts

The Power Block Arcade PCB integrates the buck converter with simple terminal connections for the other arcade components. First we’re going to center around that PCB which I’ve shown in Figure 6-53 assembled with buck converter and related hardware.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig53_HTML.jpg
Figure 6-53

Power Block Arcade PCB; bare PCB (left), assembled (right)

The big picture is shown in Figure 6-54 with all the critical components wired into the central power block (if removed from the cabinet shell). The rocker switch controls the main power to the entire arcade, while the green switch allows the user to tune the backlit marquee on or off during play.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig54_HTML.jpg
Figure 6-54

Overview of all electronics wired without the cabinet

Figure 6-55 illustrates how to wire this together.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig55_HTML.jpg
Figure 6-55

Basic power connections to electronics: Raspberry Pi, LCD, audio amp, and input power supply

Fortunately, most of the hardware I’ve selected is OEM and is manufactured with the intent for modular installs. The amplifier and LCD driver panel have DC input jacks for power (Figure 6-56).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig56_HTML.jpg
Figure 6-56

DC input jacks on audio amp and LCD driver boards

Another off-the-shelf part courtesy of the CCTV industry will make connecting power the custom PCB simple; we’ll use a DC pigtail cable (Figure 6-57).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig57_HTML.jpg
Figure 6-57

DC pigtail

Just make sure to verify the polarity is correct before supplying power. All these parts pictured require center-positive barrel jack connectors. That means the center of the DC plug is positive and the outer sleeve is negative (ground actually). You likely have seen this before on the end of your AC-DC power supply (Figure 6-58) without knowing what it means.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig58_HTML.jpg
Figure 6-58

A 12 volt, 3 ampere power supply with center-positive barrel end

What’s in a Quality Part?

Now is a great time to mention our main power supply feeding the arcade cabinet. It is generic in branding; however, it does retain some notable features:
  • Outputs 12VDC @ 3A (enough power for this arcade without pushing our power supply to it’s limits).

  • Plug is center-positive (pretty common, somewhat standard in 12V DC power supplies).

  • UL listed with the file number (passed some rigorous testing; implies a quality power supply; we can probably trust the three ampere rating).

  • Long cord= very convenient.

There are many generic 12V power supplies. The aforementioned characteristics are ones to lookout for. In particular, we need enough current to power all our electronic components; 2amps is about what the arcade consumes, but picking a supply that outputs 2 amps wouldn’t give us any headroom. Any cheap supply (non-UL listed) might be able to meet a 2 amp continuous draw, but for how long before failure? Give yourself a safety factor of 50%. The power supply will have a longer lifespan and provide a more stable output if its normal operation is not bordering its specified output limits.

Our power supply is UL listed. A lot of generic supply might use the Underwriters Laboratories (UL) insignia falsely to be more marketable or appear “safe.” We can actually search this file number on UL’s web site (Figure 6-59) and see UL listed corroborating records.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig59_HTML.jpg
Figure 6-59

UL listed power supply record

And there it is, the model number and manufacture. This all checks out fine. If we explore more, like the UL standard this power supply was tested against, we can identify what the intended use of this power supply is. A few clicks and links later, we find the standard: UL 6500: Standard for Audio/Video and Musical Instrument Apparatus for Household, Commercial, and Similar General Use. Even better. If you had $1,635, you could purchase a digital copy of this standard and determine what safety features the power supply might contain (over current, thermal shutdown, short-circuit protection) and what tests it passed to become UL listed (electric shock, resistance to fire, impact/drop testing, etc.).

That was sort of a sidebar, but it’s a quick glimpse into what separates quality electronics from everything else. It’s the largest contributor to cost too. One thing to note is, just because this arcade is connected to a UL listed power supply does not dictate the rest of the arcade can adopt the same pedigree. Just because the power supply is “safe” does not mean everything downstream is also safe.

Connect an HDMI Cable

Remember our wiring diagram? Here’s an updated diagram; Figure 6-60 illustrates power wiring up to this point.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig60_HTML.jpg
Figure 6-60

LED strip with on/off button wired into cabinet

We are missing some audio and video connections. Connect an HDMI cable (1 ft preferably) between the RPi and the LCD driver. We also need a 3.5mm stereo audio cable between the RPi and the audio amp like in Figure 6-61.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig61_HTML.jpg
Figure 6-61

HDMI and audio cable connections

Ground Loop Fixes in Audio

Before we power on the arcade, I’m going to add a fix to a problem that might be present in this, and many other DIY arcades. We are using analog audio and have an unintentionally ground loop. Our setup has an unintentional ground loop. We made two return paths for ground: one between the amplifier ground and the Raspberry Pi’s DC power ground. The power-plane ground and the audio ground have the same reference and share a path. You can see this path or loop highlighted in Figure 6-62. This means the return to ground power path can travel through our audio ground and cause some unwanted audio noise and interference.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig62_HTML.jpg
Figure 6-62

Ground loop path

To fix this, we need to isolate the audio signal ground or break the electrical continuity in analog ground. Since audio is analog, we can use a transformer to isolate the audio path which breaks the DC ground path but still lets analog signals pass through. We do this with two small transformers. In comes another custom PCB (Figure 6-63). This ground loop isolator.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig63_HTML.jpg
Figure 6-63

Ground loop isolator PCB diagram (left) and schematic (right)

It is merely two analog stereo audio jacks with a transformer for the left channel and another transformer for the right stereo channel. Let’s add that to our audio line shown in Figure 6-64.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig64_HTML.jpg
Figure 6-64

Ground loop isolator in line with Raspberry Pi and audio amplifier

This audio abnormality is common in systems with two different power references. Let’s say you’re listening to music on your phone or MP3 player through a physical connection to your car stereo’s auxiliary jack (before Bluetooth was standard). If you plug your phone or MP3 player’s charging cable while listening to music, you might hear a hum or buzz in the audio. This is another scenario where a ground loop occurs. The fix is the same. You can easily buy a ground loop isolator for about $8, but it’s only $1.20 in parts, so why not make it? We’ve gone this far building the arcade, what’s one more custom part?

Buttoning Up

Nothing else to do but close up the arcade! I went the extra length to design an internal shelf for storage for an extra controller for player two or the power supply when not in use. Let’s bolt in the side brackets and install the shelf like in Figure 6-65.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig65_HTML.jpg
Figure 6-65

Internal shelf for storage

Speaking of storage and unnecessary parts, I also made a small bracket that bolts onto the rear panel (Figure 6-66). This gives some space for a wireless keyboard or other accessories.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig66_HTML.jpg
Figure 6-66

Rear storage

Now fasten the rear panel with two bolts (Figures 6-67 and 6-68).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig67_HTML.jpg
Figure 6-67

Rear panel

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig68_HTML.jpg
Figure 6-68

Bolt connection to fasten the rear panel to the speaker bracket subassembly

Remember bolts connect to the standoffs mounted into the speaker subassembly. See the cutaway in Figure 6-68.

Add the top access panel (Figure 6-69).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig69_HTML.jpg
Figure 6-69

Top access panel

Bonus Upgrades

There are a few little extra touches you can add to really make your cabinet pop. In the next few steps, I outline how to go above and beyond for a few little extra cool bonus features.

Animated LED Marquee

First off, the marquee gets an upgrade. Replacing the static backlit graphic panel is an 8x48 LED matrix driven by an Arduino Nano inside. Figures 6-70 and 6-71 show the 8x48 LED matrix segment fitted to a mounting panel and driven with a custom Arduino clone board (not in the arcade). The individual 8x8 matrix segments are MAX7219-based modules, easily found on eBay (about $4 for a series of four connected matrices).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig70_HTML.jpg
Figure 6-70

LED matrix in bright light

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig71_HTML.jpg
Figure 6-71

LED matrix in low light

The required Arduino libraries to drive them are MD_Parola and MD_MAX72XX. A future project for me is to drive them with the Raspberry Pi and write a script that scrapes the ROM name currently loaded and pushes the string to the marquee. Someday.

Battery Powered

I mentioned in Chapter 5’s Design Review, this arcade is small enough to make it battery-powered. Let’s give that a try! After all, we have the room and planned for this: the larger cabinet size and the internal storage shelf. I have some Ryobi power tools I use at home, so let’s see if we can utilize a battery pack readily available, the cordless Ryobi battery in Figure 6-72. This can be any drill battery you have or any battery pack that outputs at least 12V.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig72_HTML.jpg
Figure 6-72

Cordless drill battery pack to make a portable mini arcade

I rebuilt the inner shelf as a power regular with a custom step-down converter. Since the drill battery is 18v (nominal), we need to step the voltage down to the input power we design the arcade electronics to run off, 12v.

The rebuilt inner shelf shown in Figure 6-73 has a custom 3D printed bracket (Figure 6-74) that contacts the battery’s + and – terminals when inserted. With this battery, I get about 2.5 hours of run time; that’s with normal screen brightness and medium sound volume.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig73_HTML.jpg
Figure 6-73

Battery power regulation shelf

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig74_HTML.jpg
Figure 6-74

Pictured center, custom 3D printed battery clip to interface with battery packs

The battery voltage, which varies from 20v to 16V (from fresh to dead charge) is regulated and passed to the arcade. You can see the current voltage of the battery pack in Figure 6-75. I have plans to make a battery level indicator on the outside, rather than having to peak at the number to determine when the battery is near empty charge.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig75_HTML.jpg
Figure 6-75

Mini arcade running off a drill battery

Neo Pixel LED Lighting

My last modification features some Neo Pixel LEDS that add some multicolor glow to the arcade (Figure 6-76). These Neo Pixels are individually addressable, so each LED’s color can be assigned in a stip.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig76_HTML.jpg
Figure 6-76

Neo Pixel LEDs inside arcade for some flare

The extra buttons below the marquee toggle if these LEDs are on or off; since now that we have battery power, we want the ability to turn off nonessential features when playing the arcade. With the top access panel in place (Figure 6-77), this gives a dark room a soft glow from the inside LEDs.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig77_HTML.jpg
Figure 6-77

Glow from interior LEDs

Finally, remember our design used the 2.5 inch speakers mounted behind the LCD? I demonstrated how to mount 1 inch speakers below the marquee, but in the end we did not install them. So, what did I do with that space? The same mounting principles applies, but this time I mounted some Neo Pixel LED rings (Figure 6-78).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig78_HTML.jpg
Figure 6-78

Neo Pixel “Jewel”

You might have noticed a multicolored glow earlier; this is the Neo Pixel ring (Figure 6-79).
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig79_HTML.jpg
Figure 6-79

Mounting a Neo Pixel cluster below the marquee

Keyboard for a Joystick

Retro arcade games work great on arcade joysticks. But what if your fancy is more PC-based? Some retro PC shooters emulated on DOS box perhaps? Compared to a keyboard, an arcade joystick does not have the same feel when playing 1990’s First Person Shooters. Let’s replace that joystick with a keyboard PCB! First, the custom PCB design in Figure 6-80. I’ll refer to this as a key-stick because I can’t think of anything better to call it. I’m still experimenting with the idea at this time.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig80_HTML.jpg
Figure 6-80

Keyboard-joystick PCB, first revision

Next, solder keyboard switches (Cherry MX of course) and resistors for 3mm LEDS in Figure 6-81.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig81_HTML.jpg
Figure 6-81

Rear view of key-stick, soldering resistors

Though optional, you can’t call yourself a gamer unless you have backlight mechanical keyboard keys (professionals have RGB backlit keys). Refer to Figures 6-82 and 6-83 for LED installation and backlight testing. Why red LEDs? It’s what I had. Why orange keycaps? Again, it’s what I had. I didn’t plan for this very well.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig82_HTML.jpg
Figure 6-82

Solder LEDs to PCB

../images/472493_1_En_6_Chapter/472493_1_En_6_Fig83_HTML.jpg
Figure 6-83

Add keycaps to key-stick

You might notice two “Esc” keys. The keycap sample packs I bought only have so many unique keys. Let’s just call it a place holder for now.

The control panel requires an overhaul. I wanted to avoid this looking like a drop in number pad, so I’m only using eight keys plus two offsets. Figure 6-84 shows the rear view of the control panel. This is mounted the same way, with four flat head screws.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig84_HTML.jpg
Figure 6-84

Control panel (rear-view) to mount key-stick

Note the two pencil lines. To make this key-stick a nontrivial hardware swap, I wanted the main arrow keys to match the exact same order of the Sanwa-JFL joystick. The arrow keys are wired as such on the PCB. To facilitate that easy swap, the interface needs to match; male 0.1" headers are the choice. I have a right-angle header sticking out of the key-stick in the same fashion as the Sanwa joystick earlier. The pencil line in Figure 6-84 indicates where this header is soldered to the PCB. The header is through-hole and protrudes out of the PCB—same side that needs to mount under the control panel. I have to mill out some wood with a rotary tool; otherwise, the key-stick will not sit flush on the control panel. Figure 6-85 shows the routed channels.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig85_HTML.jpg
Figure 6-85

Routed channel to make way for soldered PCB headers

Finished product is shown in Figure 6-86. I think I will move the keypad up about an inch. My wrist could use some more room when using this keypad.
../images/472493_1_En_6_Chapter/472493_1_En_6_Fig86_HTML.jpg
Figure 6-86

Key-stick prototype control panel with Doom theme

I’m pretty happy with the key-stick as a concept. I just wanted to showcase some ideas that can motivate your arcade to something very custom. You can still incorporate the traditional trackball setup too, but never be afraid to experiment.

Don’t think the custom PCBs are a cost-prohibited accessory. If you ever need to design and layout a custom PCB, try Eagle CAD, KiCAD, or EasyEDA. Getting custom and professional PCBs are surprisingly cheap. These PCBs were about $0.50 plus shipping. Seeed Studio, JLB PCB, and PCBway are cheap, low-quantity manufacturers great for prototype circuit boards.

Summary

Thanks for reading and following along. If it was your first introduction to arcade building and you’re feeling a bit overwhelmed, don’t worry! The best place to start is anywhere, as long as you start. Do not be concerned about the end result, you can only be accountable for the work you’re doing now—focus on the task at hand. Every arcade you build, your skills will increase. The next arcade you build will reflect this. I’ve been building for a long time.

The next chapter will focus on a two-player arcade design, a sort-of hybrid to the mini arcade (not portable, but transportable) and on a scale that’s a bit more practical for extended play.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.93.44