This is a great way to interface an optical mouse with your Arduino. Just make sure your mouse has one of the required optical sensors before you do any permanent damage. If you are interested in a How-To Tuesday based on this project, let me know in the comments. Thanks!
More about connecting an Optical mouse to an Arduino
In the Maker Shed:
Make: Arduino
20 thoughts on “Optical mouse sensor and the Arduino”
Comments are closed.
ADVERTISEMENT
Join Make: Community Today
I would love to vote YES! for a Tuesday How-To.
OK, it’s added to the list.
How fast can the image sensor bitmap be read out? You might be able to make a barcode scanner out of one of these. (I’d like a mouse with that built in!)
How fast movement can these things track? You could make a tire-mounted bicycle speedometer/odometer. (Nearer the hub might be easier to keep up with.)
Or, you could improve the repeatable positioning accuracy of a maze-solving robot (and greatly speed up its second run).
Or, by mounting the sensor in the right place, and adding an Arduino and some relays, you could turn almost any electrically powered wheel/pulley/piston into a reasonably accurate continuous servo or linear actuator – for example, three bumper winches could be used to make a nice large-scale X-Y(-Z) positioning system. (I’m thinking: Parking Lot Plotter!)
The internal DSP has access to 1500fps image data (or more on newer models). Unfortunately to access this data externally you’re forced to use the serial port, which is very slow. 15fps might be the max you can get this way.
Your idea to use it as an odometer is quite good. My G9 gamer mouse has a max speed of only 3.8m/s (about 14km/h) though, so a cheap standard mouse has probably an even slower limit.
That’s why I’m thinking very near the hub would work better, maybe put something with a visible texture in the spokes, and read it from 1/4 of the wheel radius, to measure 1/4 of the tire surface speed.
You could build a nice surveyor’s wheel (hodometer) this way, too. (At walking speeds, you could measure directly off the tire, or the ground!)
You can also get the actual image off those mouse sensors too. I did it once using the parallel port on the PC and a little C# application. Unfortunately I lost all that code after a hard drive crash :(
I made a similar hack using an Arduino and some Java code : http://www.bidouille.org/hack/mousecam/index.php
That’s awesome!! Thanks for sharing. I’m going to post about this tomorrow. Keep an eye on the blog.
hello there.
i am trying to use the optical mouse that i have to measure the speed of surface. I do not have Arduino, i have connected the mouse to a USb ANALYZER and collected data that shows me the changes of X and Y’s. it seems that i need to write a C program for that and i do not have enough skills, can any one help me please
thanks
if you managed to do that… i would be very thankful if you could help me do the same…