I am trying to build an optical sensor for my old school, state property, standard french watt-o-meter. EDF ( Electricité de France ) has a gig which turns a wheel depending on watt consumption. The higher the wattage, the faster a tiny disk turns.

Now the disk can be read by eye, so here is my question: why not use a hacked optical mouse to gather data ?

The contraints are:

  • can't open the gig
  • the wheel is 1.5 cm away from a protective glass
  • I have an optical mouse

The CMOS has a half milimeter opening, and a 2mm lens from the standard casing.

What optical system do I need to read half milimeters from 15 milimeter distance using a classic optical mouse?

Can anybody help me calculate the correct lenses for this, or point me in the right direction?

  • 3
    $\begingroup$ electronics.stackexchange.com/q/87625 addresses using an optical mouse for measuring. Is this what you're looking for? $\endgroup$
    – Robin
    Feb 2, 2015 at 19:29
  • 4
    $\begingroup$ You will be far better off (like 5% the difficulty of what you're trying) by using an amperometer in series after the unopenable wattometer - just pass the mains wire through a coil, rectify the coil output (or just cut half with one diode), then sum (integrate) the voltage produced by the coil with a simple ADC in some cheap kit microcontroller. Callibrate by dividing the sum over specific time by such a factor that the result is the same as on the wattometer. $\endgroup$
    – SF.
    Feb 2, 2015 at 19:54
  • $\begingroup$ I see separate questions here: 1. Focal distance of optical mouse and 2. Help with optical system design. These are separate from whether or not such a contraption is possible. $\endgroup$
    – hazzey
    Feb 8, 2015 at 20:34

1 Answer 1


The focal distance of the laser lens and the distance from the target (i.e. table) that an optical mouse will work with are two different things. You ask for the former, but it seems that you want the later.

To answer the question that you asked: Every mouse is different, but you can expect on the range of millimeters. If you can remove the lens from the mouse, then hold it with pliers and move it closer and further from a white sheet of paper under the sun. The height at which the sunlight makes a point on the paper is the focal distance. On a cheap mouse laser lens that I tried, I got about half a centimeter judging by eye.

To answer the question that you meant to ask: Every mouse is different, but you can expect on the range of millimeters to just a few centimeters. My nice modern Microsoft Curve wireless mouse fails to work at more than 2-3 millimeters above the mousepad. My Logitech G500 works a good centimeter above the mousepad, and I remember when optical mice first came out how I could hold the mouse a good 5 cm above the desk and still have it detect the motion.

I recommend trying to get the oldest optical mouse that you can, the sort with the bright red laser. By my own testing, these seem to work furthest from the targeting surface.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.