Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By picstart
#34307 We are at 3.3v for both types of sensors the DHT11 has a pcb with a builtin 10kpullup and the DHT22 has an external 10K pullup.
Interval is 2 seconds.
The DHT11 in the same location as the DHT22 shows a relative humidity reading of 20% less than the DHT22.
DHT11 34% DHT22 56%. I tried several DHt11's and two DHT22's and they were consistent with each other but between types it was always about 20% less RH for the DHT11.
I am using the Adafruit DHT library with the sqrt call commented out ( it generates errors if left in). I get the same values for the DHT11 when I use my own DHT11 driver so I don't think it is a commercial vendor issue. I suspect this is a DHT11 versus DHT22 issue even though both specs say the RH is within (+or - ) 5%.
Has anyone had a similar experience?
User avatar
By DrG
#34358
picstart wrote:We are at 3.3v for both types of sensors the DHT11 has a pcb with a builtin 10kpullup and the DHT22 has an external 10K pullup.
Interval is 2 seconds.
The DHT11 in the same location as the DHT22 shows a relative humidity reading of 20% less than the DHT22.
DHT11 34% DHT22 56%. I tried several DHt11's and two DHT22's and they were consistent with each other but between types it was always about 20% less RH for the DHT11.
I am using the Adafruit DHT library with the sqrt call commented out ( it generates errors if left in). I get the same values for the DHT11 when I use my own DHT11 driver so I don't think it is a commercial vendor issue. I suspect this is a DHT11 versus DHT22 issue even though both specs say the RH is within (+or - ) 5%.
Has anyone had a similar experience?



I have some experience with the 11 and 22 (https://communities.intel.com/message/245385#245385) and interfaced them to a cheap PIC chip making them accessible through a serial port. I have also used an HIH-5030 (https://communities.intel.com/message/249237#249237) and an HTU21D. This by no means makes me a humidity sensor expert, but in my experience the 11 performed lower than the others (admittedly an unscientific and very small sample). As I recall, the 22 is an enhanced model of the 11. The basic software to read them is similar and the 22 sends a fractional part of the value (again as I recall since it has been a while). If you are accurately calculating the checksum and it is good, you are probably not reading them incorrectly. That is, the sensors are probably working, although you could be messing up the conversion.

But, you can get a definitive answer to address the differences by using salts that, when in a slurry, will put out a known RH at a given temperature. Ideally, you should use several different solutions to cover a range of RH values, but the most common is sodium chloride (some of the other salts can be toxic so you do need to know the chemicals you are working with). Also, even though you enclose the atmosphere using a plastic bag or something , the atmosphere of interest is only at the value for a couple of inches immediately above the slurry. I did this once and was pleasantly surprised that 4 of the 5 sensors that I tested were very close to the standard.

If you search for "humidity sensor calibration salt" you will see lots of examples and tutorials.

Hope this helps,

DrG
User avatar
By willfly
#34656 The Adafruit library worked very well for me. If checksum is correct, then reading error is ruled out. DHT11 does perform poorly compared to DHT22 which is a better sensor. In real life scenario (homes) humidity would not reach 30% range, so I suspect defective part. I have 10 DHT22 and all but one perform ok. The defective one reads 20% RH.