The SDVX Controller is a fully open-source, USB HID game controller designed for playing Sound Voltex and compatible rhythm games. Built around an STM32F401 BlackPill v3.0 microcontroller, it requires no custom drivers — plug it in and the operating system recognises it immediately as a standard game device. Every layer of the project is designed for home fabrication: the PCB is a single-layer board you can etch yourself, the enclosure is fully 3D-printable, and the firmware is compiled and flashed with free tools. Whether you want an authentic arcade-feel controller on a hobbyist budget or a platform to experiment with embedded USB HID, this project gives you a complete, documented starting point.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MrJefter/sdvx-controller/llms.txt
Use this file to discover all available pages before exploring further.
PCB Design
Schematic, EasyEDA project files, Gerbers for fabrication, and the bill of materials for the single-layer PCB.
Enclosure
Fully 3D-printed case designed in KOMPAS-3D — STEP source files and print-ready STLs included.
Firmware
STM32CubeIDE project with USB Custom HID, hardware encoder decoding, DMA-driven LEDs, and DFU bootloader entry.
Pinout Reference
GPIO assignments for all buttons, both rotary encoders, the LED data line, and the BOOT0 control pin.
What You Get
Hardware at a Glance
The heart of the controller is the STM32F401 BlackPill v3.0, a compact development board that exposes the full set of STM32F4 peripherals needed for this build. Input comes from 7 Cherry MX-compatible switches (Outemu Red or similar) covering the standard SDVX button layout: BT-A, BT-B, BT-C, BT-D, FX-L, FX-R, and START. Two LPD3806 rotary encoders — VOL-L and VOL-R — handle the knob inputs that are central to SDVX gameplay. A strip of 12 WS2812B addressable RGB LEDs, connected to pin PB0, provides the reactive lighting effects. The PCB was designed in EasyEDA. It is deliberately kept to a single copper layer so that it can be produced at home using the toner-transfer or UV-exposure method, without needing to send out to a board house. Gerber files and EasyEDA source files are both included if you prefer to order professionally.Firmware Features
The firmware is developed in STM32CubeIDE using the STM32 HAL library. Key capabilities include:- Quadrature encoder decoding via hardware timers — TIM3 decodes VOL-L and TIM4 decodes VOL-R using the STM32 encoder interface mode (
TIM_ENCODERMODE_TI12), offloading all pulse counting from the CPU. - Exponential moving average (EMA) smoothing — encoder axis values are smoothed with α = 0.15 before being written into the HID report, reducing jitter without adding noticeable lag.
- Software debouncing with a 3 ms lockout — button state changes are accepted only after a 3 ms quiet period, implemented in the EXTI callback to handle the interrupt-driven GPIO inputs.
- USB Custom HID class — the device enumerates as a 5-byte joystick report (two 16-bit axes + 7 buttons) with no vendor driver required.
- DMA-driven WS2812B output at ~50 FPS — the
visHandle()/visHandle2()pipeline only pushes a new frame when the previous DMA transfer is complete, targeting a 20 ms update interval.
Three-Layer LED Effect System
The LED rendering pipeline invisEffect.c stacks three independent effects per frame:
- Ambient fog animation — a slowly evolving background colour (violet/purple) driven by a sum-of-sines noise function applied to each LED’s spatial coordinates. Brightness oscillates between 50 % and 80 % of the base colour, with high-noise pixels blending toward white for a glowing shimmer.
- Button-press white pulse — any freshly pressed button triggers a 250 ms linear fade-out of a pure white flash on its mapped LEDs. The pulse overrides the background for its duration.
- Encoder activity glow — VOL-L and VOL-R each have a dedicated set of LEDs. When an encoder moves, its activity level spikes (cyan for VOL-L, magenta for VOL-R) and then decays at a rate of 0.955× per frame, creating a smooth motion trail effect.
DFU Bootloader Entry
Reflashing the firmware does not require an ST-Link adapter every time. When the START button is held for 5 seconds, the firmware sets the BOOT0 pin high via software (PA15) and triggers a system reset, which causes the STM32 to enter its built-in USB DFU bootloader. The device then appears as a DFU target and can be flashed withdfu-util or STM32CubeProgrammer.
The software-controlled DFU entry path requires a small hardware modification to the BlackPill: solder a 150 nF ceramic capacitor between the NRST and BOOT0 pins as shown in the project documentation. Without this capacitor, the BOOT0 pin may not be sampled in time during the reset sequence, and DFU entry will fail. The modification is optional — you can always enter DFU manually by holding the physical BOOT0 button while plugging in USB, or use an ST-Link adapter.
Enclosure
The enclosure is designed in KOMPAS-3D and exported as STEP and STL files. All eight printable parts are provided in thehardware/stl_for_printing/ folder. PLA or PETG are both suitable materials. The design accommodates the PCB, BlackPill, encoders, switches, and LED strip in a compact, arcade-inspired form factor.