DHT22 negative readings; is there a solution?

Hello, everyone!
Is there a solution for negative Celsius readings of DHT22 sensor? I read many posts on this isue, I try everything I found about that, but no succes.
I use an Arduino Uno.
My sensor is wired as everybody says: + to Arduino's 5V; minus to Arduino's GND and data pin to pin no.2 of Arduino. And I drop it in my freezer.
The soft is an example from DHT_sensor_library_1.4.4:

// DHT Temperature & Humidity Sensor
// Unified Sensor Library Example
// Written by Tony DiCola for Adafruit Industries
// Released under an MIT license.

// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor

#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>

#define DHTPIN 2     // Digital pin connected to the DHT sensor 
// Feather HUZZAH ESP8266 note: use pins 3, 4, 5, 12, 13 or 14 --
// Pin 15 can work but DHT must be disconnected during program upload.

// Uncomment the type of sensor in use:
//#define DHTTYPE    DHT11     // DHT 11
#define DHTTYPE    DHT22     // DHT 22 (AM2302)
//#define DHTTYPE    DHT21     // DHT 21 (AM2301)

// See guide for details on sensor wiring and usage:
//   https://learn.adafruit.com/dht/overview

DHT_Unified dht(DHTPIN, DHTTYPE);

uint32_t delayMS;

void setup() {
  Serial.begin(9600);
  // Initialize device.
  dht.begin();
  Serial.println(F("DHTxx Unified Sensor Example"));
  // Print temperature sensor details.
  sensor_t sensor;
  dht.temperature().getSensor(&sensor);
  Serial.println(F("------------------------------------"));
  Serial.println(F("Temperature Sensor"));
  Serial.print  (F("Sensor Type: ")); Serial.println(sensor.name);
  Serial.print  (F("Driver Ver:  ")); Serial.println(sensor.version);
  Serial.print  (F("Unique ID:   ")); Serial.println(sensor.sensor_id);
  Serial.print  (F("Max Value:   ")); Serial.print(sensor.max_value); Serial.println(F("°C"));
  Serial.print  (F("Min Value:   ")); Serial.print(sensor.min_value); Serial.println(F("°C"));
  Serial.print  (F("Resolution:  ")); Serial.print(sensor.resolution); Serial.println(F("°C"));
  Serial.println(F("------------------------------------"));
  // Print humidity sensor details.
  dht.humidity().getSensor(&sensor);
  Serial.println(F("Humidity Sensor"));
  Serial.print  (F("Sensor Type: ")); Serial.println(sensor.name);
  Serial.print  (F("Driver Ver:  ")); Serial.println(sensor.version);
  Serial.print  (F("Unique ID:   ")); Serial.println(sensor.sensor_id);
  Serial.print  (F("Max Value:   ")); Serial.print(sensor.max_value); Serial.println(F("%"));
  Serial.print  (F("Min Value:   ")); Serial.print(sensor.min_value); Serial.println(F("%"));
  Serial.print  (F("Resolution:  ")); Serial.print(sensor.resolution); Serial.println(F("%"));
  Serial.println(F("------------------------------------"));
  // Set delay between sensor readings based on sensor details.
  delayMS = sensor.min_delay / 1000;
}

void loop() {
  // Delay between measurements.
  delay(delayMS);
  // Get temperature event and print its value.
  sensors_event_t event;
  dht.temperature().getEvent(&event);
  if (isnan(event.temperature)) {
    Serial.println(F("Error reading temperature!"));
  }
  else {
    Serial.print(F("Temperature: "));
    Serial.print(event.temperature);
    Serial.println(F("°C"));
  }
  // Get humidity event and print its value.
  dht.humidity().getEvent(&event);
  if (isnan(event.relative_humidity)) {
    Serial.println(F("Error reading humidity!"));
  }
  else {
    Serial.print(F("Humidity: "));
    Serial.print(event.relative_humidity);
    Serial.println(F("%"));
  }
}

