Digital 3D printer filament counter using PS/2 mouse

Ever wonder how much filament did you actually use for a project? Have an old mechanical ball mouse laying around waiting for recycling? Let’s convert it into a filament counter with simple Arduino and 3D printed parts. The mechanical PS/2 mouse contains fairly high-resolution encoder wheels and a simple serial interface as well as electronics to process the quadrature input signals from the encoder wheels. There are Arduino libraries written to talk to the mouse and get the direction of the distance of rotation of the encoder wheels. By connecting the encoder wheel to a filament roller, we can track the actual usage of the filament for each project by using the Arduino and display the results in millimeter on a LCD display. Since the mouse outputs the relative position to its original position in both directions, the counter is able to accurately measure and actual usage of the filament even when the filament direction is reversed occasionally due to retraction.”