2

I want to find out if it is possible detect and identify individual rolling stock of an H0 scale model railway using a bar code scanner.

The biggest problem is the short distances there is only 5mm or perhaps even less to the scanner and the actual bar code.

Instead of using a commercial scanner I was thinking to use an IR emitter/receiver such as the sharps IS471F and some self made barcodes with relative large bars. Perhaps even a bar code with a reflective surface. Every first and last bar would get a fixed size to filter out the train's speed.

If I put a plate with a small hole over the IR LED to narrow the IR light. A bit like a baffled sensor. Would it be feasible to detect a barcode at only a few mm distance, provided that the bars are large enough to get a decent reading, or is this method next to impossible?

bask185
  • 565
  • 2
  • 9
  • Barcode scanners are a little bit like UARTs - they do not capture 2D images and then look for a whole barcode in a single snapshot - they scan and then look for barcodes in the time dimension (sounds sci-fi). If the train with the barcode is rolling past the top of the sensor in the same direction the barcode is written, then the sensor doesn't need to scan at all. – user253751 May 02 '23 at 21:10
  • in fact if you can find a slow enough UART you might even be able to literally just attach your sensor to a UART. – user253751 May 02 '23 at 21:11
  • consider QR codes if the fit makes sense, as they're designed for exactly this (identifying parts on assembly lines) and are even better at getting the scanner to cope with moving geometry. – 2e0byo May 03 '23 at 09:54

1 Answers1

8

With a cheap serial pen scanner hooked up to Arduino you could do this in an afternoon with zero extra components. Most label printers will do barcodes.

Edit: also known as "wand" scanners.

vir
  • 14,718
  • 13
  • 28