| How Mice Work By Wade
Herman, Tampa PC Users Group Most mice and track balls are controlled by the ball on the device contacting two shafts placed orthogonal (perpendicular) to each other. One shaft will rotate when the ball is rotated left and right and the other shaft when the ball is rotated up and down. When the pointing device, and consequently the ball, is moved at some other angle, both shafts will rotate simultaneously and their relative speeds will be proportional to the angle. If the ball rotates at an angle of 45 degrees, both shafts rotate at the same speed. As the movement of the mouse approaches a left and right motion, the speed of the associated shaft increases while that of the other shaft decreases until only the left right shaft rotates. All of this is great but the question still remains, how does this tell the computer how to move the screen pointer? First the shaft rotation must be converted into something the processor in the computer can understand. What is that? You are probably already ahead of me, since most know that the only thing a computer can understand is strings of 1s and 0s, i.e., the presence or absence of a voltage. How can a rotating shaft generate these 1s and 0s? The most obvious way is to put a wheel on the shaft that has a group of equally spaced bumps on it that turn a switch on and off as the shaft rotates. When the switch is on it connects to a voltage source (representing a "1"); when the switch is off the voltage is disconnected (representing a "0"). This was in fact the way some of the earliest mice generated the signal for the computer. The problem is that mechanical switches wear out very quickly, as they may be turned off and on thousands of times a second and undergo millions of operations in a few hours or days. To be practical we must generate the pulses without mechanical contacts. There are several possibilities, but the easiest to implement uses light. How can light do that? Remember when you walk in some small stores there is a bell that rings to alert the clerk. You may already know that this is usually accomplished by projecting a beam of light across the doorway onto a photocell. When the light beam is interrupted by your body, the photocell acts like a switch, generating a pulse of electricity that rings an alarm. So we miniaturize that system thousands of times and put a wheel with many slots or holes in it that break the beam as the wheel and shaft rotates. The light source is an IR (infared) LED (Light Emitting Diode) with almost unlimited life, like the photo diode or photo transistor used as the detector. The light sensitive device generates the pulses without any mechanical contact. These devices can operate much faster than mechanical switches. If we measure the number of 1s and 0s over a short period of time, a few thousandths of a second, it tells us how much the shaft has turned, and ,since the shaft is connected to the ball on the pointing device, we can calculate how much the ball has rotated and thus how far we have moved the mouse, during the sampling period. If we measure the number of pulses from both shafts over the same time period, the ratio (sine function) represents the angle the mouse has moved, i.e., if the number of pulses from both shafts are equal, the mouse has been moved at a 45-degree angle. The computer can easily translate any ratio into an angle and calculate the absolute distance by calculating the square root of the sum of the squares of the pulses from both shafts (made possible by good old Pythagoras). Since the diameter of the ball is much larger than the diameter of the contact point on the shaft and, further, the encoder wheel on the shaft has many holes, every rotation of the ball can produce several thousand pulses, which allows very accurate positioning information, called resolution. The raw data generated in the mouse is encoded by a special processor in the mouse before being sent to the computer to make the operation more efficient. I have outlined most of the principles of mouse operation; however, I have left out one very important principle. If anyone knows what this is and would like an explanation, I will be happy to include it in an article next month. No techies please. u |
![]() |