Skip to content

Final Project: Button Box for Sim Racing

Overview

For my final project, I designed and built a custom USB HID button box to enhance immersion in driving and simulation games. The box serves as an additional control interface, designed with aesthetics, ergonomics, and function in mind. My aim was to make it feel like a professional-grade product rather than a DIY prototype.

It uses a Seeed XIAO RP2040 microcontroller and integrates rotary encoders, toggle switches, and illuminated push buttons, all mounted in a sleek 3D-printed enclosure inspired by professional simulator hardware.

Project Questions ### **What does it do?** I designed the button box as a custom input device, meant to streamline interactions in gaming, simulations, and even productivity tasks. It provides tactile feedback through well-placed switches, encoders, and buttons, enhancing control beyond the standard keyboard. ### **Who’s done what beforehand?** Plenty of enthusiasts have built button boxes for flight sims and racing setups. I looked into projects from Instructables, previous Fab Academy projects, and Arduino communities, studying how others approached usability and technical challenges. Then, I refined those ideas to better suit my needs. ### **What did I design?** I focused on creating a sleek, well-integrated device that balances function and form. My design included: - **Ergonomic layout** to maximize efficiency and comfort. - **Aesthetic considerations** for a modern, polished look. - **Thoughtful placement** of switches and encoders for intuitive use. ### **What sources did I use?** I pulled information from forums, datasheets, and GitHub repositories to understand best practices. I also consulted with many experts in the lab as they were knowledgeable in their subject of expertise. ### **What materials and components did I use?** - **Microcontroller:** XIAO RP2040. - **Switches:** A mix of toggle switches, push buttons, and rotary encoders. - **Enclosure:** 3d Printed. - **Wiring:** Soldered connections for reliability. - **Software:** Arduino IDE with the Joystick library. ### **Where did they come from?** I sourced componets from the Lab, Bambu Labs, and Amazon. ### **What parts and systems did I make?** - **The PCB** for efficient input processing. - **The Code** for signal handling. - **Enclosure design** for stability and aesthetic appeal. ### **What processes did I use?** I went through: - **PCB design**. - **System Integration**. - **3D printing** the enclosure. - **Embedded Networking**. ### **What questions did I answer?** I tackled: - Compatibility with different software ecosystems. - Optimal placement and responsiveness of controls. - Power consumption and microcontroller limitations. ### **What worked? What didn’t?** - **Worked:** Button responsiveness, smooth integration, durable enclosure. - **Didn’t:** Initial wiring complexity, firmware troubleshooting, occasional compatibility issues. ### **How did I evaluate it?** I tested it extensively, analyzing responsiveness and durability, and gathered feedback for refinements. ### **What are the implications?** This project contributes to the open-source hardware space, offering a refined approach to custom controllers. It highlights structured design thinking and could expand into gaming. ## Dissemination Plan My project will be released under the Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA) license. This license allows others to freely use, modify, and share the project for non-commercial purposes, while preserving credit to the original creator and encouraging community collaboration. I chose this license because it supports open access and learning, while preventing unauthorized commercial use. If I decide to turn the project into a product, I may adopt a dual-license model or develop a separate commercial version that can be sold while maintaining the original educational edition as free and open-source.

Video and Slide

Project Timeline

Gantt Chart Link

Original Concept & Design

Inspiration

My design was inspired by the ATS Accessories Patriot XL Box. I wanted to capture the same functional elegance but create a minimalist, affordable, and DIY-friendly version using accessible materials and open-source electronics.

Concept renders of my button box design

This is what it would look like integrated into my simulator setup:

Weeks I Might Use

  1. Computer Aided Design
  2. Embedded Programming
  3. 3D Scanning and Printing
  4. Electronics Design
  5. Computer Controled Machining
  6. Electronics Production
  7. System Integration
  8. Invention, Intelectual Property and Income

License

This project is released under the Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA) license. This allows others to use, remix, and share the design for non-commercial purposes, while giving credit and keeping it open-source.

If I decide to commercialize the project, I may pursue a dual-license model — one open, one commercial.

Future Improvements

I’d like to eventually:

  • Introduce modular, magnetic button modules for reconfigurable layouts.
  • Use machined aluminum or wood instead of 3D-printed plastic.
  • Refine the firmware for dynamic lighting and profiles.
  • Possibly turn this into a commercial kit or open-source hardware brand.

A key inspiration for future iterations was a video showcasing a sound system with magnetic knobs that glide perfectly — I want my device to feel that satisfying.

Hardware

Materials

The total cost of materials was around $270.83

For me, the total cost of this project was $96.54

Item Link Item Name Price Notes In Lab?
Black PLA $19.99 YES
Black Acrylic Panel $30.07 YES
Heat Set Inserts $6.99 YES
M3 Machine Screws $1.50 YES
Female Jumper Wires $6.59 Buy 2 YES
Male Pinheaders $4.13 YES
Solder $7.99 YES
Seeed Studio – Xiao RP2040 Xiao RP2040 $3.99 YES
USB C Cable $8.99 2 needed YES
1206 10k Ohm Resistors $0.56 Buy > 50 YES
Digi-Key – CD4051BEE4 CD4051BEE4 $0.86 1 needed NO
Digi-Key – CD74HC4067M96 CD74HC4067M96 $0.78 2 needed NO
Grayhill 58J8A45-01-1-05N Key Switch $76.90 YES
Amazon – Metal Toggle Switch (B0BMVLKJHL) Toggle Switch $14.99 NO
Amazon – STARELO Push Button Push Button $17.49 NO
Amazon – JTAREA Rotary Encoder Rotary Encoder $7.99 NO
Amazon – Nilight ON/OFF/ON Rocker Switch ON/OFF/ON Rocker Switch $8.09 2 needed NO
mxuteuk Momentary Rocker Switch (B0885W19KL) ON/OFF/ON Rocker Switch $7.99 NO
Amazon – ZJWZJH Rotary Toggle Switch ON/OFF/ON Rotary Toggle Switch $15.99 NO
Amazon – Nilight Latching Push Button Latching Push Button $13.49 NO

Faceplate

Cardboard

To get a sense of ascale and to check the fitment of the buttons, I first cut my box out of cardboard. on the first go all of my buttons fit except for the two that would control the windows. But because it was cardboard I was able to shove them in anyway and not have to worry about breaking the material. I ended up giving more clearance so they would fit when I used acrylic.

When I had all the buttons on my faceplate I had my friends sit on my simulator and reach for the buttons, this gave me an idea on where I need to mount the box in the future.

This was especially needed if I were to get the proper clearance so my kuckles don’t hit the box when driving.

Acrylic

The acrylic was a bit more finiky to cut than the cardboard, I ended up having to run the laser cutter twice because it would’t go through on the first time. I also didn’t like the super glossy apperance of the acrylic so I ended up dry sanding it at 2000 grit which gave it a brushed metal kind of look. I thought it looked pretty cool so I kept it.

Test Piece

Final

Shell

Design Choice

One thing that always bugged me about the DIY button boxes was the fact that most of them were super ugly. They had harsh, sharp edges, brightly colored cheap platic buttons, and looked very ultilitarian. Since my racing simulator take up a lot of space in my common room, I wanted to make sure that my box was as sleek as the rest of the simulator. I wanted somethign that looked really cool, but didn’t stand out. I also wanted the buttons to feel so good to use, that people would find any excuse they could think of to use them. This is how I landed on using switches used in industrial, automotive, and nautical uses. While expensive, these switches were, solid, had a great click and a satisfyingly long press distance, and looked really good. I chose blue because a few other parts of my simulator had blue indicator LEDs and I also really like the color. I borrowed the design language from the large button box sold by ATS Accesories and made my boxes have a slanted top and large filleted edges, which added a nice sleek but subtle look.

Notable Design Desicions

Parametric Design

Both the large and small box are largely parametric, this allows me to change parts of the design very quickly and efficiently.

Two Part Design

While the small box would have no issues printing as is, the large box proved to be too big to print in one piece, leading me to have to split it into two so it would fit. For aligning the pieces when gluing I added some pegs and holes.

Mounting Holes

I’ve added four (parametric) holes for hard mounting the box to a dedicated stand that comes with some high end systems.

Board Mount

I made a mount for these PCBs by erecting a border around the PCB to keep in in place. To make sure it didn’t fall out of this border I added two press fit pieces that would go over the board and secure it to its enclosure.

Box Mounts

Assembling Box

