Help how to how to read on board temp sensor Raspberry pi pico arduino ide

When I try to read to onboard temperature sensor I get some really high numbers?
Which is not what I expect at all. I expect to get the current room temperature in Celsius.

I managed to fix the wide range of temperature the problem was my battery.
But the output is still quite unfiltered and unstable. Does anyone know how to fix this? Add capacitors maybe?

my code

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);
  lcd.begin(16, 2);  // set up lcd.
  lcd.print("Hello world");  // make sure cld is working.
  delay(1000);
  lcd.clear(); // get lcd Ready
}

void loop() {
  lcd.print( analogReadTemp() ); // Try to print out on board temperature.
  delay(1000);
  lcd.clear();
  // put your main code here, to run repeatedly:

}
void setup1() {
     Serial.begin(2400); // Using the second core too serial print temperature to computer
}

void loop1() {
     Serial.println( analogReadTemp() );
      delay(100);
}

It’s the internal chip temperature, not room temperature. Around 33ºC on my device.

But why is the Temperature so uneven?

The graph you show looks to me like normal sensor noise (variation). To reduce sensor noise, average a few readings. Start with ten.

Could you give me a script or some code That can do this for me. I don't know how to make a make a code that averages something after overtime

How is the onboard temperature sensor only reading 16.6ºC? Do you get the same values from the serial output from the code running on core 0?

yes and No I don't live in the Arctic. I have average room temperatures.

analogReadTemp() returns the RP2040 internal temperature, not room temperature. Your value is about half the expected result.

But it's impossible for it to be lower than the Ambient temperature,
The reading is incorrect then?

I don’t know any way it can be lower than ambient.

What do you think? Use an ordinary thermometer to measure the room temperature.

Fine, but you still haven't told me how to get rid of the sensor noise.'

If the reading is completely wrong, the noise is irrelevant. Fix the real problem first.

If you don't know how to average a few values, there are tutorials on line.

You're an (expletive deleted), but thanks for the help.

Do hurry back to the forum with your next question!

Someone who asks a question and doesn’t remember the answer is annoying.

How interesting! Another one to the ignore list.

The "noise" seems pretty quantized. Maybe one or two LSBs of the ADC. I certainly wouldn't get bent about that. Adding @gru2x2 to my "Ignore Questions from these People" list.