>>890854>that was actually what I was planning to do...that is a simpler method, but it's more work for the person. It is also storing a lot more data on a small computer, that won't be used.
And if, once running, the machine does not maintain a constant speed, you will have to store a LOT of time+distance points for it to be useful....
For 20 miles of cable in 8 hours, storing the time+distance every 60 seconds means each interval is a 220-foot stretch of cable, and you would have 480 measurements.
To narrow it down to 2.2 feet would require 48,000 measurements.
Constantly measuring the distance just to have a HUGE list of measurements at the end is just not a very good way to do it.
If the keyence machine already has an audible alarm (or you can get one for it) I would say to try to use that somehow. One possible idea is to build a matching RCL filter circuit that is tuned to the same frequency as the Keyence alarm noise, to help the arduino's microphone ignore everything else better. Even if you had to resort to using an external ADC chip, that would still be easier.
-------
Another option is this: instead of trying to track the distances of the wire as it goes by, can you mark on the wire itself?
Like for example: have a marker of some kind on an arm on a stepper or servo motor, and when the alarm goes off, the arduino moves the marker into the cable for a second or two, leaving a mark directly on the cable at the correct spot.
If you could use a grease pencil, that might be good enough to find the fault areas visually, but it can still be cleaned off most surfaces easily too. 'China markers' come in different colors and are advertised as working on any clean dry surface.
Otherwise you'd have to figure out some kind of non-drying marking setup. There is industrial inkjet setups for this, but they cost $$$$. The stepper + grease pencil method is cheap and easy, and might be good enough.