How computer mouse work

How Computer Mice Work

Mice first broke onto the public stage with the introduction of the Apple Macintosh in 1984, and since then they have helped to completely redefine the way we use computers.
Every day of your computing life, you reach out for your mouse whenever you want to move your cursor or activate something. Your mouse senses your motion and your clicks and sends them to the computer so it can respond appropriately.
We'll take the cover off of this important part of the human-machine interface and see exactly what makes it tick.

Evolution of the Computer Mouse

It is amazing how simple and effective a mouse is, and it is also amazing how long it took mice to become a part of everyday life. Given that people naturally point at things -- usually before they speak -- it is surprising that it took so long for a good pointing device to develop. Although originally conceived in the 1960s, a couple of decades passed before mice became mainstream.
In the beginning, there was no need to point because computers used crude interfaces like teletype machines or punch cards for data entry. The early text terminals did nothing more than emulate a teletype (using the screen to replace paper), so it was many years (well into the 1960s and early 1970s) before arrow keys were found on most terminals. Full screen editors were the first things to take real advantage of the cursor keys, and they offered humans the first way to point.
Light pens were used on a variety of machines as a pointing device for many years, and graphics tablets, joy sticks and various other devices were also popular in the 1970s. None of these really took off as the pointing device of choice, however.
When the mouse hit the scene -- attached to the Mac, it was an immediate success. There is something about it that is completely natural. Compared to a graphics tablet, mice are extremely inexpensive and they take up very little desk space. In the PC world, mice took longer to gain ground, mainly because of a lack of support in the operating system. Once Windows 3.1 made Graphical User Interfaces (GUIs) a standard, the mouse became the PC-human interface of choice very quickly.
The main goal of any mouse is to translate the motion of your hand into signals that the computer can use. Let's take a look inside a track-ball mouse to see how it works:

Inside a Mouse

  1. ball inside the mouse touches the desktop and rolls when the mouse moves. The underside of the mouse's logic board: The exposed portion of the ball touches the desktop.
  2. Two rollers inside the mouse touch the ball. One of the rollers is oriented so that it detects motion in the X direction, and the other is oriented 90 degrees to the first roller so it detects motion in the Y direction. When the ball rotates, one or both of these rollers rotate as well. The following image shows the two white rollers on this mouse:The rollers that touch the ball and detect X and Y motion
  3. The rollers each connect to a shaft, and the shaft spins a disk with holes in it. When a roller rolls, its shaft and disk spin. The following image shows the disk: A typical optical encoding disk: This disk has 36 holes around its outer edge.
  4. On either side of the disk there is an infrared LED and an infrared sensor. The holes in the disk break the beam of light coming from the LED so that the infrared sensor sees pulses of light. The rate of the pulsing is directly related to the speed of the mouse and the distance it travels. A close-up of one of the optical encoders that track mouse motion: There is an infrared LED (clear) on one side of the disk and an infrared sensor (red) on the other.
  5. An on-board processor chip reads the pulses from the infrared sensors and turns them into binary data that the computer can understand. The chip sends the binary data to the computer through the mouse's cord.
The logic section of a mouse is dominated by an encoder chip, a small processor that reads the pulses coming from the infrared sensors and turns them into bytes sent to the computer. You can also see the two buttons that detect clicks (on either side of the wire connector).
In this optomechanicalarrangement, the disk moves mechanically, and an optical system counts pulses of light. On this mouse, the ball is 21 mm in diameter. The roller is 7 mm in diameter. The encoding disk has 36 holes. So if the mouse moves 25.4 mm (1 inch), the encoder chip detects 41 pulses of light.
You might have noticed that each encoder disk has two infrared LEDs and two infrared sensors, one on each side of the disk (so there are four LED/sensor pairs inside a mouse). This arrangement allows the processor to detect the disk's direction of rotation. There is a piece of plastic with a small, precisely located hole that sits between the encoder disk and each infrared sensor. It is visible in this photo:
A close-up of one of the optical encoders that track mouse motion: Note the piece of plastic between the infrared sensor (red) and the encoding disk.
This piece of plastic provides a window through which the infrared sensor can "see." The window on one side of the disk is located slightly higher than it is on the other -- one-half the height of one of the holes in the encoder disk, to be exact. That difference causes the two infrared sensors to see pulses of light at slightly different times. There are times when one of the sensors will see a pulse of light when the other does not, and vice-versa. 

In this photo, you can see the sensor on the bottom of the mouse.

Optical Mice

Developed by Agilent Technologies and introduced to the world in late 1999, the optical mouse­ actually uses a tiny camera to take thousands of pictures every second.
Able to work on almost any surface without a mouse pad, most optical mice use a small, red light-emitting diode (LED) that bounces light off that surface onto acomplimentary metal-oxide semiconductor (CMOS) sensor. In addition to LEDs, a recent innovation are laser-based optical mice that detect more surface details compared to LED technology. This results in the ability to use a laser-based optical mouse on even more surfaces than an LED mouse.
Here's how the sensor and other parts of an optical mouse work together:
  • The CMOS sensor sends each image to a digital signal processor (DSP) for analysis.
  • The DSP detects patterns in the images and examines how the patterns have moved since the previous image.
  • Based on the change in patterns over a sequence of images, the DSP determines how far the mouse has moved and sends the corresponding coordinates to the computer.
  • The computer moves the cursor on the screen based on the coordinates received from the mouse. This happens hundreds of times each second, making the cursor appear to move very smoothly.
Optical mice have several benefits over track-ball mice:
  • No moving parts means less wear and a lower chance of failure.
  • There's no way for dirt to get inside the mouse and interfere with the tracking sensors.
  • Increased tracking resolution means a smoother response.
  • They don't require a special surface, such as a mouse pad.

Optical Mouse Accuracy

A number of factors affect the accuracy of an optical mouse. One of the most important aspects is resolution. The resolution is the number of pixels per inch that the optical sensor and focusing lens "see" when you move the mouse. Resolution is expressed as dots per inch (dpi). The higher the resolution, the more sensitive the mouse is and the less you need to move it to obtain a response.
Most mice have a resolution of 400 or 800 dpi. However, mice designed for playing electronic games can offer as much as 1600 dpi resolution. Some gaming mice also allow you to decrease the dpi on the fly to make the mouse less sensitive in situations when you need to make smaller, slower movements.
Historically, corded mice have been more responsive than wireless mice. This fact is changing, however, with the advent of improvements in wireless technologies and optical sensors. Other factors that affect quality include:
  • Size of the optical sensor -- larger is generally better, assuming the other mouse components can handle the larger size. Sizes range from 16 x 16 pixels to 30 x 30 pixels.
  • Refresh rate -- it is how often the sensor samples images as you move the mouse. Faster is generally better, assuming the other mouse components can process them. Rates range from 1500 to 6000 samples per second.
  • Image processing rate -- is a combination of the size of the optical sensor and the refresh rate. Again, faster is better and rates range from 0.486 to 5.8 megapixels per second.
  • Maximum speed -- is the maximum speed that you can move the mouse and obtain accurate tracking. Faster is better and rates range from 16 to 40 inches per second.


Popular posts from this blog

How to hack your xbox 360 completely

Defusing Fork Bomb

Wii Remote IR Camera Hack with Arduino Interface