Button Box

WORK IN PROGRESS

Rather than fumbling around on your keyboard Button Boxes are a simple and accessible extension to your steering wheel.

This button box provides 13 push buttons, 4 encoders and 4 two way switches which pairs with an Arduino Pro Micro or Arduino Leonardo gives you 33 possible controls you can pass to your computer. The great thing about these Arduino boards is that they utilise the ATmega32u4 chip allowing the board to appear to a connected computer as a mouse and keyboard – perfect for this task.

Printed Parts

You can download them from Printables or get in touch if you’d like us to print them for you.

BOM.

In addition to the printed parts I used the following.

The Circuit and Wiring.

Rather than connect each switch option to the Arduino directly, which would need 33 inputs we are going to use a 5×5 matrix. Using a matrix we can encode a larger number of inputs using fewer pins in this case we can use 10 inputs for the basic switches + 8 additional ones for the encoders.

ROWCOL1: Black (9)2: Grey (8)3: Black (14)4: Grey (16)5: Black (10)
0Red
(A0/18)
Push But 1Push But 2Push But 3 Push But 4Push But 5
1Red
(A1/19)
Push But 6Push But 7Push But 8Push But 9Push But 10
2Green
(15)
Extra Push Button?Encoder 1 (6/7)Encoder 2 (4/5)Encoder 3 (2/3)Encoder 4 (TX1/RX2)
3Pink
(A2/20)
Push But 112Way 1A2Way 1B2Way 2A2Way 2B
4Purple
(A3/21)
Push But 122Way 3A2Way 3B2Way 4A2Way 4B

The Coding.

For the code we will need to have a working Arduino compatible IDE. This can be the simple Arduino IDE or via Visual Studio Code. We are going to use the Joystick Library by Matthew Heironimus and the Keypad Library by Mark Stanley and Alexander Brevig. The later can be installed via the Arduino Library Manager with the former needing to be downloaded from the GitHub link and installed as advised on the GitHub page.

Testing.

There is a detailed explanation on Matthew’s Joystick Library Wiki but a quick test can be achieved by typing joy.cpl into the search box on Windows and then clicking properties after selecting your device.

Mapping Options

Choosing what to map to your button box.

For reference, on my wheel I have:

DRSPUSH 2 TALKTEAR OFFBOOST
PIT LIMITERBR. BIAS –BR. BIAS +EXIT
LEFT 8WAY ENCODER >UNUSEDRIGHT 8 WAY ENCODER >BLACK BOX
ADJ –CHAT SORRYCHAT THANKSADJ +

Leaving the following options on the Button Box.

ROW/COL12345
PUSH APITS INFULL PIT
Tyres + 50L
CLEAR FUEL+5L
PUSH BPITS OUTUse Free RepairCLEAR TYRES-5L
ENCODERS + PUSH CUnusedUnusedUnusedUnusedCHAT
CHEEKY TICKLE
TOGGLE A + PUSH DTOGGLE
WIPERS
ON
FLASH LIGHTSXSHOW CAMCENTRE HMD
TOGGLE BLEFT
PASS
RIGHT
MUTE
CHAT
MUTE ALL
XXX

References.

The original inspiration and incomplete source code was sourced from Hobbylex’s Sim Racing Button Box on Instructables although I also referenced Arduino Forum threads #1 & #2 where there is a reference to AMStudios.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.