He had some latching Hall effect sensors lying around, but lacked the ring magnet that is usually used with such sensors in magnetic encoders. But luckily, he had a mess of magnetic spheres ...