Skip to content

lukaspirkl/AnalogGaugeUSB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnalogGaugeUSB

AnalogGaugeUSB is a DIY hardware project that brings the retro charm of analog gauges to your modern PC setup. It uses a Raspberry Pi Pico to drive physical needles and RGB lighting, displaying real-time CPU and GPU load information from your Windows computer.

front front front

Features

  • Real-time Monitoring: Displays CPU and GPU usage (0-100%) on two separate analog gauges.
  • RGB Lighting: extensive RGB backlight support for customizable aesthetics (CPU and GPU sides, left and right).
  • USB HID Interface: Driverless plug-and-play connection using standard Human Interface Device (HID) protocol.
  • Easy Debugging: SWD pins are accessible on the back side of the enclosure for easy firmware debugging.
  • Windows Service: Background service runs automatically to fetch sensor data and update the display.
  • 3D Printable Enclosure: Complete files included for printing a custom case.

Hardware Architecture

Components

  • Microcontroller: Raspberry Pi Pico (RP2040)
  • Display: 3V Analog Voltmeters
  • Lighting: Common Anode RGB LEDs
    • Red Cathode: 100Ω resistor
    • Green Cathode: 10Ω resistor
    • Blue Cathode: 10Ω resistor
  • Connection: USB (Micro-USB to PC)

Pinout (Raspberry Pi Pico)

Component Function GPIO Pin
CPU Gauge Needle (PWM) GP10
GPU Gauge Needle (PWM) GP6
GPU Right LED Blue / Green / Red GP0 / GP1 / GP2
GPU Left LED Blue / Green / Red GP3 / GP4 / GP5
CPU Right LED Blue / Green / Red GP7 / GP8 / GP9
CPU Left LED Blue / Green / Red GP11 / GP12 / GP13

Software Architecture

Firmware

The firmware is written in C using the Pico SDK and TinyUSB. It enumerates as a USB HID device.

  • VID: 0x6D6F
  • PID: 0x1004
  • Report ID: 1

It receives 3-byte reports to control the hardware:

  1. Report ID (0x01)
  2. Component ID (0=CPU Needle, 1=GPU Needle, 2-13=LED channels)
  3. Value (0-255)

Host Service

The Windows host application is a .NET 10.0 Worker Service.

  • Uses LibreHardwareMonitor to fetch cpu and gpu load sensors.
  • Uses HidSharp to communicate with the USB device.
  • Installs as a Windows Service to run silently in the background.

Getting Started

Prerequisites

  • Firmware: CMake, ARM GCC Toolchain (for Pico development).
  • Software: .NET 10.0 SDK.
  • Hardware: 3D Printer (for enclosure), Soldering iron, Wires.

1. Build & Flash Firmware

  1. Navigate to the firmware directory.
  2. Create a build directory:
    mkdir build
    cd build
  3. Configure and build:
    cmake ..
    make
  4. Hold the BOOTSEL button on your Pico and plug it in.
  5. Copy the generated .uf2 file to the RPI-RP2 drive.

2. Build & Install Service

  1. Navigate to the service directory.
  2. Publish the project:
    dotnet publish -c Release -r win-x64 -o publish
  3. Run the installation script (requires Admin privileges):
    install.bat
    Alternatively, manually create the service using sc create "Analog Gauge USB" binPath= "..."

3. Enclosure

  1. Open enclosure/AnalogGaugeUSB v6.f3d in Fusion 360 or use the provided .stl files.
  2. Print the parts:
    • AnalogGaugeUSB-front.stl
    • AnalogGaugeUSB-back.stl
    • AnalogGaugeUSB-inside1.stl, inside2.stl, inside3.stl
  3. Assemble the gauges and LEDs into the case and wire them to the Pico according to the pinout.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A DIY analog gauge system that displays PC CPU and GPU load via USB-connected Raspberry Pi Pico.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors