Analogic pin A1 not working while the others work with the same code

Hello, i have a problem with the analogic pin A1. as you can see from the code attached i am running a really simple project from the begginner guide of Arduino which uses the analogi input from the TMP36.
if i connect it to A2 it works great but when i connect it to the A1 pin it doesn’t work at all.
i tried with all the pins and they all work, could the pin be defective? i just started learning and i’ve done only the project from the statrting kit

this is the code, it works with all the pins except A1:

const int sensorPin = A2;
const float baselineTemp = 24.0;


void setup() {
  // put your setup code here, to run once:
    Serial.begin (9600);
    for (int pinNumber = 2; pinNumber < 5; pinNumber++)
    {
      pinMode (pinNumber, OUTPUT);
      digitalWrite (pinNumber, LOW);
    }
}

void loop() {
  // put your main code here, to run repeatedly:
    int sensorVal = analogRead (sensorPin);
    Serial.print (sensorVal);
    float voltage = (sensorVal/1024.0)*5.0;
    Serial.print (", Volts: ");
    Serial.print (voltage);
    Serial.print (" , Celsius: ");
    float temperature = (voltage - 0.5) * 100;
    Serial.println(temperature);

    if (temperature < baselineTemp+2)
    {
      digitalWrite (2, LOW);
      digitalWrite (3, LOW);
      digitalWrite (4, LOW);
    }

    else if (baselineTemp+2 <= temperature && temperature < baselineTemp+4)
    {
      digitalWrite (2, LOW);
      digitalWrite (3, HIGH);
      digitalWrite (4, LOW);
    }

    else if(temperature >= baselineTemp+4 && temperature < baselineTemp+6)
    {
      digitalWrite (2, LOW);
      digitalWrite (3, LOW);
      digitalWrite (4, HIGH);
    }

    else if(temperature >= baselineTemp+6)
    {
      digitalWrite (2, HIGH);
      digitalWrite (3, LOW);
      digitalWrite (4, LOW);
    }
    delay(10);
    
}

Post code NOT pictures of code.
In code tags.

Sorry I am new and this is my first post, I don't know where should I post my question, I thought technical problem was right since the problem is the pin itself not the code, the code works fine but the pin looks like it's defective since I've never done anything different from the starting guide

Run the example program in the IDE ( file/examples) and run the one for analog input . You can be certain these simple sketches work and if you suspect some sort of hardware problem , it’s a good place to go.

Vary the example sketch by altering the analog pin and see what happens.

Don’t forget analogs measure voltage relative to the 0v pin , so that needs to be connected to your voltage source .

I tried the code you suggested me. it works perfectly with all the pins except A1. When i use pin A1 and i turn the potentiometer arduino shuts down and disconnect. i really believe i got a defective pin :( do you know a way to replace the pin? or maybe i should just avoid using it?

Visually inspect the tracks from/around that pin carefully. There may be a small speck of solder or debris somewhere that is shorting it to ground or elsewhere. If there is nothing obvious then the fault may be within the ADC circuitry inside the MCU chip in which case there is no way to fix it. You can’t really „replace the pin” as it is a function of the MCU chip.

BitSeeker:
If there is nothing obvious then the fault may be within ADC circuitry inside the MCU chip

No, if there were a fault with the ADC, it would affect all pins.
More likely, the problem is with the input itself, or possibly the input multiplexer.

But yes, if this is the case, the only solution is to not use that one pin, or replace the chip.

I stand corrected. The input circuitry would indeed be the more likely culprit, or possibly the multiplexer.