OC
OceanRemote
Low-code IoT platform
Back to Troubleshooting Hub

DHT22 Wrong Temperature

Your DHT22 temperature readings are inaccurate too high, too low, or inconsistent. The sensor works but shows wrong values compared to a reference thermometer. This guide covers self-heating, sensor placement, calibration, offset adjustment, and common causes of inaccurate DHT22 readings.

Last updated: April 22, 2026 | 10 min read

Symptoms

  • Temperature reads 2-5C higher than actual room temperature
  • Readings slowly drift upward over time
  • Temperature correct when device first powers on, then becomes inaccurate
  • Humidity readings correct but temperature off
  • Readings different between multiple DHT22 sensors in same location
  • Temperature reading changes when device orientation changes
  • Readings affected by nearby heat sources

Common Causes

  1. Self-Heating of DHT22 Sensor warms itself during operation, reading 1-3C high after continuous use
  2. ESP32/ESP8266 Heat Proximity Board generates heat affecting nearby sensor
  3. Poor Air Circulation Enclosed space traps heat, causing higher readings
  4. Sunlight or Radiant Heat Direct sunlight or nearby warm objects skew readings
  5. Sensor Manufacturing Tolerance DHT22 specified accuracy is 0.5C, but individual sensors may vary
  6. Voltage Variation DHT22 readings can drift with unstable power supply
  7. Humidity Cross-Sensitivity Extreme humidity can affect temperature accuracy

DHT22 Accuracy Specifications

Parameter Specification Real-World Typical
Temperature Accuracy ()0.5C 1-2C without calibration
Temperature Repeatability ()0.2C 0.5C typical
Resolution ()0.1C 0.1C
Self-Heating ()0.5-1.5C ()1-3C with 2-second reads
Operating Range ()-40C to +80C Best accuracy 0-50C

DHT22 is less accurate than DS18B20 for temperature-only applications. Consider DS18B20 if 0.1C accuracy is required.

Self-Heating Effect on DHT22

Self-Heating Test Results :

Time after power-on | Temperature reading 

0 seconds    22.1C   Accurate
30 seconds               22.8C   +0.8C error
1 minute                 23.5C   +1.5C error
5 minutes                24.2C   +2.2C error
1 hour                   24.5C   +2.5C error
Continuous               24-25C  +2-3C error

Solution: Read less frequently or add ventilation
- Read every 5-10 seconds instead of 2 seconds
- Add small fan for air circulation
- Use offset calibration in OceanRemote dashboard

Step-by-Step Fixes

1. Use OceanRemote Offset Calibration

Apply offset to correct temperature reading:

  • Log into OceanRemote dashboard
  • Find your device card with DHT22
  • Locate the temperature card with offset input field
  • Calculate offset = Reference Temperature - Current Reading
  • Example: Reference 22.0C, Reading 24.5C Offset = -2.5C
  • Enter offset value and press Enter
  • Wait 5-10 seconds for dashboard to update
  • Verify reading matches reference thermometer
// Formula used by OceanRemote:
// Calibrated Temperature = Raw Temperature + Offset
// 
// Example with offset -2.5:
// Raw: 24.5C  Calibrated: 22.0C 

2. Move DHT22 Away from ESP32/ESP8266

ESP32/ESP8266 generate significant heat:

  • Keep DHT22 at least 10-15 cm away from the board
  • Use extension wires
  • Mount DHT22 on a small separate PCB away from main board
  • Avoid placing DHT22 above ESP32/ESP8266
  • If using enclosure, add ventilation holes near sensor

3. Reduce Read Frequency to Minimize Self-Heating

Reading less often reduces self-heating:

// OceanRemote default: read every 2 seconds
// For temperature-critical applications, reduce to 5-10 seconds

// Custom firmware modification :
void readSensor() {
  static unsigned long lastRead = 0;
  unsigned long now = millis();
  
  // Change from 2000ms to 5000ms 
  if  {
    lastRead = now;
    temperature = dht.readTemperature();
    humidity = dht.readHumidity();
    // ... rest of code
  }
}

4. Add Ventilation and Airflow

Poor airflow traps heat around sensor:

  • Add ventilation holes in enclosure near DHT22
  • Mount sensor away from heat-generating components
  • Consider adding small fan for active airflow
  • Avoid placing sensor in closed metal boxes
  • For outdoor use, use radiation shield to block direct sunlight

5. Power DHT22 from 3.3V

5V operation can increase self-heating:

  • Connect DHT22 VCC to 3.3V instead of 5V
  • 3.3V reduces power consumption and self-heating
  • Still use 10k pull-up to 3.3V
  • DHT22 works correctly at 3.3V
  • Measure voltage at DHT22 VCC should be stable 3.3V

6. Calibrate with Ice Water

Two-point calibration for better accuracy:

  • Fill container with crushed ice and water
  • Insert DHT22 probe into ice water
  • Wait 10 minutes for stabilization
  • Record reading should be 0C
  • Calculate offset: Offset = 0C - Reading
  • Apply offset in OceanRemote dashboard
  • Verify at room temperature

7. Compare with Known Good DHT22

Isolate sensor vs environmental issues:

  • Test with a different DHT22 sensor
  • Place both sensors side by side in same environment
  • If both read differently, manufacturing variation
  • If both read same but wrong, environmental issue
  • If new sensor accurate, original sensor is faulty

Offset Calculation Examples

Reference Temp DHT22 Reading Offset Result After Offset
22.0C24.5C-2.5C22.0C
22.0C19.8C+2.2C22.0C
18.5C20.0C-1.5C18.5C
30.0C28.0C+2.0C30.0C

Prevention Tips

  • Mount DHT22 away from ESP32/ESP8266
  • Use 3.3V power to reduce self-heating
  • Add ventilation holes in enclosure near sensor
  • Increase read interval to 5-10 seconds for non-critical monitoring
  • Use OceanRemote offset calibration for final adjustment
  • For high accuracy requirements , use DS18B20 instead
  • Recalibrate annually as sensor ages

Related Issues

Frequently Asked Questions

Q: Why does my DHT22 read 2-3C high even after offset calibration?

A: Self-heating causes non-linear error. Offset works at one temperature but error may change with ambient temperature. Reduce read frequency to 5-10 seconds or move sensor away from ESP32.

Q: DHT22 vs DS18B20 which is more accurate?

A: DS18B20 has same accuracy as DHT22 but DS18B20 has no self-heating, better repeatability , and no humidity cross-sensitivity. DS18B20 is better for temperature-only applications.

Q: Will offset calibration affect humidity readings?

A: No. OceanRemote offset only affects temperature. Humidity readings remain unchanged. If humidity is also inaccurate, the sensor may be faulty or affected by environmental factors.

Still having temperature issues? Contact Support or return to the Troubleshooting Hub.