Assembly was quite simple all I had to do was screw the two smaller face plates onto the main face plate both for the large and small box then I just had to screw the face plates into the box themselves which were fitted with heat inserts so I could open up and close the boxes as many times I wanted to without worrying about the plastic stripping inside and losing it’s grip on the faceplate screw the amounts for the PCB were also pretty simple to install and help the PCB and relatively well perfect for a low stress environment with only long consistent minor vibrations

PCBs

Designing Boards

Both the large and small boards were designed in kicad I used rp2040 for both of them to talk to the computer and because the shower rp2040s did not have enough pins to directly wire each button I decide to use an eight to one multiplexer on the small board and two 16 to one multiplexers on the large board in order to allow me to use many buttons the multiplexers were connected to the boards and this left a bit of extra pins on the rp2040s so I could directly wire the rotary encoders to them along with the rotary encoder push buttons the buttons were connected to 5 volts on one side and to a pin on the multiplexer on the other side and when the button was pressed the multiplexer which was in a pool up position would then get triggered and have its state changed which the code would detect and send the computers a button press the board was a bit of a challenge to design because of how much routing there had to be but it was simple in concept I also tried having a 12-volt section to power the LEDs but that was too complex and 5 volts gave me problems with State change detection so I ended up going with 3.3 volts to the LEDs which barely decreased the brightness so it worked out in the end

Large Board

Schematic

PCB Design

3D View

Small Board

Schematic

PCB Design

3D View

Soldering

Soldering was a little tedious with how many pins were on the multiplexers and how many 10k ohm resistors had to be soldered, but it wasn’t bad.

Large Board

Small Board

Assembly

Connecting Buttons

For the most part I followed manufacturer Drawings from their listings which helped me wire up my buttons enough there were however a few times when I had to switch things up like for example with the push buttons I wired the LEDs and common side of the switch to the 3.3 volt rail then I put the LED grounds to ground and the normally open side to one of the pin headers on the multiplexer this worked because the multiplexer was in a pool up configuration. Most of the buttons either snapped, or scewed into the box just fine.

Wires

To keep the PCB small I used pinheaders to connect the wires to the board. This meant I needed to connect the breadboard wires to the wires that came with the buttons.

Examples:

Spade Connectors

At first I used spade connectors to join the wires together, since some of the buttons wiring harness came with them pre installed. However the bread board wires were too small and snapped after I moved them around too much.

Spade Connectors

Crimp

Unconnected Wires

Connected Wires

Direct Solder

After a few of the wires snapped, I decided to soleder the breadboard and button wires together directly with heat shrink over them. This worked way better.

I 3d printed this wire holder which greatly sped up the process of soldering.

Assembling Box

Assembly was quite simple all I had to do was screw the two smaller face plates onto the main face plate both for the large and small box then I just had to screw the face plates into the box themselves which were fitted with heat inserts so I could open up and close the boxes as many times I wanted to without worrying about the plastic stripping inside and losing it’s grip on the faceplate screw. The mounts for the PCB were also pretty simple to install and help the PCB and relatively well perfect for a low stress environment with only long consistent minor vibrations.

Wire Management

Wire management was quite tricky with the ammount of different lenght wires in the box. I did the best I could do and it looks pretty neat though a little chaotic at first glance, it isn;t too hard to tell what goes where.

Software

Code

Features

Origionaly the boxes registered on the website as a RP2040, to fix this I went into the library and created two new 2040 variants named Large Box and Small Box.

Both boxes were detected as separate gamepad devices under Windows using the built-in HID Joystick library. All inputs were functional and responsive.

Testing

Initial Test

The box used to send a toggle signal for the toggle switches and a pushbutton signal for pushbuttons. This didn’t work with most games though, because they were made to be played on Mouse and keyboard, so they didn’t have toggle switch compatibility

BeamNG.Drive

Here is the issue demonstrated in American Truck Simulator

To fix this I made the box detect state changes in the buttons, and then send a pulse to the computer to emulate a keypress, this meant that pushbuttons would work normally and a toggle switch would send 2 pulses (1 Pulse on, 1 pulse off)

Subsiquent Tests

Testing the box was incredibly fun and I enjoyed using it. On American truck simulator both of the boxes were recognised as two different systems and worked just fine.

Software Used

Things I Swiped From Corporations

Button Box Design I Took Inspiration From

Files

Hardware

Software


Last update: November 21, 2025