Kenji Kozai: HyperX Alloy Elite 2 RGB Controller

HyperX Alloy Elite 2 RGB Controller

This project uses a Raspberry Pi Pico as both a USB host (using PIO) and as a USB device, acting as an intermediate between a Hyper X Alloy Elite 2 keyboard and the host while also serving a web page over USB-NCM for configuring the RGB lighting at the individual key level.

The Raspberry Pi Pico uses the ADC to determine the ambient brightness using an attached light dependent resistor, then sends RGB control signals to the keyboard. optionally adjusting the brightness of the keys with the LDR reading. The LEDs are set to full brightness when the room is dark, with the LEDs becoming less bright as the ambient brightness increases. In addition, all keyboard input is received by the Pico then forwarding to the host device. Updated programming dynamically updates the HID descriptors and HID report descriptors to match those on the device plugged into the Pico. This allows HID reports to be passed directly without any processing for increased responsiveness and for all input functionality of the keyboard to be preserved. This includes full compability of the media keys and volume scrol wheel.

A USB-NCM interface has been added to also present an emulated network adapter, fully equipped with a DHCP, DNS, HTTP server. This allows the client to connect to a webpage to configure the RGB values of individual keys using a graphical web interface.

The project will accept any HID input peripheral and forward its information, but it is hardcoded so that only the HyperX Alloy Elite 2 model will have its RGB lighting controlled by the Pico. RGB lighting protocols are largely proprietary and vary from manufacturer to manufacturer, and sometimes even from model to model for the same manufacturer. Due to limited memory on the Pico’s onboard flash, only one protocol is programmed into the firmware, and it will only be activated if the HyperX Alloy Elite 2 keyboard is identified by its vendor ID and product ID.

The mute button also changes colors between the configured color and red. The keyboard will initially start with the mute button lit with the user-configured color, and each press of the mute button will toggle the color to red and back. The keyboard currently cannot read the actual state of the machine, so if the keyboard is plugged in when the machine is on mute, the colors will be inverted.

Code Repository

Tags: