Optical mice use a 18×18 CCD sensor which is navigated by the main chip to analyze whether a picture is moving along a X or Y axis. What many people don’t know is that these 18×18 signals can be received serially if a correct command is given.
This hack transmits these serial signals into a pdf document, which is pretty much the equivalent of a low quality image scan. Each image taken through the sensor can be arranged in a matrix to produce a full image as the mouse moves around the coordinates. This means that your mouse might just be a mini scanner. Feed it some cheese and get it working.
— Andrew Dobrow