winlinvip / SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
MIT License
144 stars 61 forks source link

[Improvement] [DHT11] It is possible to get tenths of temperature #51

Open martin-eden opened 2 years ago

martin-eden commented 2 years ago

For DHT11

While rewriting library for myself I've discovered that there are tenths of degrees Celsius transmitted in low nibble of second temperature byte. It is encoded in BCD, so hex values are in range 00..09.

martin-eden commented 2 years ago

I'm using this "DHT11" sensor from eBay: https://www.ebay.com/itm/221914097856

Despite specified range 0..50 °C it can measure negative temperatures and have temperature granularity 0.1 °C. Temperature sign is stored in bit 7 of second temperature byte.

image

DaleSchultz commented 1 year ago

are you getting more accuracy than DHT11.read2() ? (read2 takes floats)