IR Sensor only returning max values regardless of distance

Hi, I'm using a GP2Y0A02YK0F IR sensor and just trying to get a basic read from it. The values it returns are between ~950 to 1023 regardless of the distance. I've tried using other pins (changing code respectively) but I'm unsure of what the problem could be. I've got my code below. Cheers :slight_smile:

#define sensorIR A2
float sensorValue;

void setup(){
  Serial.begin(9600);
}

void loop(){
  sensorValue=analogRead(sensorIR);
  Serial.print("Sensor Value: ");
  Serial.println(sensorValue);
  delay(150);
}

Welcome to the forum and well done for using code tags in your first post!

Are you using the bare sensor or a breakout board? If a breakout board, which one.
How do you have your circuit wired? Post a photo and/or, if you are able, draw a circuit diagram on a page and post a picture of it.
Did you add a power supply by-pass capacitor as recommended in the GP2Y0A02YK0F datasheet (pololu.com)?