简体   繁体   中英

Arduino DHT11 readings swapping places

Does anyone else has this kind of problem using Arduino (in this case Mega2560) and DHT11 with DHT Library. I'm reading sensor humidity and temperature once in a minute. I'm not using delays but checking current millis - last read millis to check when I need to read values again. Anyway this is my plotted data. Sometimes it works with ease multiple hours or even full day but suddenly reading goes like in the picture above. Like temp and humidity is swapping places. Very annoying. I post my DHT lib version here soon. It should be latest I could find from the web.

Could this be a bug in library or just bad DHT11 sensor (bought from china)

DH11读数图像

DHT11 is very simple and rough sensor. So, some fluctuation can be observed. I have DHT11, DHT22 aka AM2302 and DS18B20 (just temperature) sensors. DHT22 and DS18B20 have similar results with 0.1°C precision. But DHT11 is useful only for rough observation and sometimes I receive same results as on your picture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM