How to Select the Correct PCB Version for Your DIY Sim Racing FFB Pedal Build

Select the correct PCB version by defining the PCB_VERSION macro in your PlatformIO build configuration, which automatically configures pin mappings, ADC selection, and wireless support based on your specific hardware revision.

The diy-sim-racing-ffb-pedal repository by chrgri supports a family of control board revisions ranging from V3 to V13, each with distinct MCU types, peripheral configurations, and optional wireless capabilities. Understanding how to select the correct PCB version ensures your firmware matches your physical hardware, preventing pin conflicts and enabling features like sensorless homing or high-precision ADC readings.

Understanding the PCB Version Macro System

The firmware uses compile-time macro definitions to target specific hardware. At the core of this system is the PCB_VERSION macro, which drives a cascade of #if preprocessor sections in the core header files. When you define PCB_VERSION in your build flags, the compiler automatically selects the correct pin assignments, peripheral configurations, and feature flags for that specific board revision.

This mechanism is implemented primarily in two files:

PCB Version Reference Table

The following table details the supported PCB versions, their hardware characteristics, and where to find the corresponding documentation:

PCB_VERSION Board Name (CONTROL_BOARD) MCU Level Shifter ADS1220 ADC Wireless (ESP-NOW) Wiring Documentation
3 V3_ESP32 ESP32-D0WDQ6 Present (SENSORLESS_HOMING) Not used No Wiring/Esp32_V3/
5 Speedcrafter ESP32-S2 Present Used (USES_ADS1220) No Wiring/Esp32_V3/ (Speedcrafter variant)
6 V4_ESP32S3 ESP32-S3 Present Used (USES_ADS1220) No Wiring/Esp32S3_V4/
7 Gilphilbert_PCBAv1 ESP32-S3 Present Used (USES_ADS1220) No Wiring/PowerPcb/V1/
8-9 Gilphilbert_PCBAv2 / Gilphilbert_PCBAv2_Without_Wireless ESP32-S3 Present Used (USES_ADS1220) Optional (ENABLE_ESP_NOW) Wiring/PowerPcb/V2/
12-13 V5_ESP32S3 / V5_ESP32S3_Without_Wireless ESP32-S3 Present Used (USES_ADS1220) Optional (ENABLE_ESP_NOW) Wiring/PowerPcb/V2/ (newer version)

Hardware Configuration Differences

MCU and Processing Power

Early versions (V3) use the ESP32-D0WDQ6, while newer revisions (V4, V5, Gilphilbert series) migrate to the ESP32-S2 or ESP32-S3. The ESP32-S3 provides additional processing power and improved peripheral support, particularly beneficial for high-frequency control loops and wireless communication.

Level Shifter and Sensorless Homing

Boards with PCB_VERSION 3 and higher include a level shifter, indicated by the SENSORLESS_HOMING true flag in Main.h. This hardware enables sensorless homing capabilities by properly conditioning the hall sensor signals for the MCU. Without this flag set correctly, homing routines may fail or produce inconsistent results.

ADC Selection (Internal vs. ADS1220)

The firmware supports two ADC configurations:

  • Internal ADC: Used on V3 boards, leveraging the ESP32's built-in analog inputs
  • External ADS1220: Used on V5, V4, and Gilphilbert boards, providing higher resolution and better noise immunity for load cell readings

When USES_ADS1220 is defined, the firmware initializes the SPI interface using pins specified in Main.h (typically FFB_ADS1220_SCLK, FFB_ADS1220_DIN, FFB_ADS1220_DOUT, FFB_ADS1220_DRDY, and FFB_ADS1220_CS).

Wireless Connectivity (ESP-NOW)

Versions 8, 9, 12, and 13 support optional ESP-NOW wireless communication. This is controlled by the ENABLE_ESP_NOW macro rather than PCB_VERSION alone. When enabled, the board can communicate wirelessly with other ESP-NOW devices, eliminating the need for USB cables in multi-pedal setups.

Configuring Your Build in PlatformIO

Setting PCB_VERSION in platformio.ini

The canonical method for selecting your hardware revision is through the build_flags directive in your PlatformIO environment configuration. Locate or create the appropriate environment section in Firmware_for_V3/PedalFirmware/platformio.ini:


