Ball Mouse working ?

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
I just opened a ball mouse , i saw 2 encoder wheels ( one for x direction and other for y direction movement ) an ir light was made to pass thru the encoder and ther was a reciever on the other end. The most baffling thing encountered was there was only one ir light and one reciever for each encoder ( as the reciever was 3 terminal , vcc,gnd and data) only a single bit data can be passed , then in that case how does the mouse sense the direction of motion of the the wheel ? when i gave one to the data line of the recivere the mouse moved from left to right and stationary at 0 ( similar for y axis when given 1 moved up but stationary when 0)
How does this ball mouse work rather how does it sense direction by visibly seeing that its giving only 1bit data !!!!
 

hgmjr

Joined Jan 28, 2005
9,027
Here is a link to a website that explains the basic working of a computer mouse.

I suspect that in reality there are two photosensors/photoemitters inside the package that you think is only one.

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
Keep in mind that the ability to miniaturize has made it possible to build all of the electronics needed to support the optoelectronics interface is very feasible. All that would be needed then is the power supply pins and the phase quadrature outputs.

hgmjr
 

SgtWookie

Joined Jul 17, 2007
22,230
I'm using an older Mitsumi PS/2 scroll mouse, model ECM-S5702, which has a similar setup inside. For each channel there is an infrared emitter (labeled D1, D2), and a receiver (labeled Q1, Q2). They're much more than simple IR receivers, though! Each Qx must have at least two receivers in order to be able to detect the edge of a wheel vane.

Hooked up the O-scope across ground and a signal line. I was surprised at the stream of data coming out when the mouse was moved! But basically, when the mouse was moved in one direction, the bit pattern began with "110100", and the other direction it was "111100" - so there you have it.
--_-__ ... (one direction)
----__ ... (other direction)

There was quite a bit more data, but I only had two hands to hold the probe and move the mouse; taking a pic just wasn't in the cards I'm afraid.
 

Thread Starter

prodigyaj

Joined Dec 11, 2007
48
but was the code cyclice ? i mean when u go on moving towards one direction does the above code remain constant ?? and any idea of bit rate ?
 

SgtWookie

Joined Jul 17, 2007
22,230
Cyclic, do you mean?

It seemed that every time the interrupter wheel vanes moved, a signal was output that began with similar to the above sequence.

One portion of the bitstream was rather interesting - it was PWM'ed, and that particular section seemed to grow and shrink while the mouse was being moved at a fairly constant speed and direction, as if the PWMed portion were controlled by a triangle wave. I can only surmise that info is used by the mouse driver software to "catch up" in case the system was busy for a period of time (like an unruly 16-bit program had kept the CPU tied up.) That would explain why the cursor sometimes "jumps".

I don't remember what my Oscope was set to as far as time/div, sorry. Perhaps later on I'll pull my mouse apart again and try to make a video of the bit pattern.
 
Top