The PinSim VR cabinet puts the feel of real pinball in your hands. Built and tested by Anthony Lam, Make: Labs. Cabinet art by James Burke.
The PinSim VR cabinet puts the feel of real pinball in your hands. Built and tested by Anthony Lam, Make: Labs. Cabinet art by James Burke.
M52_Cover_LoRez
Read articles from the magazine right here on Make:. Don’t have a subscription yet? Get one today. On the cover: NASA’s JPL is using VR tech to create the next Mars rover. Illustration by Viktor Koen.

I attended the Oculus event at GDC this year, where I first heard Pinball FX2 VR was in the works. I tried the game and after 5 minutes I knew I wanted to build a VR interface for it!

VR solves my biggest gripe with traditional “virtual” pinball games — you can’t move your head around to get a better read on shots or the ball. Well, now you can. And with my PinSim cabinet you can actually feel the game in your hands too. I’m sharing the SketchUp files, dimension renders, wiring diagram, and Arduino code so that anyone can make one. You can order my custom PCB or just use an ordinary breadboard. The latest sketch can always be found on GitHub.

The VR pinball cabinet is essentially the first 8 inches of a real pinball table. My original cabinet was made from foamcore but wood will provide a more lasting frame. Just make sure to consider the width of your material in cutting the sides of the cabinet. My drawings show the exterior dimensions and button hole placements, but the diameter of the drill holes will depend on the buttons you choose to use.

The joystick is used to conveniently navigate the game menus. And an accelerometer is used to simulate nudging the table, which can help you guide the ball or can backfire (“Tilt!”) just like the real game, if you overdo it.

cabPinballCompare copy

My First Build

One week before the Oculus release date I made a trip to Walgreens and picked up two sheets of foamcore. I already had everything else (I’ve collected real pinball games for years, and I’m a compulsive Adafruit buyer).

I started by measuring the front body dimensions of a real pinball game and then cut a 1:1 replica from the foamcore. Then I measured for button placement, cut those, and glued the whole thing together overnight. Then I measured accurate body height and attached legs using off-the-shelf leg bolts and brackets. The buttons and joystick are pretty generic (Figure A). It was important that the flipper buttons don’t “click,” so it would feel realistic. I thought I’d have to install real pinball leaf switches, but these silent 30mm translucent buttons from Adafruit work great.

Figure A. Photography by Jeremy Williams
Figure A. Photo by Jeremy Williams
Photo by Abra Williams
Photo by Abra Williams

Everything ties into a Teensy LC microcontroller connected via USB to the computer. The Teensy has a mode that conveniently fools a computer into thinking it’s a generic gamepad, so the code simply turns grounded pins into emulated gamepad button presses. There’s also an accelerometer that converts X/Y movement into an analog gamepad stick for nudging the table. The Start and Launch Ball buttons have lights pre-installed, so I just connected these to the USB 5V line.

The biggest hurdle was getting the game to recognize the gamepad. Unfortunately the Teensy doesn’t support Xinput, and the Pinball FX2 VR game only supports Xbox gamepads. I found a wonderful open source program called x360ce that converts gamepad signals to Xinput, and later I upgraded to the incredible MSF-XINPUT library by Zachery Littell. It fools the computer into thinking the Teensy LC is an Xbox 360 gamepad, thus minimizing latency and maximizing compatibility. It even supports force feedback rumble! Zack spent time improving his library to assist with this project, so major thanks to him.

Building Your PinSim

PinSim Cabinet Build Notes
From Anthony Lam, Make: Labs

Photo by Anthony Lam
Photo by Anthony Lam

» To cut the plywood, a table saw is ideal. You can also use a band saw or handsaw; it’s safest to measure exact dimensions and cut at a 1/8″ offset, then sand the excess down to the marked dimensions so everything fits precisely.

» Test-fit the corners together using the cabinet leg protector. This not only helps you plan a butt joint for the boards, it also lets you trace the drill points for the leg bolts.

Photo by Anthony Lam
Photo by Anthony Lam

» The front panel’s top edge is cut at a 14˚ angle to match the rake of the top. And the top panel’s front and rear edges are cut similarly to fit flush with the other panels.

P1050026 copy
Photo by Anthony Lam

» We left our top panel free floating for now, resting on short wood screws as stops, in case we want to make upgrades. You can also screw it directly to the other panels and then touch up the paint.

P1050095 copy
Photo by Anthony Lam

Here’s how to make the upgraded version of the PinSim controller (Figure B). (Portions of this guide appeared previously on Tested.)

Figure B
Figure B. Photo by Hep Svadja

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Project Steps

1. CONSTRUCT YOUR CABINET

