melaphor / two-ball-trackball

DIY trackball with two balls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DIY two-ball trackball

This repository contains design files and code that can be used to make a fully programmable two-ball, three-button USB trackball that looks like this:

Trackball photo

It uses the following components:

  • two 38mm billiard balls
  • two PMW3360 optical sensors
  • main PCB
  • second sensor PCB
  • button switch mount PCBs
  • 3D printed case
  • Omron D2FC switches (or any switches with the same footprint)
  • 2.5mm zirconium oxide (or silicon nitride) bearing balls
  • M3x4 screws for mounting the main PCB
  • M2x4 screws for mounting the buttons and the secondary PCBs
  • 3x10mm wood screws for assembling the case
  • USB cable (cut off the device end and solder the wires directly to the PCB)

The main PCB uses the RP2040 chip from Raspberry Pi. The firmware supports remapping of ball and button functions using a configuration tool without the need to recompile the source code. All the configuration is stored on device, so the configuration tool is only needed to change the settings, not during normal use.

Each ball can be configured to control the cursor or to scroll, with independent CPI setting. High resolution scroll is supported (at least on Windows).

Configuration tool UI screenshot

So far I only tested the configuration tool on Linux, but it should in theory run on Windows and Mac as well. I will try to provide ready-to-use packages in the future.

The provided UF2 file can be used to flash the firmware onto the device. When first connected, a "RPI-RP2" drive will show up and you flash the chip by copying the UF2 file to that drive. If you want to flash it again, hold the BOOT button and press the RESET button on the board.

I printed the case parts with 0.2mm layer height and no supports, though you might want to enable supports for the top part if you're having trouble printing it without them.

Exploded view

The pin numbers are defined at the top of trackball.cc.

Insides of the case

About

DIY trackball with two balls


Languages

Language:C++ 72.2%Language:Python 16.4%Language:C 7.2%Language:CMake 4.2%