Sharp IR GP2Y0D810Z0F 10 cm sensor

I aquired the Pololu carrier pololu.com/catalog/product/1134 for the small sharp IR sensor. Plugged it into my breadboard, supplied the 5V and used a PIC to measure and display the output.

Supplying 5V to the sensor I get
Distance>10 cm (LED off): 3.90V
Distance<10 cm (LED on): 0.85V

There’s no inbetween value. It’s like a switch. Anything below 10 cm outputs 0.85, anything above 3.90V

Am I doing something wrong?

If this is how it’s supposed to work can I just slap a pull-up and make it a digital entry instead of an analog one?

Hello,

Yes, that’s exactly how it’s supposed to work - it is a digital sensor, not an analog one. It will probably work as a digital input to your PIC even without pull-ups (since the carrier board pulls the line up with the LED), and your PIC probably has optional built-in pull-ups on some of the pins anyway, if that doesn’t work.

-Paul