DIY Project: Mini Button Box with 60 Functions and OLED Screen

If space on your rig or desk is limited, this mini button box is a compact alternative for additional button assignments. Up to 60 different functions can be mapped on a base area of only 60 x 30 millimeters. A rotary encoder and a small OLED display are used for operation and overview. The project can be implemented with material costs of around seven euros and a few simple 3D-printed parts.

Materials

The list of materials required this time is as short as the project is small. In addition to the RP2040 microcontroller, all you need is an EC11 encoder and a slightly less than one-inch OLED screen called SSD1306. All you need to add to that is the filament, cables if necessary, and eight M2 screws.

Preis (ab)Mögliche Bezugsquelle*
Button Box
Pico RP2040 (Micro-USB / USB-C)3.00€Aliexpress / Amazon
EC11 Encoder x 3 (15mm Half handle)2.00€Aliexpress / Amazon
SSD1306 OLED Screen (white)2.00€Aliexpress / Amazon
Gesamt~7€
3D-Druck
Filament schwarz~20gAliexpress / Amazon
Filament weiß (optional)~5gAliexpress / Amazon

The following tools and screws should also be available:

  • Screws
    • M2 x 6 mm (8x)

3D-Druck

The project is housed in an ultra-compact enclosure that comes straight from the 3D printer. There are three enclosure variants to choose from (with and without mounting options). The prints are very straightforward and undemanding overall and should be possible on absolutely any 3D printer.

  • Front cover: Houses the OLED screen and the EC11 encoder. It can be printed without support.
  • Box/mount: There are three variants to choose from, each of which can be printed without support.
  • Rotary Encoder Cap: Printed covers for the two EC11 encoders, which are delivered without caps as standard. Depending on the tolerance of the printer, it may be necessary to slightly adjust the scaling here. Can also be printed upside down without support.

Assembly and wiring

As only one type of screw is used here, assembly is particularly quick.

  • The individual components are screwed into the button box housing: The display (which is inserted and can then be additionally secured with adhesive of your choice) and encoder are located on the front, while the RP2040 is located inside the housing.
  • The housing is then secured with four M2 screws. The screws should not be tightened too much, as they grip the 3D print.
  • If one of the housings with pre-drilled holes was chosen, the box can then be screwed directly onto the rig with two M6 screws each.

The button box can be easily connected to the PC via a USB cable. It does not matter which version of the RP 2040 is used.

A total of nine short cables are required for the wiring, which should be laid and soldered in such a way that they are not compressed during assembly. In principle, other pins can also be selected, but the code must then be adjusted accordingly.

  • SSD1306 OLED Screen:
    • SDA -> GP0
    • SCL -> GP1
    • GND -> GND
    • VDD -> 3V3(OUT)
  • EC11 Encoder:
    • Phase A -> GP17
    • Phase B -> GP18
    • GND -> GND
    • BTN Pin -> GP9
    • GND -> GND

Important: All electronic work should only be carried out under the supervision of trained electronics engineers, no liability is accepted for errors / damage. DIY at your own risk.

Software

To upload the code intended for the project to the Pico, simply follow the steps below. No programming knowledge is required:

  • Hold down the BOOTSEL button on the Raspberry Pi Pico while connecting it to your PC via USB until it appears as a new drive named RPI-RP2.
  • Simply drag and drop the prepared .uf2 file onto this drive (as you would onto a USB stick).
  • The Pico will automatically install the firmware, restart immediately, and log in directly to your system as a ready-to-use SPC Input Game Controller.

Features and button assignments

The Mini Button Box combines up to 60 different buttons in a very small space. You can choose between three profiles, each of which can control up to ten different parameters (+/-).

Operating mode:

  • Turn left: Sends gamepad button (odd number, e.g., button 1).
  • Turn right: Sends gamepad button (even number, e.g., button 2).
  • Short click: Jumps to the next mode in the current profile.
  • Hold (> 0.5 sec): Changes the profile (A -> B -> C -> A).
  • Hold (> 2.0 sec): Opens the SETUP MENU on the device.
  • Each mode occupies two gamepad buttons (left/right rotation).
    • Profile A (buttons 1 – 20): 10 modes x 2 buttons.
    • Profile B (buttons 21 – 40): 10 modes x 2 buttons.
    • Profile C (buttons 41 – 60): 10 modes x 2 buttons.

Setup-Menu:

  • PHASE 1: MODE COUNT (Set the number of active slots)
    • Turn: Increases or decreases the number of modes (1-10) for the current profile.
    • Click: Saves the number and jumps to label editing (Phase 2).
  • PHASE 2: EDIT LABEL (Customize slot names)
    • Turn: Scrolls through the alphabet/special characters for the current position.
    • Click: Jumps to the next position (3 characters per label).
    • Auto: After the 3rd character, the cursor jumps to the next slot.
    • Exit: Hold the button for approx. 1 second to save at any time and return to normal mode.

Reset options:

  • Boot mode: Hold down the EC11 button while plugging it in (for firmware updates).
  • Factory reset: Hold down the EC11 button for ten seconds. A warning appears on the display after seven seconds. Deletes all profiles to default values.

Since the controller functions as a regular game controller and the various modes are recognized as separate buttons, all virtually assigned buttons can be assigned in almost any current simulation.

SimHub Version

As an alternative to the standalone button box, you can also use SimHub. Here, up to five different telemetry data points can be read and displayed. For each variable, you can assign two buttons (turn right and turn left). Pressing the encoder switches to the next variable.

In SimHub, the Mini Button Box must be added as a custom serial device with the following settings:

During data transmission, both the variable name and the telemetry data to be displayed can be configured as desired according to the following example (JS):

return 'TC:'+$prop('TCLevel') + ';TC2:'+$prop('GameRawData.Graphics.TCCut') + ';ABS:'+$prop('ABSLevel') + ';BB:'+$prop('BrakeBias').toFixed(1) + ';MAP:' + $prop('EngineMap') +'\n'

Up to five variables can be defined, separated by semicolons. It is also important to output a new line at the end of the code (‘\n’).

Conclusion

The Mini Button Box presented here allows you to control up to 60 different functions using a single encoder with an additional push function. Measuring only around 60 x 30 millimeters, this tiny and inexpensive box can be mounted almost anywhere. Thanks to its integrated OLED screen, it offers a convenient way to control a wide variety of parameters.

Kommentare

Leave a Reply

Your email address will not be published. Required fields are marked *


Simracing Coupons Simracing Deals