nigeljohnson73:
Right, So I breathed on the sensor. Humidity ramped up to a calamtous 30% which for breath is way low. Temp got to about 33 degrees. When I stopped, humidity ramped down to 1% again. Temp dropped to about where it was climbing previously and continues to climb... Currently sitting at 31.3 degrees.I'm currently thinking I have a dodgy sensor ??
the sensor works by a hydrophilic polymer absorbing moisture and changing its electrical response accordingly. It takes time for it to respond. It shoots up nicely when sudden changes but can take several seconds to get to steady state.
I use this for my DHT22's, and it works: Note the use on the sensor's minimum sampling time. too many readings affect the temperature/humidity.
#include "DHT.h"
DHT dht;
void setup()
{
Serial.begin(9600);
Serial.println();
Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)");
dht.setup(2); // data pin 2
}
void loop()
{
delay(dht.getMinimumSamplingPeriod());
float humidity = dht.getHumidity();
float temperature = dht.getTemperature();
Serial.print(dht.getStatusString());
Serial.print("\t");
Serial.print(humidity, 1);
Serial.print("\t\t");
Serial.print(temperature, 1);
Serial.print("\t\t");
Serial.println(dht.toFahrenheit(temperature), 1);
}