That’s the idea behind this Arduino-based measuring jig for fabricating parts for a CNC build ... and a roller with a paper encoder wheel bears on the tube under spring pressure.
[Allan Schwartz] decided to document his experience using Fritzing to design, fabricate, and test a custom Arduino shield PCB, and his step-by-step documentation makes the workflow very clear.