Categories
Uncategorized

Sensor for detecting thin lines

A few months ago I was asked to build a custom counter. I get that request fairly often, but this one was different. The thing that needed to be counted was the transition of a thin line past the sensor. The feature to be counted was about 0.5mm thick. It was a black line on a yellow background so at least the contrast was pretty good. Since the counter needed to be portable and could not be attached to the equipment containing the feature to be counted, we figured that a way to visually align the sensor to the line was best. This meant that the sensor would emit visible light, so it would be possible to see when the light was in the right spot.

Since a 0.5 thin line is in the realm of barcode line decoding, I looked for sensors used in barcode readers. Problem is, that they are rarely specified that way. All I could find were 2D barcode sensors/cameras and those were overkill for my purpose. Oh, well!

So I figured that what made the most sense was a sensor with a small field of view. That way it could provide the highest signal to noise ratio (SNR).

I tried a number of sensors but the one that offered the best performance was the Optek OPB70DWZ. Having a red LED meant it was easy to tell when it was correctly positioned to “see” the feature. We found that the optimal distance from sensor to object was about 4mm. At that distance it worked quite reliably. The sensor was biased with a 4.7k ohm resistor to +5V. I found that by varying the bias, I could affect the sensitivity and adjust it for best SNR.

The counter itself had some logic to control the machine whose behavior was being counted, and it also required a display to show the count and to indicate what the current machine state was, so I did not use one of our existing RS232 counters. Instead I created a custom application based on an Arduino Nano and it’s worked quite well. The customer appears quite pleased with its performance.

The usual disclaimer: we’re not affiliated with Optek, but very happy with the performance. I’m posting this here because when looking for an optical sensor that could detect very small features or lines, nothing useful was returned from my searches. Hopefully this helps someone in the future.




If you'd like to subscribe to this blog, please click here.