Cut the panels and drill holes for your buttons, joystick, and legs, following these SketchUp drawings (Figure C). The holes for the leg bolts can be tricky, because they enter at the corners at 45° angles. I recommend drilling these from the inside out. Paint your cabinet (optional) before bolting the legs on.

Figure C
Figure C

2. WIRE THE ELECTRONICS

YouTube player

Follow the wiring diagram (Figure D) and Teensy pinout (Figure E). After I showed off my first PinSim cabinet on Tested (which you can watch in the video above), I created a custom PCB at OshPark to replace the breadboard; just solder the female headers and screw terminals to the board where indicated. Or you can stick with the breadboard build.

vrPinballWiring
Figure D. Click for larger version
Figure E. Photo by Jeremy Williams
Figure E. Photo by Jeremy Williams

3. MOUNT THE ELECTRONICS

Mount the joystick on the top panel according to its mounting plate, wherever you think it fits best. (You could use a gamepad for this instead.)

Install your breadboard or PCB on the underside of the top of the cabinet so that the accelerometer is positioned horizontally at center, toward the front (Figures F and G). This will give the most accurate readings.

Figure F
Figure F. Photo by Jeremy Williams
P1050096
Figure G. Photo by Jeremy Williams

4. PROGRAM THE TEENSY

Download the compiled firmware from GitHub (and install all the associated libraries). Then flash your board using the Teensy Loader application. You can find instructions on the GitHub page.

Figure H. Photo by Jeremy Williams
Figure H. Photo by Jeremy Williams

You’re done! Plug in the Teensy LC using a USB micro cable and it will power up (Figure H). You can test the PinSim by launching the Windows USB Game Controllers app from the Control Panel.

The Upgrades, LED LIGHTS

If you replace the light bulb inside the Start button with a white LED and wire it up (through a 22Ω resistor) to pin 16 on the Teensy (terminal LED-1 on my PCB), it will blink 1–4 times when powered up, mirroring the 4 LEDs on an Xbox gamepad. This is a useful indicator since game software often requires controller #1.

Figure I. Photo by Hep Svadja
Figure I. Photo by Hep Svadja

Do the same with the Launch Ball button and connect that LED to Teensy pin 17 (or PCB terminal LED-2). It will remain steady on (Figure I). If you have a 3D printer, you can print my 555 bulb LED holders (Figure J) from Thingiverse.

Figure J. Photo by Jeremy Williams
Figure J. Photo by Jeremy Williams

RUMBLE MOTORS

For haptic feedback, I added 2 Xbox rumble motors. (I didn’t want to use solenoids, because they require higher current and I like that the PinSim runs entirely off the 5V 500mA USB cable.) Wire them through 2N222 transistors to Teensy pins 20 and 22, as shown in Figure K. If you have a 3D printer, you can also print a couple of my handy rumble motor mounts.

Figure K. Click for larger image
Figure K. Click for larger version

MORE ARCADE BUTTONS

Why not add more buttons and use PinSim as an upright arcade controller too? Just drill more holes beside the joystick and connect them to the labeled terminals on the PinSim PCB. For the breadboard crowd, the Teensy LC pinout is shown in Figure L.

Figure L
Figure L
Photo by Jeremy Williams
Photo by Jeremy Williams

LAUNCH PLUNGER

I also decided to replace the Launch button with a real pinball shooter. I had all the parts, I just needed to decide how to convert the shaft movement to a consistent analog signal. I played with bendable resistors and sonar but ultimately I mounted a 3D-printed disc to the end of the shooter, directly in the path of a Sharp IR distance sensor (Figure M). Get the details at Tested. It works brilliantly, but I have to warn you it’s a lot of extra work for minimal payoff. The plunger is important for hitting skill shots, but not much else!

Figure M. Photo by Jeremy Williams
Figure M. Photo by Jeremy Williams

A WORTHY CABINET

After the electronic upgrades, I convinced my carpenter friend Christopher Mann to cut the cabinet from something more beautiful than foamcore. Here’s my new wooden PinSim cabinet (Figure N).

Figure N. Photo by Jeremy Williams
Figure N. Photo by Jeremy Williams

Then James Burke and Anthony Lam at Make: created a plywood cabinet with the most beautiful paint job I could imagine. Absolutely outstanding. I’m still stunned!

Photo by Hep Svadja
Photo by Hep Svadja

Eventually I did swap my flipper buttons for real pinball leaf switches. These buttons have slightly more travel, for that extra 10% of authenticity — but they don’t really affect game play. Build the PinSim as described here, and I think you’ll be overjoyed. I’d love to hear how yours turns out.