# Firmware for V3 – PCB version 3

[env:esp32s3usbotg_pcbV3]
platform = espressif32
board = esp32dev
framework = arduino
build_flags = -DPCB_VERSION=3   ; ← selects V3_ESP32

This example configures the build for the original V3 control board using the standard ESP32.

Enabling Optional Features

For boards that support wireless connectivity or other optional features, add additional macro definitions to the build_flags:

[env:esp32s3usbotg_pcbV5]
platform = espressif32
board = esp32dev
framework = arduino
build_flags =
    -DPCB_VERSION=12        ; selects V5_ESP32S3
    -DENABLE_ESP_NOW        ; enables wireless support

When ENABLE_ESP_NOW is omitted, the firmware automatically appends "_Without_Wireless" to the CONTROL_BOARD identifier, as defined in Version_Board.h.

Locating Hardware Documentation

Each PCB version has corresponding schematic and layout files in the repository's Wiring directory:

  • V3 (Control Board): Wiring/Esp32_V3/ contains the schematic PDF, assembled board photos, and Gerber files (Gerber_PCB_V3.zip)
  • V4 (ESP32-S3): Wiring/Esp32S3_V4/ includes the V4 schematic and manufacturing files
  • V1 Power PCB: Wiring/PowerPcb/V1/ provides front and back SVG renderings (front.svg, back.svg) and the Gerber archive
  • V2 Power PCB: Wiring/PowerPcb/V2/ contains updated layouts used by V5 and V6 variants, including voltage-fluctuation documentation

Always cross-reference your physical board's silkscreen markings with the CONTROL_BOARD string defined in Version_Board.h to ensure you are compiling the correct firmware variant.

Summary

  • Define PCB_VERSION in your platformio.ini build flags to select the correct hardware configuration for your specific board revision
  • The Version_Board.h file maps numeric version constants to human-readable board names exposed to SimHub via the CONTROL_BOARD macro
  • Hardware differences between versions include MCU type (ESP32 vs ESP32-S3), ADC selection (internal vs ADS1220), level-shifter presence for sensorless homing, and optional ESP-NOW wireless support
  • Enable optional features like wireless communication by adding -DENABLE_ESP_NOW to your build flags alongside the PCB version definition
  • Reference the Wiring/ directory for schematics, Gerber files, and assembly guides specific to your PCB version

Frequently Asked Questions

What happens if I select the wrong PCB_VERSION in my build configuration?

Selecting the incorrect PCB_VERSION results in firmware compiled with wrong pin assignments and peripheral configurations, causing immediate hardware malfunctions such as non-responsive stepper motors, incorrect ADC readings, or damaged GPIO pins due to voltage mismatches. Always verify your physical board's revision number against the silkscreen markings before compiling.

Can I upgrade my existing V3 board to support ESP-NOW wireless functionality?

The V3 control board (PCB_VERSION 3) lacks the necessary hardware infrastructure for ESP-NOW support, as it uses the ESP32-D0WDQ6 without the specific wireless configuration pins found in later V5 and Gilphilbert variants. To add wireless capability, you must upgrade to PCB versions 8, 9, 12, or 13, which support the ENABLE_ESP_NOW macro.

How do I identify which PCB version I have if the silkscreen is damaged or unclear?

Cross-reference your board's physical characteristics with the hardware configuration flags in Firmware_for_V3/PedalFirmware/include/Main.h: check for the presence of an ADS1220 chip (indicating versions 5-13), identify the MCU module (ESP32-WROOM vs ESP32-S3-WROOM), and look for the level-shifter IC near the stepper driver connector. These physical markers uniquely identify your revision when matched against the documentation in the Wiring/ directory.

Why do some PCB versions use the ADS1220 external ADC instead of the internal ESP32 ADC?

Versions 5 through 13 utilize the external ADS1220 ADC (enabled via USES_ADS1220) to achieve higher resolution (24-bit vs 12-bit) and better noise immunity for load cell readings, which is critical for accurate force feedback calculations in sim racing applications. The V3 board relies on the internal ESP32 ADC, which provides sufficient performance for basic setups but lacks the precision required for high-end load cell configurations found in later hardware revisions.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →