3

Background: My project is to have several raspberry pis measuring and record temperature and humidity throughout our factory. DHT22 AM2302 sensor seemed like the best option at the time, do to its ability to measure both humidity and temperature at the same time. Also its affordable cost seemed to good to be true.

Problem: The current issue I am having is with the accuracy of the DHT22 AM2302 readings on humidity. I'm using the AdafruitDHT driver with a python script. We have several other handheld temperature and humidity sensors we use to manually check our factories conditions. The humidity seems to be 10+ degrees off. Which when calculating heat-index greatly effects the the HI value.

Questions: Has anyone else had this issue? Can you re-calibrate the sensor if though it is pre-calibrated during production? Should I not waste my time and invest in a more reliable industrial grade humidity sensor? Any help would be wonderful.

4 Answers 4

2

You need to ensure each sensor is measuring exactly the same environment before making a judgement.

Have a look at the I2C based Si7021.

I left a Pi plus DHT11/DHT22/Si7201 under a plastic tub for seven hours, taking a reading every 3.3 seconds.

The DHT22 and Si7021 are clearly in the same ball park. The Si7021 seems to have a lot less jitter.

Relative Humidity % Relative Humidity %

Temperature C Temperature C

I left the DHT11 off this plot as it obscured the view of the other two sensors. It had broad bands as above.

1
  • Given the time, doing a comparison experiment would be a better option. Using constants and controlled environments to truly see what is going on with the sensor. I do not disagree with you there. However, time and resources are limited. The most we have to done in comparing sensors is having the sensors next to each other recording the temp. and hum. We have two different handheld sensors both just 1 or 2 percent apart while the DHT22 was the 10+ off mentioned earlier. I haven't been able to have any really controlled test, but that is what I gathered from comparing side by side.
    – JKMartinez
    Commented Jul 13, 2016 at 16:24
1

With regards to controlling the environment, there is an old chemistry trick to produce a stable humidity value using water and a saturated salt solution. By changing the salt you can adjust the humidity. This is a very reproducible method.

Here is a table showing you some of the values.

http://www.omega.com/temperature/z/pdf/z103.pdf

For example, sodium chloride (table salt) produces about 78% humidity and potassium acetate produces about 23% humidity. Pure water should be nearly 100% (save for any contamination). Keep in mind these need to be in sealed containers and can take a few hours to a day to reach equilibrium. Table salt and potassium acetate are probably the only two you can get your hands on easily.

I would also focus on equilibrium values and not the transient values. It looks like your sensor is responding slower to the increased humidity in one of the charts. That response rate is another variable all together. Make sure the equilibrium values match up before you start chasing down differences in response rate.

Once you eliminate that variable you can move onto any hardware/software issues. If nothing else, you might use this information to establish a calibration offset for each sensor. Sounds like a pain, but if it works you can have a very accurate system. With regards to industrial sensors, they are probably the same components you are dealing with, they just have an eeprom on board with calibration values, power filtering, some snazzy package and someone's time somewhere to run the calibration. Hence the increased price. You are on the right track.

Good luck.

3
  • Thanks for posting the equilibrium chart bk79. I was able to modify a mason jar and place all sensors into the jar by cutting a 2" circumference hole and using silicone to make it air tight again. A thick solution of table salt and water lies at the bottom and is around one and a half inches thick. I let it set for a day and a half. However, the sensors show little change with humidity readings. Will they ever re-calibrate and match up or will I have to have to hard code it?
    – JKMartinez
    Commented Aug 11, 2016 at 15:57
  • I don't think they will recalibrate themselves. If that was an option, there would be some sort of code to send with "the reference value is X rH% so recalibrate" type command. Most industrial sensors would have an eeprom on the board used for calibration purposes. Hard coding would be the quickest option, but I would suggest a more robust solution would be to put an eeprom on the board with a specific sensor and store your calibration data there. That way you can swap out sensors (if they go bad for example after a year) later without modifying your code.
    – bk79
    Commented Aug 15, 2016 at 16:53
  • Having that known stable value (per the table I provided) can give you confidence that the reading really should be X so you can adjust your calibration value with confidence. Then confirm you get the proper reading. I'd do a 2 or 3 point calibration curve so really be sure. Also, verify your temperature readings are correct as well. I believe all those DHT sensors have a thermal sensor on board as well - this could be contributing to your problem.
    – bk79
    Commented Aug 15, 2016 at 16:54
0

Update: Over the past weeks I bought more DHT22 AM2302 sensors from a collection of Amazon sellers. Five sensors were ordered and testing all of them, one after the other on a single Pi showed some interesting results.

All DHT22 AM2302 sensors had different readings of humidity. While temperature was only .4 or so apart, at the highest. Here is some background to the kind of environment the sensors are in. I work in a air-conditioned office so temperature is generally constant with 74-76 being the norm.

At first I had my sensors out in the open after, I then created a small container out of some near by office supplies. It's not a air tight container but its main purpose was to prevent a change in conditions due to the air-conditioned going off or someone breathing on it. Not state of the art but it does a okay job and its a start.

The results are similar to the initial test. The sensors still had large differences in the humidity readings. I collected the data over the past day or so. This is a taste of what I'm dealing with.

  1. Sensor-D T:75.74 H:68.1;
  2. Sensor-1 T:75.56 H:58.6;
  3. Sensor-2 T:75.56 H:48.1;
  4. Sensor-3 T:75.74 H:48.4;
  5. Sensor-4 T:75.74 H:59.1;

My Thoughts: I could continue to do more controlled test. Which I plan to in hopes of helping someone else out later. But it seems fairly obvious that its the sensors at fault and not my environments conditions. I've been doing some research on humidity sensors in general. After reading some other experiments and reports(sorry don't have to the sources atm). Measuring humidity accurately is just something very difficult to do in the first place. I also assume that since the sensor are pre-calibrated during production they might have been made by different manufacturers in different locations and environments. DHT22 cheap and a good temperature sensor but for humidity seems extremely unreliable.

0

I use the BME280 (and the related BMP family sensors). You may want to research other sensors (the Lobachevsky way, reading other's research). For a good comparison, see for instance http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.