What Does a Mouse Sensor 'See'?
Mouse

To many users it's an inexpensive accessory that deserves little attention. To others, it's a fundamental part of their sessions, whether gaming or doing precision work. The mouse has evolved greatly over the decades, but one of the most overlooked details is how exactly it works, and what its sensors detect. Would you like to know?

The beginnings

It all started with those two titans, Douglas Engelbart in design, and William English (whom we unfortunately lost a couple of days ago) in building the prototype. Today, the mouse accompanies almost every computer, and not a few users prefer its traditional format over alternatives like the touchpad/trackpad or the classic TrackPoint. Optical models are the most popular, but we didn't get to that technology so easily.

In fact, a video recently published by the 8-Bit Guy explains that we had to go through multiple protocols and interfaces, all incompatible with each other despite similarities. On the “mechanical” side, the mouse went from the two wheels in the Engelbart-English prototype to metal balls that turned potentiometers, but that design limited the mouse's movement.

The optomechanical era

The first quality leap came with the famous “ball mouse”, which first covered the metal ball with rubber, and second adopted an optomechanical system. That means the ball rotates two rollers with wheels and slots in front of a pair of sensors. These sensors are basic, barely detecting the presence of light. The first designs used two posts (one for each sensor), but later they were unified into one, with a slight difference in height.

If we imagine the sensors as “pixels,” each axis has two of them, and the order of the “flashes” helps identify movement in X and Y. Proper functioning of optomechanical mice depends on the sensors having no obstructions and on the contact points between the ball and the rollers being clean. Many people focused on cleaning only the ball, ignoring the dirt accumulated on the rollers.

What Does a Mouse Sensor 'See'?
With the sensor pinout and a bit of code, you can access what the mouse “sees” (Jorge García on GitLab)

First optical mice

The first optical mice used two sensors illuminated with red and infrared LEDs. At the same time, they needed a special mousepad with a grid. That grid is made of lines that make the sensors react depending on the movement performed (for example, vertical lines for the red sensor, and horizontal lines for the infrared one). Once again, the pattern of blinking caused by the lines passing in front of the sensor determines the direction.

Modern optical sensors

Finally we reach the optical sensors in modern mice, which are essentially cameras. In the video we can see the 8-Bit Guy removing the microcontroller from the mouse to access the sensor's pinout (whose datasheet is on the Internet), and with a bit of code he managed to read and write registers. The sensor in question, an Avago 5020, has a total resolution of 225 pixels in a 15 x 15 pattern, and with a delay of 50 milliseconds between reads, he was able to form a basic image.

More information: Click here

https://old.neoteo.com/como-optimizar-tu-raton-con-winmouse/