Pages: [1]   Go Down
Author Topic: mouse ir sensor question  (Read 1539 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8695
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8695
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://en.wikipedia.org/wiki/Mouse_(computing)#Mechanical_mice
« Last Edit: August 04, 2011, 01:42:04 pm by johnwasser » Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://en.wikipedia.org/wiki/Mouse_(computing)#Mechanical_mice

thats a very good point that i took no notice of when i looked at the mouse initially smiley-grin 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.
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: