DHT22 Wrong temperature readings.
See original GitHub issueThe temperature output dropped to to 1°C when the real temperature got above 26°C.
Steps to reproduce
using var dht = new Dht22(26);
while (true)
{
// Try to read the temperature.
var temp = dht.Temperature;
if (!dht.IsLastReadSuccessful) continue;
// Try to read the humidity.
var humidity = dht.Humidity;
if (!dht.IsLastReadSuccessful) continue;
Console.WriteLine($"Temperature: {temp.Celsius:0.0} °C, 'Humidity: {humidity:0.0} %");
break;
}
Expected behavior
Output: Temperature: 26.0 °C, 'Humidity: 36.1 %
Actual behavior
Output: Temperature: 1.0 °C, 'Humidity: 36.1 %
Versions used
Add following information:
- Dotnet on the build machine:
Version: 3.1.1 Commit: a1388f194c
- Dotnet on the raspberry pi 3B:
Version: 3.1.1 Commit: a1388f194c
- Version of
System.Device.Gpio
package:1.0.0
- Version of
Iot.Device.Bindings
package:1.0.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
DHT22 Shows wrong values... how do I address this?
The temp in my room at the moment is about 22 degrees according to an LN35 I have wired up on another board....
Read more >DHT22 sensors reporting bad values in ESPHome
I have just recently had to make a new sensor to subtract 2.3 from humidity and 1.6 from Temperature. to have this sensor...
Read more >DHT22 wrong readings
I am experiencing wrong temperature and humidity readings when using a D1 mini (ESP8266) to read a DHT22 sensor. Temperature is 2 to...
Read more >DHT22 inaccurate readings - adafruit industries
The datasheet says the relative humidity measurement is accurate to +/-2% on average, with a maximum error of +/-5%. For two sensors, those ......
Read more >DHT22 incorrect temperature readings : r/arduino
I have a few problems with the sensor readings. Testing it on a room, at around 23ºC, gives 25ºC. The reference temperature I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@fomenkodmitry and @BramEsendam, you are right, there was a mistake. I found some time to dig into the code and found the problem. Line 32 in the Dht222.cs file should be:
@joperezr, will make a PR asap.
I’ve merged that PR so hopefully the results will be fine now. I’ll go ahead and close this issue assuming it does, but please feel free to reopen if that is not the case.