Your ESP32 has a thermometer. It's lying to you.

The ESP32-S3 has a built-in temperature sensor, and in Arduino it takes one line to read it: temperatureRead(). But it measures the silicon, not the air. How far the reading is from the room depends on what the chip is doing.

In short

  • Room at 21 °C (70 °F). The chip, idle at 240 MHz: 25.6 °C. Both cores busy: about 35 °C. Wi-Fi scanning nonstop, no connection: 40.6 °C, 15 °C above idle.
  • After 15 minutes of deep sleep the sensor read 17.6–18.6 °C, below the room. A powered chip cannot be colder than the air around it, so here the reading is at least about 3 °C too low.
  • Idle at 80 MHz is about 3 °C cooler than idle at 240 MHz. Every mode took 5–7 minutes to settle. Readings come in whole-degree steps.
  • The first temperatureRead() call installs the ESP-IDF driver (about 2.4 ms); after that a reading takes about 8.5 µs.
  • Espressif says the sensor reflects changes well but cannot give a precise value, and does not recommend it for ambient temperature. Use it to watch the chip; for the room, use a separate sensor.

One line: temperatureRead()

On the ESP32-S3, reading the sensor in Arduino takes one function call. It returns degrees Celsius; the core's header describes it as //returns chip temperature in Celsius.

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

void loop() {
  Serial.println(temperatureRead());  // °C
  delay(1000);
}

On our board the Serial Monitor shows something like this:

25.60
25.60
26.60

The values look plausible. The question is what they are the temperature of.

What the call does

In arduino-esp32 3.3.12, temperatureRead() on the S3 is implemented in cores/esp32/esp32-hal-misc.c. On the first call it installs and enables the ESP-IDF temperature_sensor driver, configured for the 10–50 °C range. Every later call only reads the value:

// arduino-esp32 3.3.12, esp32-hal-misc.c (what happens, simplified)
// first call only:
//   TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50)
//   temperature_sensor_install(...)
//   temperature_sensor_enable(...)
// every call:
//   temperature_sensor_get_celsius(...)

The cost is visible when the two calls are timed with the CPU cycle counter (XTHAL_GET_CCOUNT()) at 240 MHz:

CallCycles (3 runs)Time at 240 MHz
first call (driver install)577,295 – 577,700~2.4 ms
second call2,030 – 2,042~8.5 µs

The numbers were the same in all three runs. If the first call happens in a timing-sensitive place, it is worth calling temperatureRead() once in setup().

Which chips have it

In ESP-IDF v5.5.6 the temperature sensor is supported (SOC_TEMP_SENSOR_SUPPORTED) on the ESP32-S2, S3, C2, C3, C5, C6, C61, H2 and P4.

The original ESP32 is different. Espressif removed the sensor from the ESP32 datasheet and Technical Reference Manual in 2018 (the revision history says “Removed content about temperature sensor”), and the ESP-IDF Temperature Sensor page does not exist for the ESP32. arduino-esp32 still provides temperatureRead() there, through the undocumented function temprature_sens_read(), marked in the source with the comment Undocumented!!!. Everything on this page was measured on an ESP32-S3 only.

What it actually measures

Not the air. The sensor sits inside the chip, on the silicon. ESP-IDF calls it a “built-in sensor used to measure the chip's internal temperature”, and the Technical Reference Manual says it is there “to monitor temperature changes inside the chip in real time”. The ESP32-S3 datasheet is explicit about what that means for the reading:

ESP32-S3 Datasheet, §4.2.2.2

“The temperature value depends on factors such as microcontroller clock frequency or I/O load. Generally, the chip's internal temperature is higher than the ambient temperature.”

So the real question is: how much warmer, and how much does it depend on what the sketch does?

The test

