DHT22 wrong readings

I have recently purchased one of these (from Core). I have been using Thermistors for temperature measurements in various projects for some time, so know their characteristics and tricks quite well. After purchasing the DHT22 I set it up on an Arduino Mega along with a Thermistor. I also have a quality old school mercury thermometer set up on my testing rig.
The problem: The DHT22 consistently reads 3 degrees higher temperature than the Thermistor/Thermometer pair which read within + - 0.5 degrees. Incidentally I have also found the same issue with a DHT11 which is better but + - 1.5 degree. Does anyone know if there are perhaps modifications/additions to external circuitry or perhaps header file to help compensate for this?

2 Likes

Hi @Derek296897,

Welcome to the forum!

Thanks for sharing your setup and observations. Here are some practical tips that might help you troubleshoot and improve accuracy:

  1. Wiring
    Double-check your wiring and pin assignments. Even a small mistake can cause incorrect readings. Make sure all connections are solid and according to the sensor datasheet. Looking at the sensor front on, pinout is VDD, Data, Null, GND [Page 4].
  2. Power Supply
    The DHT22 operates between 3V and 6V. If you’re powering it from 3.3V, try switching to 5V — this often stabilizes readings and can reduce offset.
  3. USB Port and Cable
    If you’re powering your Arduino from a PC USB port, it might not supply enough current. Try using a powered USB hub or a different USB cable (preferably shorter and high quality).
  4. Sampling Rate
    The DHT sensors are slow and require about >2 seconds between readings. Increasing the delay between reads helps ensure you get stable and accurate measurements.

Let us know if any of these tips help!

1 Like

Hi Derek,

Welcome!!

There might be a few reasons you are seeing this.
Self heating for temp/humdity sensors also can play a part in higher or lower readings, from our testing so far that’s what we have seen with the PiicoDev BME’s (testing is still ongoing, and a fix is in work).

The thermal properties (conduction, convection) can play a part, the thermal mass of the sensor inside the DHT might be smaller(not confirmed), but compared to a thermistor on a PCB it will have a much lower thermal mass.

As for a fix, if you record both the thermistor, and DHT22/DHT11’s plot them, and observe a constant offset, a -3 could be added to the reading to fix the offset (to help with this if you could send through your graph/readings and code that would help).

Liam

1 Like

Thanks Ryan…My Arduino is powered by external 9v regulated supply. I have increased the read interval to 5 seconds. Pin assignments are correct. Shortest possible wiring connections using jst and Dupont connectors. I will graph the readings and let you know. Thank you for your prompt reply and suggestions.

1 Like

There have been a few discussions about the accuracy of temperature sensors.
I did a fairly careful comparison of several different types and found the DHT22 (at least the 2 I have) to be reasonably accurate. Have a look at:-
Is my PiicoDev BME280 Atmospheric Sensor faulty? - Support / Product Questions - Core Electronics Forum
Maybe you have a bad one but it is quite difficult to do proper comparisons unless you are pretty careful about having all the sensors in the same conditions.
Ian

1 Like

Hi again people. OK…I have read the post suggested by Ian. I am currently setting up a rig to make all parameters as even as possible. I intend to set up two 47k thermistors, a DHT11, DHT22 and I have some TMP36’s lying around and a couple of DS18b’s somewhere. I intend to set them up (probably not all of them) in an enclosure to keep thermal characteristics reasonably constant (as per the other post). Yes, I understand that the DHT’s probably have a different thermal mass and the consequences of self-heating. With regard to self-heating, I cannot write my issues off to that, as the temperature readings (and thus the humidity) differ widely upon initial connection. I also ensure that I am not reading the sensor to often so as to avoid issues with the ADC gate cap not fully discharging before the next reading. I am about to try using a digital pin as a power supply pin that is set HIGH before a reading and LOW after the reading. Hopefully supplying current to the sensor only when needed will combat or negate self-heating issues.

I really need dependable temperature and humidity readings for the project I am working on. I need to calculate the atmospheric Dew Point quite accurately and the DHT22 not giving an accurate temperature reading will affect the Humidity reading which in turn alters the Dew Point calculation. Thanks for all your help and suggestions folks. Now to get on with the show. Will let you know my results.

