I have up to 30 items that I need to distinguish between. They will slowly pass a fixed point in a fixed direction and orientation, one at a time in a random order but their exact speed at this point may vary. The sensor has to be as unobtrusive as possible.
My thought was to use a buried IR LED and detector pair to read a simple (5bit) barcode, made by printing 3-4mm wide black bars on white paper, stuck to the base of these items. My problem is that I don't know how to detect when the 'reader' should start to read each barcode. The bases of the items are about 15mm wide by about 35mm long so there is space to include start and stop bits if needed. The IR pair will be about 20mm from the barcode and will give a serial output.
Has anyone any thoughts on this?