The board lies open on a desk, no case and no heatsink, powered over USB. The room was at 21 °C (70 °F). One sketch runs the whole sequence:

  1. After a reset the sketch goes straight into deep sleep for 15 minutes, so the chip cools down.
  2. A timer wakes it, and it runs through the modes below one after another, without a reboot.
  3. A separate task logs one temperatureRead() value every second, plus 16 readings in a row (mean, min, max).
ModeDurationWhat it does
idle 240 MHz12 minloop() waits in delay()
both cores busy10 minone task per core runs a tight floating-point loop (madd.s)
idle 240 MHz again10 mindelay()
Wi-Fi scanning10 minWiFi.mode(WIFI_STA), then WiFi.scanNetworks() back to back, no connection
Wi-Fi off10 minWiFi.mode(WIFI_OFF), idle at 240 MHz
idle 160 MHz10 minsetCpuFrequencyMhz(160), idle
idle 80 MHz10 minsetCpuFrequencyMhz(80), idle

The whole sequence ran three times in a row, about 87 minutes each. All three runs matched within 1 °C in every mode. Within each second, the 16 consecutive readings also differed by no more than 1 °C.

Colder than the room

Right after waking from 15 minutes of deep sleep, the sensor read 17.6 °C (about 64 °F) in two runs and 18.6 °C in the third. The room was at 21 °C.

The reading is too low here

A powered chip on a board cannot be colder than the air around it. So at this point the absolute reading is off by at least about 3 °C, downwards.

This matches what ESP-IDF says about the sensor: it shows changes well, not exact values. What the error is at other temperatures is not known from this test; there was no second thermometer on the chip.

One detail of the method: during deep sleep the board stays powered (the USB bridge and the regulator keep running), so this is not a full cold start, only the chip itself cooling down.

From there, just sitting idle at 240 MHz, the reading climbs for about six minutes before it settles.

Both cores, Wi-Fi and clock speed

Steady values for each mode (median of the last 3 minutes of the mode, the room line for reference):

The full table, all three runs:

ModeRun 1Run 2Run 3Resultvs idle 240 MHz
right after 15 min sleep17.618.617.6~18—
idle 240 MHz25.625.625.625.60
both cores busy35.634.634.6~35+9…10
idle 240 MHz again26.626.626.626.6+1
Wi-Fi scanning40.640.640.640.6+15
Wi-Fi off26.626.626.626.6+1
idle 160 MHz25.625.624.6~25−1…−2 vs 26.6
idle 80 MHz23.623.623.623.6−3 vs 26.6
°C, median of the last 3 minutes of each mode. Room: 21 °C.

Note that the second idle at 240 MHz (and the idle after Wi-Fi) settled at 26.6 °C, one step above the first idle. The clock-speed comparisons are made against that value, the idle that came right before them.

How fast it settles

The reading does not jump to its new value when the mode changes. Median of three runs, one value per minute from the start of each mode:

Mode0 min1234Steady (from)
idle 240 MHz18.621.622.623.624.625.6 (6 min)
both cores busy26.630.632.632.633.634.6 (5 min)
idle 240 MHz again33.630.629.628.627.626.6 (6 min)
Wi-Fi scanning29.634.636.638.639.640.6 (6 min)
Wi-Fi off38.633.630.629.628.626.6 (7 min)
idle 160 MHz26.625.625.625.625.625.6 (1 min)
idle 80 MHz24.624.624.623.623.623.6 (3 min)
°C. Each row starts where the previous mode ended.

For the large changes it took 5–7 minutes to reach a steady value. Two practical consequences:

Whole-degree steps

Every value in all three runs ends in .60: 17.60, 23.60, 40.60. The reason is in ESP-IDF v5.5.6: the low-level read (temp_sensor_get_raw_value) returns whole degrees as an int, and the driver then subtracts a constant per-chip calibration offset stored in eFuse:

// ESP-IDF v5.5.6, esp_driver_tsens/src/temperature_sensor.c
result = tsens_raw - s_deltaT / 10.0;