2 Likes

I reckon the best you will easily get is the TMP117 (available here) which is quoted as + or - 0.1 deg C from -20 to +50 C with no calibration required. For $9-80 for the Piicodev version you will find that hard to beat.
Ian

1 Like

I am more than happy with the accuracy of the thermistors I am currently using. I have two of them operating now and they are within 0.05 degree of each other. They are also within 0.4~0.5deg/C of my analog (non-digital) thermometers ambient reading. The TMP117 does not give me a humidity reading which is quite important to my needs. I have been pawing through the DHT22 CPP file and note there are some parameters that could be experimented with. I also came across another site that uses an additional/external pull up resistor with a DHT22. Have not tried that yet. I have been reading some pretty hard-core material on the whole topic of temp/humidity/sensors My head is starting to hurt and my eyes are spinning round :slight_smile:

4 Likes

Just as a final thought, are you aware of Dallas 1-wire sensors? They are very easy to use and there is an enormous range of stuff. I have been running a weather station for many years and I exclusively use their sensors. However they are separate ie there won’t be a combined temp and humidity sensor (at least that I am aware of). I have had very good long term performance from their humidity sensors. Humidity is not an easy thing to reliably measure. I am wondering why you want them to be combined?

1 Like

Hi Ian…I actually do not need them to be combined. In fact they would be better for my purposes if they were separate. Thanks for the tip. I will check them out. I am only using the dht sensors because they were the only easily gettable ones I knew about. Yes, I have woken up to the fact humidity is notoriously difficult to measure. Just so many factors that play a part. Thanks heaps for all your help and info. I do appreciate you taking the time to help. Core Electronics Rock<✓✓✓

1 Like

Hi Derek,

I’ve also heard good things about the SHT devices, I’ve got an SHT40 at home ready to be put in some smart home setup

Cheers Liam..I will add them to my check em out list. Thanks

You did not mention which library you are using. Is it the Adafruit DHT sensor library or something else? The Adafruit library is dependable and widely used. GitHub - adafruit/DHT-sensor-library: Arduino library for DHT11, DHT22, etc Temperature & Humidity Sensors. If there is nothing wrong with your code, it can be a loose connection or bad jumper wires. Double-check your connections. Test your jumper wires with a multimeter. Also, check if your breadboard is providing secure connections. If you find no problem with the jumpers and connections, maybe the sensor is not functioning. Here is a good tutorial for testing your DHT sensors with Arduino. DHT11 and DHT22 Sensors with Arduino Uno - Share Project - PCBWay

1 Like

Yes, using the Adafruit library. Have also tried others. All wiring is good and solidly connected with JST and Dupont connectors. Multimeter proves connection integrity. I am using protoboard with soldered sockets and JST/Dupont for wiring. I make my own wiring harnesses and always test them to make sure. Eventually I will make PCB for project. Not until I can get a reliable Humidity/Temp reading though. I will read the article you have suggested but I have been reading some very academic articles on the calibration and control of this type of sensor. The DHT22 is consistently 2degC higher than readings from two well calibrated NTC Thermistors which agree to within less than 0.05degC with each other. They also agree very nicely with a lab grade mercury thermometer I use as a reasonably accurate and reliable reference. Of course even a mercury thermometer can vary in accuracy with atmospheric pressure etc. But they are reasonably accurate. I have also been looking at some Honeywell sensors but man do they cost!!! They also have basically the same accuracy rating (+ - 2%). The more I read the more I realize just what a difficult measurement RH and Temp relationship is. Even pro gear is not always correct. Cheers :slight_smile:

2 Likes

Interestingly I came across this site in my steep learning curve about Temp and RH and Dewpoints.
Good site with all the formulae for calculating the above once you have reliable measurements to work with.

Relative Humidity Calculator

Just to make it fun (sheeeshh!!) there are hygrometers that can calculate RH from the length of a hair. Who needs a DHT22? :slight_smile: just pull your hair out and measure it :slight_smile:

1 Like