Hi,
I am using the DHTlib with a DHT22 and a Teensy 3.2. The code works okay for temperatures greater than 0C. However, when the temperature drops below 0C, it returns a checksum error. The datasheet for the sensor says it works over the range -40C to 80C.
So, is this a library problem, perhaps already known, or is something wrong with the sensor?
Code follows.
Thank you
For negative temperatures the
I am using the DHTlib with a DHT22 and a Teensy 3.2. The code works okay for temperatures greater than 0C. However, when the temperature drops below 0C, it returns a checksum error. The datasheet for the sensor says it works over the range -40C to 80C.
So, is this a library problem, perhaps already known, or is something wrong with the sensor?
Code follows.
Thank you
Code:
#include <dht.h>
dht DHT;
#define DHT22_PIN 7
#define DHTPWR 8
pinMode(DHTPWR,OUTPUT);
digitalWrite(DHTPWR,HIGH); // +Vcc to DHT
int chk = DHT.read22(DHT22_PIN);
switch (chk)
{
case DHTLIB_OK:
// DISPLAY DATA
h = DHT.humidity;
t = DHT.temperature;
sendprintf( (char *)"Temperature %.1f Humidity %.1f ", t, h );
break;
case DHTLIB_ERROR_CHECKSUM:
sendstring( (char *)"Error: DHT Checksum");
break;
case DHTLIB_ERROR_TIMEOUT:
sendstring( (char *)"Error: DHT Time out");
break;
case DHTLIB_ERROR_CONNECT:
sendstring( (char *)"Error: DHT Connect");
break;
case DHTLIB_ERROR_ACK_L:
sendstring( (char *)"Error: DHT Ack Low");
break;
case DHTLIB_ERROR_ACK_H:
sendstring( (char *)"Error: DHT Ack High");
break;
default:
sendstring( (char *)"Error: DHT Unknown");
break;
}
sendstring( (char *)"done" );
For negative temperatures the