I am trying to use DHT11 sensor with Arduino. But unfortunately it is returning following values:
Temperature = 1.00 Humidity = 2.00
My code is as follows:
#include <dht.h>
dht DHT;
#define DHT11_PIN 7
void setup(){
Serial.begin(9600);
}
void loop()
{
int chk = DHT.read11(DHT11_PIN);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
delay(1000);
}
Link to the library I am using is here
I have connected +ve to 3.3 V I have connected -ve to Ground I have connected out to digital pin # 7