On this chip the offset produces the .6; the step is still 1 °C. So differences smaller than 1 °C are invisible to this sensor, and all numbers on this page are only as fine as that step. The 16 readings taken within each second differed by at most one step.

How accurate is it?

Espressif's own documentation answers this directly:

ESP-IDF v5.5.6: Temperature Sensor (ESP32-S3)

“…designed primarily to measure the temperature inside the silicon… The sensor can reflect the temperature changes very well but it can't give a precise measurement value. So it's not recommended to use it for ambient temperature measurement.”

The datasheet gives the overall range of the sensor as −40 °C to 125 °C. Within that range the hardware has several measurement ranges, and the error differs between them. The current documentation only says: “different measure ranges have different measurement errors… we have an internal mechanism to choose the minimum error”.

Older versions of the docs (ESP-IDF v5.5 and v5.5.1) went further and listed an error for each range, from under 1 °C to under 3 °C. That table was removed in ESP-IDF commit 96283dd044 (2025-07-04) with the message “remove inaccurate part”. The numbers now remain only in the driver source (components/soc/esp32s3/temperature_sensor_periph.c), and the Technical Reference Manual lists the ranges without any errors. Since Espressif itself withdrew the table as inaccurate, it should not be read as a specification.

For reference, temperatureRead() in Arduino always installs the driver with the 10–50 °C range.

What it's good for

Good for

  • is the chip running hot?
  • how hard is the radio working?
  • changes, not exact values

Not for

  • room temperature
  • a weather station

The sensor is not broken; it measures something else. It is useful for watching the chip itself, for example to notice overheating or to back off the workload when the chip gets too hot. For context, the ESP32-S3 datasheet gives the allowed ambient temperature for parts with 8 MB of Octal PSRAM, like the ESP32-S3R8 on this board and the N16R8 modules, as −40 to 65 °C (up to 85 °C with PSRAM ECC enabled); parts without PSRAM go up to 85 or 105 °C.

For a weather station or a room thermometer, use a separate sensor, such as a DS18B20 or a BME280.

Caveats and open questions

Test setup and code

BoardESP32-S3, chip ESP32-S3R8 (QFN56, rev v0.2, embedded 8 MB PSRAM), 16 MB external flash, 40 MHz crystal; open on a desk, no case or heatsink, powered over USB
Corearduino-esp32 3.3.12, board esp32:esp32:esp32s3, all board settings at their defaults
Toolchainarduino-cli from Arduino IDE 2.3.8
Room21 °C (70 °F)
Method15 min deep sleep, then seven modes of 10–12 min each; one temperatureRead() value per second from a logger task (priority 5), plus 16 consecutive readings; steady value = median of the last 3 minutes of a mode
Loadtwo priority-1 tasks pinned to cores 0 and 1, a 10,000-iteration madd.s loop (checked in the disassembly that it was not optimized away); every 100 ms each yields one tick so the task watchdog stays fed (about 1% idle)
Runs3 full runs in a row, about 87 minutes each; the host logs the serial output with timestamps
temp_probe.ino (shortened) · full file
#include <WiFi.h>
#include "esp_sleep.h"
#include "xtensa/core-macros.h"

#define COOL_MIN 15

struct Phase { const char *name; uint32_t minutes; };
static const Phase PHASES[] = {
  {"idle240", 12}, {"load2", 10}, {"idle240b", 10},
  {"wifiscan", 10}, {"wifioff", 10},
  {"idle160", 10}, {"idle80", 10},
};

// Logger task: one reading per second, plus 16 in a row (mean, min, max).
static void logger(void *) {
  TickType_t last = xTaskGetTickCount();
  for (;;) {
    float t1 = temperatureRead();
    float sum = 0; float mn = 1e9, mx = -1e9;
    for (int i = 0; i < 16; i++) { float v = temperatureRead(); sum += v; if (v < mn) mn = v; if (v > mx) mx = v; }
    Serial.printf("T,%lu,%s,%u,%.2f,%.2f,%.2f,%.2f\n", (unsigned long)millis(), (const char *)g_phase,
                  (unsigned)getCpuFrequencyMhz(), t1, sum / 16, mn, mx);
    vTaskDelayUntil(&last, pdMS_TO_TICKS(1000));
  }
}

