I would like to build a device to measure the length of a linear component(wire, printer filament, tubing). I know Arduino based 3d printers/CNC machines convert distance into rotational motion of a stepper motor to accurately position the extruder or spindle. I want to do the reverse. I want to measure the length of a wire by passing it through rollers, change the rotation into a length that is accumulated.
As an example, pass 3d printer filament between rollers on an axle, translate the rotation into linear distance and store that distance to keep track of filament used, and therefor be able to calculate the length of filament remaining.
I know the Arduino can handle this, but don't know where to start. Ideas?
Have some form of encoder attached to the roller and that way you can measure how much the roller has turned (in steps - from one step per rotation up to as many as you can fit sensors on it).
Many ways: magnetic, optical, inductive - do a search for encoders or so and you'll find lots of examples.
I think I found what I want. A project using the rotary encoder from a mechanical mouse with an Uno to calculate and display filament used.
Project is here: Digital Filament Counter use Arduino by sb43201 - Thingiverse
Thanks. If it does not work as I want, I'll be back...