Arduino SoderingStation and AnalogRead

Hi there. I’m trying to build a soldering station with an arduino. I have the thermocouple of the soldering iron hooked to a op amp with an amplification of 120 and the output fed to analog pin A0.

The problem is that the analogRead reads bad values. I do use A3-A5 as output digital pins, but I tried to use other pins with the same result.

For a brief moment, it reads the good value, then it reads 0.

void loop(){

  Input = analogRead(0);
  Input = map(Input, 0, 450, 25, 350);
  
  if(millis() - lastupdate > updaterate) {
    lastupdate = millis();
    temperature = Input;
  } 
  
  double Setpoint = analogRead(1);
  Setpoint = map(Setpoint, 0, 1023, 150, 350);
  
  double gap = abs(Setpoint-Input); //distance away from setpoint
  if(gap<10)
  {  //we're close to setpoint, use conservative tuning parameters
    myPID.SetTunings(consKp, consKi, consKd);
  }
  else
  {
     //we're far from setpoint, use aggressive tuning parameters
     myPID.SetTunings(aggKp, aggKi, aggKd);
  }

  myPID.Compute();
  analogWrite(11, Output);
  show(temperature);
}

The problem is that the analogRead reads bad values.

How do you know that, in the absence of Serial.print() statements?

PaulS:
How do you know that, in the absence of Serial.print() statements?

I used the “show(Input)” and commented out the map function.

The show function is a fuctions that displays the value on a 3 digit led array.

I uploaded the schematic.

If I disconnect the thermocouple pin and let it to float, i get a high value (726 let s say) and it stays there.