This sensor is not an analog sensor it just provides a HIGH or LOW. You have to set the treshhold by adjusting the screw (say 30cm) by trying. If this treshold is reached then the sensor switches.
these things pull low when they sense something. so you’ll want a 10k pullup resistor from the input to V. Plus, the light will be on even if it’s not seeing something, and will be brighter if it sees something. if there is no change at all in the light, you’re hooked up wrong.
No kidding, I was turning them on my setup a lot left, right, left and again right…then I checked the data sheet and saw that the minimum distance was lower than I expected. they arre working in a small range only…try it out.
Edit: Oh yeah…use the serial monitor to watch the values while turning the screw.