Indoor Robot Positioning From a $5 Mouse Sensor

RoboticsComputer VisionSTM32Embedded

I pulled the optical sensor out of an old HP mouse and turned it into an indoor positioning system for robots.

The idea is simple. A mouse already knows exactly how far it moved across your desk. That's all it does, thousands of times a second. The problem is it only works at about 1mm from the surface, so it's useless the moment you lift it. So I put a webcam lens in front of the sensor and pushed the working distance from ~1mm out to about 6cm.

Now the same chip that tracks your cursor can sit under a robot and track how far it actually rolled across a floor, no contact needed.

Why bother? Indoor robots have a real problem knowing where they are. GPS doesn't work inside. Wheel encoders drift and lie when wheels slip. LiDAR works but it's expensive. This is a couple of dollars of salvaged parts doing dead-reckoning that's good enough to say "you've moved 40cm forward and 12cm right" without any of that.

I calibrated it against a known 10cm slide and landed around 150 counts per cm, which was consistent enough to trust. Photos below show the lens rig taped onto the sensor. It looks like junk. It works.

Built during my time at STMicroelectronics.

Indoor Robot Positioning From a $5 Mouse Sensor — image 1
Indoor Robot Positioning From a $5 Mouse Sensor — image 2
Indoor Robot Positioning From a $5 Mouse Sensor — image 3