A project for upcycling old optical mice into trackballs using QMK or jfedor2's hid-remapper.
QTY | Part |
---|---|
1 | 3D printed top shell |
1 | 3D printed bottom shell |
1 | 3D printed PCB mount (instructions below) |
3 | CY-8H ball transfer unit |
1 | 52.5 mm billiards ball |
6 | Heat-set insert (M3 thread, 3 mm length, 5 mm OD) |
6 | 6 mm M3 bolts |
2-3 | 3 mm cable ties to secure MCU to bottom shell (or glue, double sided tape...) |
4 | Key switches |
2 | 1.25u keycap |
2 | 1u keycap |
QTY | Part |
---|---|
1 | PS/2 compatible optical mouse |
1 | ATmega32u4 MCU e.g.:
|
4 | diode e.g. 1N4148 required for hand wiring |
2 | 4K7 Ohm resistor required to hooking up PS/2 mouse to MCU |
If using hid-remapper by jfedor2
QTY | Part |
---|---|
1 | USB compatible mouse |
1-2 | RP2040 MCU e.g. Raspberry Pi Pico |
1 | male USB plug to suit your Pi Pico |
- Verify that your mouse is PS/2 compatible if you plan to use QMK. Sometimes a USB mouse will be PS/2 compatible but it will not be indicated. The easiest way to check this is by using a green USB to PS/2 adapter. PS/2 is not hot-swappable. Ignore this step if you intend to use a USB mouse with hid-remapper.
- Turn the mouse upside down and see if it will track your ball. Some mice just do not track spherical objects well.
- Desolder the microswitches and rotary encoders to allow the PCB to fit.
- Mount your PCB to the case to verify that you can get it at the correct position to track your ball accurately. You will need to make a custom mount (instructions below). You will most likely need to play with the height and position using the slotted holes and spacers.
Make a high quality scan of your PCB so you can more easily design your mount around its holes and edges. Use the calibrate tool to get your scan at the correct size.
Scan | Calibrate tool |
---|---|
Place your PCB canvas so that the optical sensor is slightly south of the centre point. I've found they tend to track the ball better in this position. Design your mount with slots so that you can adjust the position of the PCB for good focus. I wouldn't suggest spending too much time on this step because the majority of the model will be hidden by the PCB and fillets will make everything look good anyway. You will also need to print some M3 spacers of varying thickness to get your sensor at the optimum height. There is a bit of trial and error to get this right and every model of mouse is different. You may need to trim the PCB. I have included an example in this repository.
Sketch | Printed |
---|---|
Familiarise yourself with the following documentation:
- handwiring
- ps/2 support using USART
Alternatively, you can wire the switches straight to the mouse PCB but you won't be able to remap them in firmware.
Pre-compiled firmware included within this repository. Edit the config.h file of the keymap if you need to change the button mapping or if you want to change the mouse sensitivity. Sensitivity is specified as a percentage.