Help idenitifying correct infrared sensor

I currently have infrared sensors that connect by USB to a laptop. Each time the IR beam is interrupted, the sensor sends a single byte of data to the computer.

I need to buy IR sensors that will send a continuous stream of bytes and that will change the bytes from 0 to 1 (or vice-versa) when the beam is interrupted. I want to capture the duration of the interruption. Does anyone know of a product within Digi-key’s inventory that can meet this requirement?

The other details are that the sensor must detect short-range (e.g. 5 cm to 10 cm) and be able to detect an object breaking the IR beam for 500 milliseconds. Ideally, the sensor would be programmable.

Thank you for your consideration.

@ Callum


I’m assuming that you’re using a two-sensor system: emitter and receiver. It looks like you need a module with some supporting circuitry built in for the additional functions. I don’t see one on our site that will perform exactly that way, but you can build one if you are able to invest some time and resources.

I’ll use part number 2167-ND as an example. Unfortunately, there is no stock available at the time of this post, but it has some supporting material that may be useful. You might be able to design around this same concept. This Arduino example using the same IR modules shows how the sensors are connected to an Arduino Uno, but any programmed stand-alone microcontroller will do. Input from the sensors is processed by the MCU, and output is sent to a piezo buzzer.

For your application, you would simply change the way data is handled and processed, and the output would probably be to your computer rather than to a device (buzzer).

Hi Callum,

If you’d prefer a solution that does not require microcontroller programming, but you are fine to do some tinkering, you could perhaps use a USB-to-SPI interface card, such as
Just tie an IR-receiver diode and a resistor to the MISO input of the board so that the MISO line goes high when having light and low when not (or opposite) and periodically sending a dummy byte from PC (via virtual COM port) to create an 8-bit SPI frame and then read back the response, which will be 0x00, when there is no light and 0xFF (or other non-0x00 value) when there is an enlightenment (or opposite)