The Serial monitor then...:

12:08:05.635 -> Temperature: -3262.50°C
12:08:05.681 -> Humidity: 82.60%
12:08:07.650 -> Temperature: -3262.50°C
12:08:07.650 -> Humidity: 82.80%

I know that in my freezer is chilly, but not like this... :slight_smile:
Has anybody a solution for this problem?
Thank you!

the minimum absolute temperature 0 degrees Kelvin is -273.15 degrees Centigrade
does the DHT22 temperature read OK at room temperature?
have you ran the examples in File>Examples>DHT Sensor Library

I know about the absolute minimum temperature, but my sensor seems that not knowing about that.
At positive temperature everything is ok.
An yes, I tryed that example too... Same result! :face_with_head_bandage:

reading online there is plenty of discussion of problems with the DHT devices in particular with negative temperature readings, e.g. possible problems with calculations in code, poor quality imitation DHT devices, etc
I don't have any DHT devices so cannot attempt to replicate your problem
however, tested a BME280 module which reads barometric pressure, temperature, and humidity moving it from a room into a freezer


Temperature = 17.82 *C
Pressure = 1030.19 hPa
Approx. Altitude = -140.08 m
Humidity = 55.10 %

Temperature = 14.59 *C
Pressure = 1030.22 hPa
Approx. Altitude = -140.36 m
Humidity = 33.20 %

Temperature = 8.39 *C
Pressure = 1030.35 hPa
Approx. Altitude = -141.39 m
Humidity = 25.36 %

Temperature = 3.42 *C
Pressure = 1030.47 hPa
Approx. Altitude = -142.39 m
Humidity = 24.02 %

Temperature = 0.06 *C
Pressure = 1030.60 hPa
Approx. Altitude = -143.47 m
Humidity = 24.64 %

Temperature = -0.82 *C
Pressure = 1030.61 hPa
Approx. Altitude = -143.55 m
Humidity = 25.01 %

Temperature = -4.79 *C
Pressure = 1030.76 hPa
Approx. Altitude = -144.80 m
Humidity = 27.34 %

Temperature = -7.45 *C
Pressure = 1030.90 hPa
Approx. Altitude = -145.94 m
Humidity = 29.62 %

Temperature = -10.41 *C
Pressure = 1030.97 hPa
Approx. Altitude = -146.49 m
Humidity = 32.90 %

Temperature = -13.42 *C
Pressure = 1031.06 hPa
Approx. Altitude = -147.24 m
Humidity = 37.22 %

Temperature = -15.63 *C
Pressure = 1031.20 hPa
Approx. Altitude = -148.42 m
Humidity = 41.43 %

Temperature = -17.12 *C
Pressure = 1031.27 hPa
Approx. Altitude = -148.93 m
Humidity = 44.85 %

Temperature = -18.60 *C
Pressure = 1031.35 hPa
Approx. Altitude = -149.64 m
Humidity = 48.64 %

Temperature = -19.15 *C
Pressure = 1031.38 hPa
Approx. Altitude = -149.85 m
Humidity = 50.35 %

Temperature = -20.19 *C
Pressure = 1031.48 hPa
Approx. Altitude = -150.72 m
Humidity = 53.81 %

Thank you, Horace, for your replies!
So, I guess, I have not a solution for my particular issue. Because, as I said already, I have tried many provided solutions.
Thank you again!

I too have given up on DHT-11/DHT-22 in favor of the BME280's. My project needed baro and with the BME280 I get temp and humidity with better accuracy. I've got a bin of DHT's collecting dust. Yours for the shipping!

Yes, I think I will give up, too. For me, DHT îs not a reliable senzor, at least for negative temperatures.

You could try fixing the Adafruit library, as mentioned here:

The issue title says DHT12, but the proposed fix is for the DHT21 and 22.

There are other open issues with proposed fixes to this problem. I chose this one at random.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.