Steam Controller Auto-Charge – pilot to magnetic charging puck using CV
Summary
An open-source web application using computer vision to automatically pilot a Steam Controller onto its magnetic charging puck via optical flow and WebHID.
View Cached Full Text
Cached at: 07/03/26, 11:17 PM
FossPrime/Steam-Controller-Auto-Charge
Source: https://github.com/FossPrime/Steam-Controller-Auto-Charge
Steam Controller Auto-Charge
Steam Controller Auto-Charge is an open-source web application designed to automatically pilot a Steam Controller into its magnetic charging puck using optical flow computer vision and WebHID telemetry.
Features
- Optical Flow Tracking: Utilizes OpenCV.js to track user-selected points on the controller and the charging puck via an overhead camera.
- WebHID Telemetry & Haptic Navigation: Connects to the Triton Controller natively via WebHID, streaming input and telemetry (Report 67). Navigates the controller towards the puck by firing 70Hz asymmetric haptic pulses through the internal dual Linear Resonant Actuators (LRAs).
- Proximity Creep Mode: Automatically cuts haptic pulse frequency by 50% when the controller is within 150 pixels of the puck to ensure a gentle magnetic dock.
- Battery Status Polling: Intercepts Report ID
121(0x79) to confirm successful magnetic charging, and parses Report ID67(0x43) to display live battery percentage and battery cell voltage (mV).
Setup
Requirements
- Nix Package Manager: The only build dependency you need. It works seamlessly on Windows, Mac, and Linux.
- A Chromium-based browser supporting the WebHID API.
- An overhead webcam pointing down at your desk.
- Mount a webcam directly overhead pointing at the desk.
- Start the project with a single command (this will automatically fetch dependencies and build the WASM module):
nix-shell --run "npm install && npm run dev"
Usage
- Mount a webcam directly overhead pointing at the desk.
- Place the Steam Controller Auto-Charge puck on the desk.
- Place your Steam Controller on the desk, upright.
- Open the web interface and click Connect Steam Controller to pair it via WebHID.
- Click ✨ Auto-Track to engage automatic tracking. The button will highlight to indicate it’s active and will automatically resume tracking on page reload. Click it again to disengage.
- The controller will now autonomously navigate to the puck using a Lucas-Kanade optical flow loop combined with object avoidance powered by an in-browser Rust/WASM CNN!
(Note: Manual tracking is still available if you prefer. Just click the puck, then the top of the controller, then the bottom of the controller).
Architecture
App.vue: Vue 3 application logic handling camera streams, UI reactivity, PID tracking loop, and OpenCV.js Lucas-Kanade optical flow (calcOpticalFlowPyrLK).steamController.ts: WebHID abstraction class mapping standard API calls to the Steam Controller’s specific byte payloads for LRA pulses and battery status polling.objectDetector.ts&objectWorker.ts: Offloads object detection to a Web Worker to ensure the main tracking loop remains fluid.wasm-object-detect/: Rust implementation compiled to WebAssembly for high-performance visual processing.
Thanks
Huge thanks to Very Lazy Pixel for inspiring this project! Check out their video here: https://www.youtube.com/watch?v=g-8S8zk4dn8
License
This project is licensed under the MIT License - see the LICENSE file for details.
Similar Articles
The Steam Controller’s “drop-in” charger almost started a fire for this owner
A Reddit user reports that the magnetic charger for the Steam Controller can overheat and cause fire risk when exposed to metal objects like watch bands, prompting Valve to investigate and replace affected units.
Using local computer vision to perform mouse actions via keyboard
Describes a method for using local computer vision to enable mouse actions via keyboard input.
UniSteer: Text-Guided Flow Matching in Activation Space for Versatile LLM Steering
UniSteer introduces a text-guided activation flow matching method to learn a universal conditional velocity field in activation space, enabling versatile LLM behavior control and classification tasks without task-specific intervention modules.
My Steam Machine Is a 50ft HDMI Cable
A developer shares his experience turning his desktop into a Steam Machine using a 50ft fiber optic HDMI cable and the Steam Controller 2, running Bazzite for a console-like PC gaming experience on a TV.
Listen to the new Steam Controller buzz to the tune of Doom
A new open-source tool called Steam Haptics Singer lets the Steam Controller and Steam Deck play MIDI music through their haptic motors, enabling fun custom sound effects and songs like Doom's theme.