Open-source Wireless Steering Wheel / Button Box (ESP32)

repository·main·Indexed 41 days ago

https://github.com/afpineda/opensourcesimwheelesp32

Open-source hardware and software for building sim-racing steering wheels or button boxes using ESP32. Supports BLE and USB connectivity, up to 128 inputs (matrices, rotary encoders, funky switches), SimHub telemetry for RGB/OLED displays, and advanced power management with battery calibration tools.

Tokens
86K
Snippets
131
Records
426
Agent score
100%

What's inside Open-source Wireless Steering Wheel

  1. Overview of Open-source Wireless Steering Wheel / Button Box

    main

    This project provides open-source hardware and software for building a sim-racing steering wheel or button box using ESP32 boards. It supports both wireless connectivity via Bluetooth Low Energy (BLE) and wired connectivity via USB.

    Key capabilities include:

    • Input Support: Up to 128 switches/buttons, including button matrices, multiplexed switches, GPIO expanders, shift registers, rotary encoders, and funky switches.
    • Advanced Input Modes:
      • Alternate Mode: Acts like a SHIFT key, doubling the number of effective inputs.
      • Clutch Paddles: Configurable as F1-style (with bite-point calibration), Launch Control, Alternate Mode, regular buttons, or independent analog axes.
      • ALT Buttons: Can be mapped to Alternate Mode or regular buttons.
      • Directional Pads/Funky Switches: Can be mapped to Navigation controls or regular buttons.
    • Customization: Users can define custom button maps to match existing wheels and adjust rotary encoder pulse widths to prevent missed rotations in certain simulators.
    • Telemetry: Supports SimHub for displaying data via RGB LED strips, single-color LEDs, or monochrome OLEDs.
    • Power Management: Supports rechargeable batteries with state-of-charge reporting and automatic shutdown when not in use.
  2. Overview of the Play and Charge Module

    main

    The Play and Charge module is a hardware expansion board designed for the SimWheel ESP32 DevKit. It provides expanded I/O and power management capabilities.

    Key Features:

    • 32 External Switches: Managed via two MCP23017 GPIO expanders on the I2C bus. Switches are pulled up and use a common pole to GND.
    • Battery Management: Includes a LiPo/Li-ion "1S" battery charger and a MAX17048 fuel gauge on the I2C bus.
    • Power Output: Provides a 3V3 power output for the DevKit board.
    WARNING

    This board is an unmanufactured/untested design and may contain flaws. Use at your own risk.

  3. Overview of the Battery Monitor Subsystem

    main

    The Battery Monitor subsystem is designed exclusively for battery-operated systems. Its purpose is to estimate the battery's State of Charge (SoC), providing a percentage from 0% to 100% to the hosting PC via Bluetooth Low Energy (BLE). This allows users to know when to recharge the device.

    Implementation Options

    You can choose from three mutually exclusive implementation methods:

    1. Simple voltage divider: Often built into specific ESP32 DevKit boards. It is easy to implement but can slowly drain the battery even when the system is sleeping.
    2. Battery monitor: Uses an NPN-PNP transistor pair to switch the monitoring circuit on and off. This avoids battery drainage by only drawing current for a few milliseconds every few minutes.
    3. Fuel gauge chip: Uses dedicated hardware (like the MAX17048) for state-of-the-art SoC estimation.
    CAUTION

    This subsystem is designed for batteries below 5 volts. Higher voltages may damage your DevKit board.

  4. Hardware features and button mapping for Design #6

    main

    Design #6 is a tested hardware configuration for a sim racing wheel featuring Bluetooth Low Energy (BLE) and external power.

    Hardware Capabilities

    • Clutch: 2x Analog clutch paddles (potentiometers).
    • Shifters: 2x Shift paddles.
    • ALT Buttons: 2x ALT buttons.
    • Rotary Encoders: 4x Relative rotary encoders (with push buttons).
    • Extra Inputs: Up to 14 additional push buttons.

    Functional Button Mapping

    • Bite point calibration: Rotate Rotary #1 clockwise and counter-clockwise while holding exactly one clutch paddle.
    • Next clutch function: Press Rotary #1 push button + Left shift paddle.
    • ALT buttons mode: Press Rotary #1 push button + Right shift paddle.
    • Recalibrate clutch paddles: Press Left shift paddle + Right shift paddle + Rotary #1 push button.
    WARNING

    Do not hold the Rotary #2 push button during startup, or the device will fail to boot (though it can be used to force bootloader mode).

  5. Hardware features of Design #7

    main

    Design #7 is a high-performance sim racing wheel controller setup featuring:

    • Connectivity: Bluetooth Low Energy (BLE).
    • Power Options: Supports either rechargeable batteries (via built-in powerboost) or an external power source (5V to 7V DC). Note: Do not use both simultaneously.
    • Inputs:
      • 2x Analog clutch paddles (using linear potentiometers).
      • 2x Shift paddles (using roller levers).
      • 3x Relative rotary encoders (with built-in push buttons).
      • Up to 20 additional push buttons via PISO shift registers.
    • Monitoring: Built-in battery monitor via a voltage divider.
  6. Hardware features and button mapping for Design #1

    main

    Design #1 is a hardware configuration for an ESP32-based sim racing wheel controller.

    Hardware Features

    • Connectivity: Bluetooth Low Energy (BLE).
    • Power: External DC +5V to +7V (max 500 mA).
    • Inputs:
      • Analog clutch paddles (potentiometers).
      • Shift paddles (x2).
      • Optional: 2x ALT buttons.
      • Optional: D-Pad, funky switch, or 4-way push button cross.
      • Up to 4x Relative rotary encoders (with push buttons).
      • Up to 12x additional general-purpose push buttons.

    Button Mapping & Commands

    Use these specific input combinations to trigger system functions:

    • Bite point calibration: Rotate rotary #1 clockwise and counter-clockwise while holding exactly one clutch paddle.
    • Next clutch function: Press START and Left shift paddle simultaneously.
    • ALT buttons mode: Press START and Right shift paddle simultaneously.
    • Recalibrate clutch paddles: Press Left shift paddle, Right shift paddle, and START simultaneously.
  7. Build a DIY steering wheel or button box

    main

    Building a DIY steering wheel or button box involves four interdependent steps. You must ensure the housing design accounts for the physical space required by the electronics, buttons, batteries, and cables.

    1. Wheel housing: Build or purchase a housing.
    2. Electronics: Build the circuit and program the firmware.
    3. Assembly: Connect buttons, paddles, and other peripherals to the circuit board.
    4. Charging Port: Build a battery charging port if your design requires it.
  8. Hardware features of Design #5

    main

    Design #5 is a hardware configuration for a sim racing wheel controller featuring:

    • Connectivity: Bluetooth Low Energy (BLE).
    • Power Options: Supports either rechargeable batteries or an external power source (do not use both simultaneously).
    • Monitoring: Built-in battery monitor.
    • Inputs:
      • 2x Digital clutch paddles.
      • 2x Shift paddles.
      • 3x Relative rotary encoders (with built-in push buttons).
      • Up to 9 additional general-purpose push buttons.
  9. Hardware features of Design #9

    main

    Design #9 is a hardware configuration for a sim racing wheel featuring:

    • Bluetooth Low Energy (BLE) connectivity.
    • Power options: External power via USB cable or quick-release (e.g., Simagic QR).
    • Analog clutch paddles: Uses potentiometers.
    • Rotary Encoders: Up to 7 relative rotary encoders (without push buttons). If no 'funky switch' or DPAD is used, you can use up to 8.
    • Optional Switch: Supports an ALPS funky switch or a DPAD (but not both).
    • Shift paddles: 2x shift paddles.
    • ALT buttons: 2x ALT buttons.
    • Push buttons: Up to 28 additional push buttons.
  10. Hardware features of Design #3

    main

    Design #3 is a hardware configuration for a sim racing wheel featuring:

    • Connectivity: Bluetooth Low Energy (BLE).
    • Power: Battery-powered with a built-in battery monitor and rechargeable LiPo support.
    • Inputs:
      • 2x Analog clutch paddles (using potentiometers).
      • 2x Shift paddles.
      • 2x ALT buttons.
      • 2x Relative rotary encoders (with integrated push buttons).
      • Up to 10 additional general-purpose push buttons via a matrix.
    • Calibration: Supports bite point calibration and clutch paddle recalibration via specific button combinations.
  11. Understand the Manual Integration Test Strategy

    main

    The project employs an incremental, bottom-up manual integration testing strategy. While automated integration tests exist in the CI/CD chain, this manual strategy is designed to validate subsystems as they are combined into larger functional blocks.

    Key Principles:

    • Bottom-up approach: Testing starts with individual subsystems and progressively adds more complex components.
    • Incremental complexity: Each subsequent test level includes the subsystems from the previous levels plus new, highlighted components.
    • Prerequisite: Ensure all unit tests have passed before proceeding to integration testing.
  12. Choosing between Analog and Digital clutch paddles

    main

    You can implement clutch paddles using two different methods depending on your hardware constraints:

    • Analog clutch paddles: Uses potentiometers to provide analog axis input. This is the preferred method for high fidelity. Requirement: You must have two available ADC-capable pins.
    • Digital clutch paddles: Uses the Switches subsystem to treat paddles (or any push button/roller lever) as digital inputs. Use this method if you have no ADC-capable pins available. You can even use potentiometers in this mode by connecting them to the switches subsystem instead of the analog clutch subsystem.