Temp sensor dramatic changes

Fair point.

Here's some more info;

Code

const int sensorPin = A0;
int sensorVal;
float voltage;
float temperature;
int baseTemp = 20;

void setup(){
  Serial.begin(9600);
  
  for (int x=11; x<14; x++) {
    pinMode(x, OUTPUT);
    digitalWrite(x, LOW);
  }
  
}

void loop(){
  int sensorVal = analogRead(sensorPin);
  Serial.print("Sensor value: ");
  Serial.print(sensorVal);
  voltage = (sensorVal/1024.0) * 5.0;
  Serial.print(", Volts: ");
  Serial.print(voltage);
  temperature = (voltage - .5) * 100;
  Serial.print(", Temperature (degrees): ");
  Serial.println(temperature);
  
  if (temperature > baseTemp+3) {
     digitalWrite(11, HIGH);
     digitalWrite(12, HIGH);
     digitalWrite(13, HIGH);
  } else if (temperature > baseTemp+2) {
     digitalWrite(11, HIGH);
     digitalWrite(12, HIGH);
     digitalWrite(13, LOW);
  } else if (temperature > baseTemp+1){
     digitalWrite(11, HIGH);
     digitalWrite(12, LOW);
     digitalWrite(13, LOW);
  }
  
  delay(250);
}

Board configuration in attachment:
From the wires joining to the sensor, the orange links to 5v, white links to A0 and blue to GND.

In the rest of the configuration the red, white, and black from LEDs link to 11, 12, and 13 respectively. The blues all link back to GND.

Result
The result that is given often sticks around somewhere between 20 - 25 and the LED's are turned on or off based on the code logic. But often times e.g. if the lights are all off and the terminal is opened within about a second the degrees C jump from 20 or so to 30. Alternatively if all the lights are on and the terminal is opened the degrees jump from 30 or so back to around 20. Both of these scenarios appear to happen randomly but quite often.

The video
The youtube video I watched was this

Compared to the quality of the rest of the videos, Massimo didn't explain this one in as much detail - so I simply used this video to get a hint as to how this temperature sensor works and tried to tie up the configuration myself.

Also I'm not sure if my temperature sensor even works or is just not sensitive. When I hold it it seems to either stay at wher it is or deviate very slowly by one degree (or less) lower. Which is quite weird as i'm sure I'm not colder than room temperature :smiley: