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


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
// What's Trending
Raspberry Pi Design Contest
Dad Builds Son an Iron Man Arc Reactor
Teardrop Camper Trailer
Seventeen Sneaky Secret Hides
What to do with an 800 Lb Eucalyptus Slab
10 Things to Connect to Your Raspberry Pi
80-Ruxpin Art Installation
3D Printed Kinetic iPhone Cases
// What's Shared
A better way to slice a pumpkin
DIY Nerf Darts
100 Dollar Store Organization Ideas for Craft Rooms and Beyond
In the Maker Shed: Minty Boost USB Charger
Mad’s Mouse House
Lace Princess Crowns
I Have a (Puzzling) Dream
Play the Rings of a Tree Trunk Like a Record
// Most Commented
Plastic Bags into Plastic Blocks: Revisited
10 Hot New Boards to Watch
Why the Maker Movement is Here to Stay
MAKE Asks: Roadside Hacks
Ten Tips for Hand Saws and Blades
DIY Hacks & How To’s: Convert From Battery Power to AC
How To Make Your Own Laundry Detergent
What to do with an 800 Lb Eucalyptus Slab
Trending Topics
Get our Newsletters
About Maker Media
Subscribe
to MAKE!
Get the print and digital versions when you subscribe