Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By picstart
#34872 The link above comparing the dht11 ans dht22 shows that the dht22 should not be 20% higher in its reading of RH than the DHT22. This may indicate that the commercial library available for the DHT22 and the esp8266 have an issue. Both the DHT11 and the DHT22 are bitbanged to get readings. The DHT22 needs more bitbanging for the hopeful extra accuracy.and with the opportunity of the esp8266 to take away cycles when a higher priority (WiFi ) call comes in the DHT22 code timing may be vulnerable. So far the DHT11 is cheaper and more accurate (with the commercial software +esp8266) and moreover the DHT11 commercial code has been vetted against code for other non Arduino platforms.
User avatar
By schufti
#34902 all the "commercial code library issue" conspiracy is total and utter ****. Everyone is fee to look into this libraries and check if the code complies with the datasheets (datatransfer and conversion wise).
If bitbanging would be interupted by higher prio routines chances are that the bitbanging is not timecritical and the remaining part of the data would be fetched delayed and give good checksum or plainly fail at checksum at last.
User avatar
By penatenjoe
#34909 My experience confirms that DHT11 yields false low humidity readings while DHT22 are rather accurate. I stopped using any DHT11. Here some details:

I tried about half a dozen DHT11 which ordered at different times last year from China, some as bare sensor, some as "module" mounted on a PCB with resistor. I used them mostly to control indoor conditions (basement, laundry room, outside) and drive ventilation fans accordingly. In the 6 months I was tracking them none yielded meaningful long-term humidity data. Most of them trended somehow but usually humidity was implausible low. Also they stopped showing changes below ca. 40%. I restored two as described in the data sheet (drying in the oven / exposing to moist air) but to no avail.
I replaced all my sensors with DHT22 and now have reasonable agreement with commercial hygrometers. A typical result for the direct comparison was 40% for the DHT11 and 65% for the DHT22.

I didn't know the second link posted above but I am surprised to see accuracy of the DHT11 being reported that good.

P.S.
I did exclude self-heating as a cause since temperature readings were reasonable. I verified the source of the libraries and ensured proper error checking as described in the data sheet to ensure that there were no issues with the readout code.
User avatar
By zoomx
#34948 I was surprised too about DHT11 accuracy reported since my results, and the others I found, seems different.

I got the same results with an Arduino so I don't believe that is a problem with the ESP8266 library. Maybe a problem with all libraries.