Tue. Nov 30th, 2021

Inside of a computer mouse

You’ve probably used a computer mouse for thousands of hours, and yet, have you ever stopped to wonder how it works? Well, essentially the modern computer mouseis a merger of 7 different technologies and some rather ingenious engineering. It would take over an hour to cover all these technologies in-depth, so in this article, we’re going to focus on just one, the image sensor, and find out what exactly happens when you move your mouse around on a mouse pad. After that, we’ll take a look at a gaming mouse and see how some mice have 25,000 DPI or dots per inch, while others have only a few thousand. Stick around and let’s jump right in.

Images sensor

At the bottom of this mouse, we have the image acquisition system or IAS. Which is composed of an Infrared LED, a pair of lenses, andthe image pixel array. Infrared light, generated by the LED, passes through a lens and illuminates the surface directly under neath the computer mouse. Next, the infrared light bounces off the surface, passes through a second lens. Then through a tiny aperture, and finally hits this rathers ophisticated image pixel array.

Or image sensor, which is composed of sixteen hundredpixels, laid out 40 X 40. This is important: your mouse doesn’t capture the colour or design of the mouse pad or surface. Rather, because the light is emitted at as hallow angle, it illuminates the texture. Or the ridges and valleys of the surface, kind of like a sunset falling across rolling hills. The tops of the hills catch and reflect thelight and are illuminated, but the light doesn’t reach into the valleys, and thus they remaindark.

Your eyes might see just a uniform black mouse pad or wooden desk, but because of the shallow angle of the infrared light and the focusof the lenses. The image sensor is able to capture a topographically and texturally complexlandscape. Note that if the surface were perfectly smoothwith no imperfections. The mouse would struggle to work on it which is the reason why somecomputer mice don’t work well on glass [ Note: Some mice are better at detecting theimperfections of a glass surface]. Further more, this image sensor with its 1600pixels focuses only on a tiny area just 1/200th the size of a penny, immediately below themouse. However, the key is that the image sensortakes up to 17,000 pictures of the surface every single second, and thus.

Even if you move your mouse across the mouse pad for just a tenth of a second. The image sensor would take around 1700 pictures during that quick move. And here’s the kicker to this technology: your mouse doesn’t save any of these images, but rather, every time it takes a picture. It compares it to the previous one taken 59 microseconds earlier. The micro chip then uses the difference betweenvthe two images in order to determine the change in X and change in Y. Or in essence how farand in what direction you moved your mouse in that one seventeen-thousandths of a secondor 59 microseconds.

Cross-correlation algorithm

Let’s dive a little deeper into this idea. If we have two images of the top o graphic altexture of the surface taken 59 microseconds apart. How exactly does the microchip determinethe change in X and the change in Y between them? Well, to calculate this, the two images aresent to a section of the microchip called the digital signal processor. Or DSP for short,where an algorithm called cross-correlation is executed.

As mentioned before, each image is composedof 40 by 40 pixels. And every pixel generates a value between 0 and 4095 that relates tothe intensity of light that hits that particular pixel. Here we represent the values by the heightof each pixel. The digital signal processor or DSP takes the first image and overlays the second image on top of it. Next, the DSP subtracts all the values ofthe second image’s individual pixels from the first, and we get a new resulting image.

The processor then shifts the second image around while leaving the first stationery and continues to calculate the difference between the two images until a position is found where the resulting image is at a minimum. The amount of shift in position to reach aminimum resultant image tells us exactly how far the mouse moved between two successive images taken one seventeen thousandths of a second apart, yielding a value for the changein X and the change in Y, measured in pixel counts. 59 microseconds later another image is captured, and the processor performs the same cross-correlation algorithm. But with the new image shifting around, and the previous image stationary, resulting in another set of values.

The processor continues to capture new images and executes the cross-correlation algorithm 17 times. It then adds up all the values, and we gethow far the mouse moved in one millisecond. This combined change in X and change in Y for the one millisecond is then sent to the System on a chip over here. Which in turn relays the information to your computer using either a USB transceiver or Bluetooth [ Note: Point to Bluetooth card]. And that’s how your mouse calculates movementevery single millisecond.

Difference between gaming mouse and normal mouse

Let’s now take a look at the difference between gaming mice and non-gaming mice. Aside from the sharper-looking shape of themouse. A different number and layout of buttons, and the LED lights, the first main differenceis the specified DPI or dots per inch. Gaming mice have DPI specs of 12,000 to 25,000while non-gaming mice are closer to 850 to 4,000 DPI. But that begs the question, what exactly isDPI?

Well, when you move your mouse to the rightby 1 inch, however many units your cursor moves across the screen results in the valueof dots per inch. A DPI of say 2,000 means your cursor will move 2,000 units for every 1 inch of movement of the mouse. However, how does this relate to the image sensor and the cross-correlation algorithm that we talked about earlier? Well, let’s say each pixel in this 40 by40-pixel image sensor has a length and height of 30 micrometres totalling a square 1.2mmby 1.2mm.

About DPI & DOT

If we were to extrapolate this sensor’spix-els out to an inch in length. Then we would need around 850 pixels, which in effectwould yield a DPI of 850. In order to reach a higher DPI, we need tosubdivide each whole or integer pixel using multiple cuts. Let’s take each pixel and subdivide it by 4 along the X direction and 4 along the Y. Each pixel turns into 25 subpixels and now, our 850 DPI sensor has a DPI of 4,250. However, if we were to make 29 cuts along each length of every single pixel, we get a DPI closer to 25,500. Note that DPI is a linear unit, whereas pixelsper square inch is a square unit.

How do we reach 25,000 DPI

So now that we have the general idea, how specifically does it happen? Well, a common technique for subdividing whole pixels into subpixels is called interpolation, and the simple version goes like this. Here we have 4 whole or integer pixels, each with a value for the intensity of light hitting that pixel and just as before. The height of each pixel represents the value as well as an approximation for the textural topographyof the surface. Next, we draw a line between the tops of the two sets of pixels in the X direction, and then draw lines between the two lines in the Y direction. Then, depending on how many sub pixels we want,we subdivide the lines accordingly. At each intersection, we have a corresponding value for a new interpolated subpixel.

So, when you change the DPI settings of your mouse. What you are actually changing is the number of subdivisions in this interpolation algorithm. Here we’re showing a bilinear interpolation. It’s called bilinear because we draw straightlines between the whole integer pixels. However, a bicubic interpolation, which usesa little more math, can be used to create a smoother topography. One additional difference between gaming mice and non-gaming mice is. That gaming mice typically report their movements to the computer 1000 times a second, or once every millisecond. Where as non-gaming mice send data 120 times a second. Further more, the number of pictures taken every second called the frame rate, of 17,000 is only this high. When you are quickly moving your mouse, and it scales down when your mouse is stationary in order to conserve batterylife.

specifications of different computer mice

One important thing to note is that there are a wide variety of mice out there, and in this article, we listed specs of a frame rate of 17,000, and a resolution of 25,000 DPI. Which are the specs for a rather high-end gaming mouse. Specs typically range from 4000 frames per second to 17,000, 1,000 DPI to 25,000, 18 by 18 pixels to 40 by 40, and a reporting rate from 100 to 1000. Further more, we showed a mouse that uses aninfrared LED for illumination. Where as some mice use a laser, older mice use a red LED, and prehistoric mice use a ball.

By Ahsan