Wrong readings from voltage divider

I 'm sorry Runaway Pancake but I don't understand what you mean. I 'm measuring range to an object so the emitter can't be pointing at the receiver. It has to point outwards and the receiver gets reflected, not direct light.

Anyway, sorry for staying quiet but I had put this on the back burner. I tried some more measurements in a somewhat more methodical manner, see pic below:

The top (red) section shows raw ADC readings, the bottom (green) a 50 point smoothed average. The three "windows", labelled 5cm, 10cm and 15 cm show some very rough estimates of the range of the object I used for reference (a spare breadboard) from the receiver.

Each window has two depressions, one labelled 100mA and one 30mA. These correspond to the current being fed to the transmitter at the time of measurement. I wanted to see how much worse things get if I limit current to under 40mA so I can power the transmitter from a pin (so I can turn it off when not measuring).

The results don't look too bad, when considering roughly where the limits of detection are. Looking at the smoothed signal, it is not inconceivable that the 15 cm @ 30mA could be picked up by a simple static trigger, although it would be a stretch (and changing ambient light would destroy this). At 10cm and closer, things are quite a bit better. I 'll have a look at using more than one emitter to see what effects I can get.