Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using Optical Mouse technology

Status
Not open for further replies.

BobW

Active Member
Just wondering if anyone here has ever built a project using an optical mouse IC to measure the motion of an object.

Edit:
I just did a bit of searching the net and have probably answered my own question. It looks as if the best option is to hack an older optical mouse, since the newer ones have the optical electronics and USB transceiver all integrated into a single chip. The older chips have a serial interface as well as X and Y quadrature outputs which should be much easier to interface. Also I will need the lens and light pipe which is all included in the mouse.
 
Last edited:
Just wondering if anyone here has ever built a project using an optical mouse IC to measure the motion of an object.

My first step in that direction, here. The rest, I understand, should be receive in sequence, process and interpret data
 
Thanks for the link. I had a look at your attached pdf showing the PS2 timing. Did you decode the complete format for the mouse data?

After my initial post, I went to a junk shop and bought an old Logitech PS2 mouse . Inside was an Avago ADNS-2610 IC. I was dissapointed that this chip doesn't have the quadrature outputs, but it does have the standard serial interface. At this point I'm leaning towards connecting directly to the ADNS-2610 rather than the PS2 interface, since I have the ADNS-2610 datasheet available, and its serial interface should be much faster than the PS2 interface.

BTW, for anyone interested, my plan is to use this to sense the rotation of a car steering wheel. I have an old car that was built before signal lights were used. So, I'm going to build a PIC driven signal light system, but I want them to auto-cancel. Hence the need to sense steering wheel rotation.
 
The distance information consists of numeric values sent to the PC by the mouse. As I said, you read it and process to interpret how much and in what direction the mouse moved.

I taught the micro to read the data sent by the mouse. What to do with it is the next step.

I could be dead wrong but you are looking at the wrong solution. The mouse tells the PC how much it travelled between two readings and in what direction. That's it. The concept of rotation is not implicit here.

The so many projects I recall seen using the chip, all were applied to distance travelled.
 
Distance/Rotation.
From the mouse's point of view, the surface of the searing shaft will appear to move under the mouse.

From my tests, If you move a mouse across a page of paper and then back to the exact same spot the mouse might be off by 1%. (my bad memory) I can look it up the error if you really need the information. I know the mouse has a small error getting back to "zero". I also know if you move the mouse across the page and back to zero, 100 times the error some times adds up. The mouse will pick up direction and speed real nice.

Most of the opto-mouse ICs have a test mode where you can see what the mouse sees. (it is a very low resolution camera) This will not tell you direction or distance. If you painted white and black marks on the shaft the camera will see that. You can tell if the shaft is back to zero. There are simple shaft encoders that will work. You can make one of those.

p.s. If you need more information on mouse ICs just ask.
 
It shouldn't be necessary for the sensor to see the steering wheel return precisely to zero. I don't need surgical precision. If it's accurate to within 5-10% that should be good enough.Here is my algorithm:
1. After the turn signals are switched on, the steering wheel must move at least 90° (or maybe 180° considering the high ratio steering) in the direction indicated by the turn signal setting. At this point a flag is set.
2. If the flag is set and the the steering wheel subsequently returns to within 10% of the start position, then the signal lights are reset.

This should prevent the circuit from being reset due normal steering wheel movement that occurs between the time that the turn signals are switched on and when the car actually turns the corner.

I was originally planning to use magnets mounted in the hub of the steering wheel and have hall sensors in the turn signal lever housing, but it should be simpler to mount the mouse sensor in the same housing and arranged so that it can pick up movement of the steering wheel hub. Remember that on these old cars, the rear of the steering wheel hub is completely exposed, unlike modern cars which have a massive housing enclosing the steering column.

When turn signals became standard equipment in North America in the early 1950's, there were a number of aftermarket turn signal kits available to upgrade older cars. The fancy versions were self cancelling, using a rubber wheel that rolled against the steering wheel hub to mechanically reset the signals. I have a couple of these units. but the rubber wheel has turned rock hard and the rest of the assembly is worn out. I suspect that these things probably weren't very reliable, even when new. I'm going to toss all of the mechanical bits from the housing except the switch lever, and replace it with electronics. I'll use an electromagnet (modified relay) to latch the switch lever.
 
Reed switches are notoriously unreliable, and whether I were to use reed switches or hall effect sensors, I would have to have two of them mounted close together in order to determine the direction of steering wheel movement (similar to the operation of a quadrature encoder). From past experience, getting them positioned correctly, so that they can sense direction, is a rather troublesome operation. I haven't entirely ruled out using hall effect sensors, but I'd prefer to try it with the mouse electronics first.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top