Mouse
Mouse
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
1.
shows the two white rollers on this mouse:
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:
typical optical
encoding disk: This
disk has 36 holes
around its outer
edge.
closeup 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.
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:
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. This page offers a nice explanation of how direction is determined.
Developed by Agilent Technologies and introduced to the world in late 1999, the optical
mouse actually uses a tiny camera to take 1,500 pictures every second.
Able to work on almost any surface, the mouse has a small, red light-emitting
diode (LED) that bounces light off that surface onto a complimentary metaloxide semiconductor (CMOS) sensor. The CMOS sensor sends each image to
a digital signal processor (DSP) for analysis. The DSP, operating at 18 MIPS
(million instructions per second), is able to detect patterns in the images and
see how those 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.
Although LED-based optical mice are fairly recent, another type of optical
mouse has been around for over a decade. The original optical-mouse
technology bounced a focused beam of light off a highly-reflective mouse
pad onto a sensor. The mouse pad had a grid of dark lines. Each time the
mouse was moved, the beam of light was interrupted by the grid. Whenever
the light was interrupted, the sensor sent a signal to the computer and the
cursor moved a corresponding amount.
This kind of optical mouse was difficult to use, requiring that you hold it at
precisely the right angle to ensure that the light beam and sensor aligned.
Also, damage to or loss of the mouse pad rendered the mouse useless
until a replacement pad was purchased. Today's LED-based optical mice
are far more user-friendly and reliable.
Data Interface
Most mice in use today use the standard PS/2 type
connector, as shown here:
These pins have the following functions (refer to the above photo for pin numbering):
1.Unused
2.+5 volts (to power the chip and LEDs)
3.Unused
4.Clock
5.Ground
6.Data
2.
3.
4.
5.
6.
Y direction
7.
X overflow (the mouse moved more than 255 pulses in 1/40th of a second)
8.
Y overflow
The next 2 bytes contain the X and Y movement values, respectively. These 2 bytes
contain the number of pulses that have been detected in the X and Y direction since
the last packet was sent.
The data is sent from the mouse to the computer serially on the data line, with the
clock line pulsing to tell the computer where each bit starts and stops. Eleven bits
are sent for each byte (1 start bit, 8 data bits, 1 parity bit and 1 stop bit). The PS/2
mouse sends on the order of 1,200 bits per second. That allows it to report mouse
position to the computer at a maximum rate of about 40 reports per second. If you
are moving the mouse very rapidly, the mouse may travel an inch or more in onefortieth of a second. This is why there is a byte allocated for X and Y motion in the
data protocol.
Some mice use serial or USB type connectors. See How Serial Ports
Work and How USB Ports Work for information on these technologies.