Mad-mouse


Custom USB mouse based on RP2040 and PixArt PAW3327DB optical sensor.
Designed as a fully programmable mouse platform with RGB lighting, encoder, and extra buttons.

alt text

What’s on the board


  • RP2040 microcontroller
    • USB HID device (mouse)
    • SPI master for sensor communication
  • PAW3327DB optical sensor
    • High-performance gaming-grade sensor
    • Mounted with dedicated footprint and PCB cutout per datasheet
  • User inputs:
    • 2× main mouse buttons (L/R)
    • 1× scroll wheel encoder with button
    • 2× side functional buttons
  • Lighting:
    • 12× addressable RGB LEDs (WS2812)
  • Connectivity:
    • USB via Type-C (direct HID device)

Pinout (RP2040 ↔ PAW3327DB)


RP2040 GPIOPAW3327DB SignalNotes
GPIO13SCLKSPI clock
GPIO14ISSChip select
GPIO15MOSISPI data out
GPIO16MISOSPI data in
GPIO17IRQSensor interrupt

Power & Form Factor


  • Powered directly from USB Type-C
  • Compact mouse-shaped PCB with cutout for PAW3327DB lens
  • Integrated lighting and buttons on-board

Use Case


  • Fully programmable USB mouse for PC
  • Customizable firmware (via TinyUSB / Pico SDK)
  • Can be extended with macros, DPI switching, lighting control

Quick Use


  1. Connect Mad-mouse to PC via USB-C.
  2. Flash firmware (UF2 bootloader on RP2040).
  3. Device enumerates as USB HID mouse.
  4. Test motion, buttons, scroll, and LED patterns.

Notes


  • PAW3327DB requires precise mounting height and lens alignment (per datasheet).
  • WS2812 LEDs need sufficient decoupling and stable 5 V supply.
  • Encoder can be configured with RP2040 PIO/IRQ for accurate scroll detection.