DHT Error Correction

I am surprised to find my two DHT21 AM2301 temp/humidity are off about 5.7% according to a precision photography developing thermometer I've used for years although the datasheet suggest +/- 1degC.

My question for anyone knowledgable about sensors, is it better to compensate by a % for other temperatures or increase or decrease by a fixed value. I realize this may not be a one size fits all answer and the sensor may need to be mapped to be accurate. What would be a good procedure for this?

US$9 versus US$900. The accuracy you require determines the device you use.

5.7% of what temperature value, +/- 1C is 1% at 100C, 2% at 50C, 10% at 10C.

Do a set of values across the temperature range you are interested in , then you can decide if it is an OFFSET or SCALE problem.

When taking the comparison, did you have the thermometer in water and the sensor immersed in the water in a bag and let it stabilise?

Tom... :smiley: :+1: :coffee: :australia:

Good point but I thought the +/- 1C was over the operating temp advertised. I'm not at a calibration stage yet but a general observation at around 21C. This observation was free air with both the DHT21 and precision thermometer next to one another for some time. To actually calibrate your suggestion probably would be a good approach.

I might ask what might be a more accurate out of the box indoor room temp and humidity sensor. I was thinking the DHT21 would be sufficient. It is part of a home automation heating system. For years I used calibrated analog sensor but I'm now experimenting with other options using Arduino. I was having good luck with the Dallas DS18B20 sensors for temp but thought a humidity/temp sensor could be incorporated. P.S. I am looking for a longer reach like 30ft -40ft so I2c is out.

Hi,
I would say most out of the box instruments would be within their spec, but individual components are another box of tricks.

An instrument is adjusted in factory.
A DHT will be measured and probably the worst just junked and not sold. (Built for a price)

DS18B20, having some inbuilt brains is possibly able to be "calibrated" to spec on the production line.

Tom.. :smiley: :+1: :coffee: :australia:

Comparing temperature of air is tricky. There can be easily 1 °C difference between devices close together. Even worse if you are close to a heat source - such as computer used to test the DHT.
Another influence to consider is self-heating of the sensor. I don't have experience with DHT but DS18B20 warms up considerably (IIRC 1-2 °C) when you read the temperature continuously. To get real temperature you need to take the reading once a minute or so.

Good point on the self heating problem. I was reading the sensor about once every 15 sec. If it's a consistent read duration would some of that error be taken care of by an OFFSET or SCALE adjustment that seems to be needed anyway?

Looking over the preferred way to connect the AM2301, I notice a suggested noise filter in their diagram produced by C4 and R5. The distance to my MEGA from the sensor is about 35 feet. I chose a 560 ohm resistor for R5 and .001mf for the C4 cap. For RP, I used a 5.6k resistor. This feels a bit whilly nilly choosing the values for the filter but maybe it's a trial and error situation determined by electrical noise in the area. Any thoughts on these two values?

Before dropping the 10k suggested pull-up I was dropping a good read periodically so I am trying the 5.6k and filter.

Hi,
When you do the comparison, are the DHT readings stable?
Have you done a test in water rater than air yet?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Understanding the device can generate heat I’m wondering if using a water heat sink would yield good results if these sensors are used in free air. Sounds like a catch 22. The readings are stable but the resolution seem to be 8 bit.

Calibrate the temperature readings by comparison with an accurate thermometer. A good overview of sensor calibration procedures is given here.

The idea of a water bath is so that heat conduction is high enough to ensure after some equalization time the two devices are at the same temp.
Using air, means you are using a heat insulator (air) and cannot guarantee that both will be equal in temp.

I do instrument calibrations and depending on cal temperature we have water and oil cal baths.

We have a dry calibrator, but care has to be taken with device placement and they take longer to make sure the cal temp is stable.

What is the application?

Tom... :smiley: :+1: :coffee: :australia:

After further investigation and using a liquid immersion bath to check the calibration of the AM2301 sensor, I have come to realize the problem is inherent in its design. With the immersion bath, I found that the sensor was approx. .1° to .2° off. but in real-life operation, it was showing about 1.3° - 1.5° off. My first thought was to remove the housing allowing greater air circulation. This did improve results by about .25 °-.4°. I next stopped polling the sensor for a few minutes but no improvement. My next step found the issue. I unplugged 5V power to the sensor for 5 min. The sensor readout when power was reapplied was close to dead on but gradually went back to its normal power on error. Heat is most likely being generated by just having it plugged in. I'm not overly impressed with this sensor. My old LM35s running for 25 years on a 10-bit ADC did a much better job even on a far-reach.

Hi,
It is supposed to be able to run on Power Supply: 3.3 – 5.2V DC (5V recommended).

Have you tried it on 3V3 to see if that reduces self heating effect?

What is the applicaton?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

According to the data sheet it would not work for the distance I’m using it at. Probably 30-40 ft. Not enough pull-up ability I believe I read. I ordered a few DHT22s to see if they act any difference but I don’t believe it will solve the self heating issue. They claim the sensors have a higher +- C accuracy. There may be better sensors available but most require the I2c or SPI bus which is not intended for distance. An offset adjustment for self generated heat may be acceptable but varying air flow at the sensor location in my case will introduce error. In regards to scaler error, would a map function be used for correction?

I’m giving thought to replacing a dozen LM35 analog sensors in my 30 year old home automation system but I’m shying towards the Dallas sensors now having some idea about problems with the DHT2x sensors.

The application requires some accuracy to control an environmental control system and hydronic floor heating system. Room temperatures, ceiling temperatures for passive heat recirculation (ceilings 27 ft high) and outside temps for anticipating heat demand are the most important measurements. More sensors help control mixing valve temps, domestic hot water tank, domestic hot water circulating pump and boiler operation but they require less accuracy.

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