The NeXT mouse is a simple device without much smarts inside. It's of the general class of mouse known as the optomechanical bus mouse, which communicates with a microcontroller or dedicated chip inside a computer to decode logic signals into motion and button presses.
Mechanically, there is a ball that is able to roll on any flat surface. When it rolls, it causes two internal “wheels” to turn, one when the mouse moves horizontally, and one when it moves vertically.
These wheels have small slits in them. Together with LEDs and phototransistors, each wheel produces a quadrature signal, which can be decoded by a microcontroller into the amount of relative motion. In CircuitPython, the IncrementalEncoder
object performs this task.
Diagram of a mechanical mouse (from Wikipedia by Pbrks). "Pulling the mouse turns the ball. X and Y rollers grip the ball and transfer movement. Optical encoding disks include light holes. Infrared LEDs shine through the disks. Sensors gather light pulses to convert to X and Y velocities."
Rotary encoder, with corresponding A/B signal states shown on the right (from Wikipedia by JackPotte and Delt01). In an optomechanical mouse, there is just one set of holes, but two photodetectors that are displaced so the hole exposes them to light at different times.
There are also two buttons, microswitches that can be actuated by a movable part of the mouse enclosure. These can be treated as a set of independent buttons by the keypad.Keys
object, or just as digital inputs.
In the original NeXT computer, the microcontroller inside the keyboard decoded the mouse signals and transmitted them on to the computer. In this project, the task will be performed by an Adafruit QT Py RP2040 instead.
The number of I/Os required on the microcontroller is small: 4 for the two quadrature signals, plus 1 more for each button. For the NeXT mouse, that's just 6 GPIOs needed.
Happily, someone has already figured out the pinout of this mouse and many similar mice, check out the Deskthority Wiki page on bus mice!
While the mouse is reportedly specified to operate at +5V, experimentally it works fine with 3.3V which is great for interfacing with modern microcontrollers like the RP2040.
Page last edited March 08, 2024
Text editor powered by tinymce.