high value reading DHT22 temperature
Posted: Sun Nov 22, 2020 12:01 pm
Hi,
I'm trying to read my DHT22 sensor (I think it's a DHT22) on my nodemcu ESP8266 board with micropython 1.13.
I use the following example code for DHT22:
I seem to get a response for the temperature in the range of 500-600.
However, when I use the DHT11 like this:
I get a more sensible response like 22 (degrees C).
Does this mean I'm probably working with a DHT11 sensor, or do I need to apply some more formatting on the DHT22 value received to make more sense of the output?
Thank you in advance!
Best regards,
I'm trying to read my DHT22 sensor (I think it's a DHT22) on my nodemcu ESP8266 board with micropython 1.13.
I use the following example code for DHT22:
Code: Select all
import dht
import machine
d = dht.DHT22(machine.Pin(4))
d.measure()
print(d.temperature()) # eg. 23.6 (°C)
print(d.humidity()) # eg. 41.3 (% RH)
However, when I use the DHT11 like this:
Code: Select all
d = dht.DHT11(machine.Pin(4))
Does this mean I'm probably working with a DHT11 sensor, or do I need to apply some more formatting on the DHT22 value received to make more sense of the output?
Thank you in advance!
Best regards,