Sinking input

I am tying to interface an optek OPB825A slotted optical switch. The IR transistor is a NPN type. I have connected the emitter to ground and the collector to digital input pin 2. I have also turned on the internal pull up resistor of the arduino pin 2 by digitalWrite(pin2,HIGH). If I understand the circuit the transistor is sinking the pin to ground when the optical sensor is blocked. In all my other expirements I have always sourced 5 vDC into the input pin. Will the input pin respond to a sink to ground?

Will the input pin respond to a sink to ground?

Yes.

In all my other expirements I have always sourced 5 vDC into the input pin

That is not the conventional way of having an input to a processor.

If I understand the circuit the transistor is sinking the pin to ground when the optical sensor is blocked. In all my other expirements I have always sourced 5 vDC into the input pin. Will the input pin respond to a sink to ground?

Well normally a photo-transistor will turn on only when there is light reaching it, i.e. not blocking. There for the transistor should turn on when not being blocked, this would cause the internal pull-up resistor to be brought to ground through the saturated collector/emitter junction of the photo-transistor, presenting a logic 0 voltage to the digital input pin. When blocked from light the photo-transistor should turn off allowing the internal pull-up resistor to present a logic 1 voltage to the digital input pin.

Does that make sense?

Lefty PS: Ah Grump, this time you drew first shot ;)