mouse ir sensor question

Hi Guys,
just a quick question regarding mouse optics, now before we confuse this with optical mice, this is one of the old Ball mice that has two rotary wheels in it and some IR transmitter / reciever pairs.

ive already got a sketch working that picks up when you break the beam between them but im a little lost on how you sense which way the rotaty wheel is going? do i need todo this via the analog pin of the arduino and sense if the voltage was rising or falling on the IR reciever?

any advice would be appreciated.

You need two sensors per wheel and use a technique called "quadrature" to sense the direction. The two sensors are offset such that they are about 90° out of phase.

One rudimentary technique to sense quadrature optical detectors is to look for transitions (changes) in one sensor, then immediately look at the other sensor. The second sensor will be HIGH when going in one direction and LOW when going in the other. This method is not the best way to do it, but it's simple and should get you started.

hi guys thanks for the replies, i understand what you say and how it would work, i'm just interested in how a normal mouse would accomplish this with only one sensor pair per rotor?

to give an idea, the picture below (not mine) is a very close representation of the mouse i have, it only has one transmitter reciever per wheel.

i would google the chip in my mouse and see if i could tap into that somehow but its a logitech marked chip and im struggling to find any info on it so far. i will try and get the markings on it later on incase someone on here knows more about them.

How many terminals do those black boxes have? If they have three (or more) there could be two light sensors in the single package.

Edit: See Computer mouse - Wikipedia

johnwasser:
How many terminals do those black boxes have? If they have three (or more) there could be two light sensors in the single package.

Edit: See Computer mouse - Wikipedia

thats a very good point that i took no notice of when i looked at the mouse initially :smiley: will have a better look later, from what your saying i'm guessing there's three pins on the receivers...

thanks for the help everyone.

In highly mass-produced goods like mice, the component suppliers will make parts that integrate just what's needed into a tiny package. So yes, it's quite likely that those sensors incorporate two optical detectors.