void setup() {
  Serial.begin(115200);
  delay(200);
  // First boot: sleep so the chip cools down, then wake up by timer.
  if (esp_sleep_get_wakeup_cause() != ESP_SLEEP_WAKEUP_TIMER) {
    esp_sleep_enable_timer_wakeup((uint64_t)COOL_MIN * 60ULL * 1000000ULL);
    esp_deep_sleep_start();
  }
  // Cost of the first call (driver install) and of the next one, in CPU cycles.
  uint32_t c0 = XTHAL_GET_CCOUNT(); float a = temperatureRead(); uint32_t c1 = XTHAL_GET_CCOUNT();
  float b = temperatureRead(); uint32_t c2 = XTHAL_GET_CCOUNT();
  // ... print c1 - c0 and c2 - c1, start spinner tasks on both cores and the logger
}

void loop() {
  for (const Phase &p : PHASES) {
    // ... per phase: setCpuFrequencyMhz(), g_spin = true, WiFi.mode(WIFI_STA / WIFI_OFF)
    while ((int32_t)(millis() - end) < 0) {
      if (!strcmp(p.name, "wifiscan")) WiFi.scanNetworks();  // back to back, no connection
      else delay(200);
    }
  }
}

Sources

  1. ESP-IDF v5.5.6: Temperature Sensor (ESP32-S3) “built-in sensor used to measure the chip's internal temperature” · “designed primarily to measure the temperature inside the silicon… can reflect the temperature changes very well but it can't give a precise measurement value. So it's not recommended to use it for ambient temperature measurement.” · “different measure ranges have different measurement errors”
  2. ESP-IDF v5.5: Temperature Sensor (ESP32-S3), older version still has the table of errors per range (under 1 °C to under 3 °C), removed later in commit 96283dd044, “remove inaccurate part”
  3. ESP32-S3 Datasheet v2.2, §4.2.2.2 and Table 1-1 “The temperature value depends on factors such as microcontroller clock frequency or I/O load. Generally, the chip's internal temperature is higher than the ambient temperature.” · “The temperature sensor has a range of –40 °C to 125 °C.”
  4. ESP32-S3 Technical Reference Manual v1.8, §39.4.1 and Table 39.4-1 “to monitor temperature changes inside the chip in real time”; measurement ranges without errors
  5. ESP32-S3-WROOM-1/1U Datasheet v1.8, §1.2 “R8 and R16V series modules operate at –40 ~ 65 °C ambient temperature… if the PSRAM ECC function is enabled, the maximum ambient temperature can be improved to 85 °C”
  6. arduino-esp32 3.3.12: cores/esp32/esp32-hal-misc.c and esp32-hal.h TEMPERATURE_SENSOR_CONFIG_DEFAULT(10, 50), install and enable once, then temperature_sensor_get_celsius · “//returns chip temperature in Celsius” · on the ESP32: temprature_sens_read(), “Undocumented!!!”
  7. ESP-IDF v5.5.6 source: soc_caps.h, esp_hw_support/sar_periph_ctrl_common.c, esp_driver_tsens/src/temperature_sensor.c SOC_TEMP_SENSOR_SUPPORTED on S2, S3, C2, C3, C5, C6, C61, H2, P4 · raw value in whole degrees (int) · result = tsens_raw - s_deltaT / 10.0
  8. ESP32 Datasheet and Technical Reference Manual, revision history (2018) “Removed content about temperature sensor”

Video

A short video on the same topic is on the ESPSSS YouTube channel (3:10, 2026-11-22). This page goes into more detail.

Also as a YouTube Short.