End sensor

Hi,
I have a slotted optical switch that I want to apply to my single axis pushing system. I was wondering if anyone has worked with this and can explain me.

the sensor i have is from tigerstop. Does anyone know where the pins connect to. (from sensor to my arduino mega) I know it has a plus-minus and a collector and emitter. only i don't know how to connect / code it to my arduino

The plus-minus pair are connecting to the LED, so you'll normally need a current limiting resistor in series
with this to provide the internal illumination, choose resistor for about 10mA or so from whatever supply
voltage you have. IR LEDs are about 1.1V forward voltage roughly.

The collector/emitter are the output photo-transistor, which you treat like the output of an opto coupler
(should be able to google lots of examples for opto couplers). An opto switch is like an opto coupler with
the addition of a moveable light barrier in the optical path.

here is a picture of the end sensor.

again