No description
Find a file
2026-04-16 08:32:46 +00:00
photos assembly instructions with photos 2026-04-15 19:29:36 +00:00
stl stl files 2026-04-15 19:33:40 +00:00
README.md Note about cutting during slicing 2026-04-16 08:32:46 +00:00
shifter.ino init 2026-04-08 19:48:44 +00:00

shifter

This is code for a racing simulation shifter using a physical button for each gear.

I have a Moza Racing HGP Shifter. It was great at first, but after a year it stopped consistently recognizing 2nd, 4th, and 6th. Recalibrating did not help. I still was happy with the feel of the shifter, so I bought eight snap switches, designed and 3D printed an assmebly to fit inside the shifter housing and hold the switches, wired them to an Arduino Nano ESP32 that I had, and wrote this code.

This shows up as a Bluetooth gamepad device called "shifter", and Assetto Corsa recognizes it. I have not tried it with any other games.

photo of the shifter housing all the way on

parts list

hardware

I designed the model in Onshape. It is published here on onshape.com

The printable model is published here on printables.com. The STL files are also here in ./stl/.

wiring

The wiring is simple: the bottom pin on each switch to the VBUS pin, and the middle pin each to a separate data pin. It does not matter which one, you can map them in software.

assembly

  1. Disassemble the shifter enough to remove the electronics.
  2. Cut a slot in the shifter housing where the USB port will be:
    • slot cut out for USB port
  3. 3D Print parts:
    • (1) insert
      • When slicing, the part needs to be cut into three pieces to print. The bottom needs to be cut separately so it can fit between the shifter base and assembly. Make it between 10mm and 12mm tall. The upper part needs to be cut in half vertically to make putting the threaded inserts and screws easier. Cut it at "V" in the side window.
    • (1) cap
    • (6) bracket_wide
      • Black and purple in the photos; there is no difference other than color between the black ones and the purple ones.
    • (2) bracket_narrow
      • Yellow in the photos.
    • photo of printed parts
  4. Place the base of the insert on the shifter base. Make sure orientation is correct:
    • printed insert base sitting on base
  5. Attach the shifter mechanism to the base, 4 screws on the bottom.
    • printed insert base sitting on base
  6. Solder wires from the switches to the Arduino.
    • See later photos for an idea for length.
  7. Put the switches into the switch brackets.
    • photo switches in brackets wired to the arduino
    • photo closeup of wired switches
  8. Insert the threaded inserts.
    • photo of the insert base with the threaded inserts inserted
    • photo of the insert top pieces with the threaded inserts inserted
  9. Place the Arudino on the pins, and screw the cap on.
    • photo of the arduino attached to the base
  10. Screw the switch brakets into the insert top pieces.
    • photo of the insert top pieces with the switch brackets (with switches) screwed in
  11. Tape the insert top pieces together and place on the base.
    • photo of the insert top pieces taped together and sitting on the shifter base, with the shift lever sticking up through the middle
  12. Slide the shifter housing over the inserts.
    • photo of the shifter housing being slid over the top
  13. Push the shifter housing all the way down and screw it to the shifter base, 4 screws on the bottom.
    • photo of the shifter housing all the way on
  14. Screw the top plate on, 4 screws on the top.
    • photo of the shifter top plate attached
  15. Screw the shifter knob on.
    • photo of the shifter knob attached
  16. Plug it in and continue to software

software

building and installing

If you are more familiar with Arduino stuff, or use the Arduino IDE or some other IDE, you may have a better way to do this.

If you do not use Linux, sorry I cannot help you. (I am not saying you cannot be helped, I just do not have anything running Windows or MacOS and I have not developed on either of them in a very long time, so I cannot help you.)

Setup

  1. Install arduino-cli
  2. arduino-cli core install arduino:esp32
  3. arduino-cli lib install NimBLE-Arduino
  4. arduino-cli lib install ESP32-BLE-Gamepad

Compile

arduino-cli compile --fqbn esp32:esp32:nano_nora shifter.ino

Install

arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:nano_nora shifter.ino