Keep the sensor away from heat sources. A microcontroller, a regulator or a battery warms the air around it.
What the message means
The sensor measures its own surroundings. Nearby parts and a closed case heat the air, and the reading follows.
Fix it in this order
- Move the sensor to the edge of the board, or on a short cable away from the electronics.
- Vent the case so outside air can reach the sensor.
- Read less often, or let the board sleep, to cut heat.
- Compare with a trusted thermometer in still air.
- Subtract a measured offset if a small constant error remains.
- Do not put the sensor next to a regulator or a motor driver.
Why it happens
The BME280 measures the temperature of the sensor itself, and the board around it conducts heat in. A regulator, a radio module or a battery a few millimetres away can raise the reading by several degrees. Bosch’s datasheet notes that self-heating is small at low sample rates, so the main heat is nearly always the neighbours.
The error also spreads. The chip uses its temperature to compensate the pressure and humidity readings, and relative humidity falls as air warms, so a warm sensor reads too dry as well as too hot. Fixing the temperature position helps all three values.
If you see this, do this
| You see | Do this |
|---|---|
| Several degrees too high | Heat from the board. |
| Small constant error | Apply an offset. |
Related
BME280 not found, DHT sensor NaN.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
The BME280 reports the temperature of its own package. That package sits on a circuit board that conducts heat from nearby parts, and it warms the air in a small enclosure too. A regulator dissipating a watt, a radio module during transmit, or a battery under charge can lift the local temperature by several degrees. The datasheet describes the sensor’s own self-heating as small at low sample rates, so the neighbours are usually the larger effect.
Humidity and pressure are compensated using the temperature, and relative humidity depends strongly on temperature, since warmer air at the same moisture content has a lower relative humidity. A sensor reading too hot therefore usually reads too dry. Fixing the temperature position improves all the values. Check also that the module is a real BME280: many modules sold under that name are BMP280, which has no humidity measurement.
How to confirm the cause
- Log the temperature from power-up for half an hour. A steady upward drift that levels off is the board warming itself.
- Move the sensor on a 10 to 20 cm cable away from the board and repeat. A clear drop confirms conductive heating.
- Compare against a trusted thermometer in still air, with both left to settle for several minutes. Note the difference at two different temperatures if you can.
- Read the chip ID register 0xD0. A BME280 returns 0x60 and a BMP280 returns 0x58. A humidity reading stuck at 0 also suggests a BMP280.
- Switch off the radio or the display for a test. If the error shrinks, that part is the heat source.
Worked example
Finding and applying a constant offset after the sensor has had time to settle (the numbers are an example):
// Reference thermometer: 24.0 C, sensor after 30 minutes: 26.5 C
// offset = reference - sensor = 24.0 - 26.5 = -2.5 C
const float TEMP_OFFSET = -2.5;
float t = bme.readTemperature() + TEMP_OFFSET;
// An offset measured in one place is valid only for that setup:
// repeat the comparison at a second temperature before trusting it.Common mistakes
- Taking the offset while the board is still warming up.
- Placing the sensor right next to a voltage regulator or motor driver.
- Sealing the sensor in a tight box without ventilation holes.
- Putting it in direct sunlight, which heats the package far above the air temperature.
- Applying an offset to hide a heat source that changes with load.
If this did not fix it
- Heat travelling along the supply and signal wires from the main board to the sensor.
- A counterfeit or different part that reads incorrectly. Check the chip ID.
- Poor air flow around the module in a case; add vents or move the sensor to the outside.