Phototransistor circuit

I’ve been trying to use a phototransistor as a simple switch. The particular one I’m using is a VS 1838. This phototransistor has 3 pins identified as VCC, GND and OUT,

I’ve found a couple of application circuits online which are only slightly different.

In both the VCC pin is connected to a 5v input (e.g. 5v Arduino pin) via a 100 ohm resistor. In both the GND pin is connected to GND (e.g. Arduino GND pin). In both there are 2 capacitors connecting the VCC to GND. In both, one of these is 0.1uF. However in one the other is 10uF and the other is 100uF.
Output is taken from the OUT pin (e.g. to Arduion analogue pin). In both there is a resistor between OUT and the 5v input. In one circuit this is 10K ohm, the other > 20K ohm/

The peak sensisitivty of the transistor is 940nm

Prsumably when NO IR source is shining on the transistor the output should be LOW and when it IS shining then it should be HIGH.

However, when I’ve tried this with NO IR source, the output is ~ 4.5v. When I switch on an IR source the output momentarily dips (goes down) then back up again.

Has anyone any idea what is happening here, it certainly isn’t acting as a switch!

Have attached circuit diagram

Prsumably when NO IR source is shining on the transistor the output should be LOW and when it IS shining then it should be HIGH.

No exactly. This is not a simple photo transistor but an IR remote receiver. It has a filter for an 38kHz modulation, so if you put the sensor into sunlight (which includes most IR frequencies) it should not react.

However, when I've tried this with NO IR source, the output is ~ 4.5v. When I switch on an IR source the output momentarily dips (goes down) then back up again.

About what you could expect.

Has anyone any idea what is happening here, it certainly isn't acting as a switch!

It's not made for that.

Google "TL1838 datasheet" for more details.