DHT11 shows zero values (timeout)

Mine DHT11 was working ok and suddenly it started to throw -2 error code and outputs only zeros.
Wiring is ok, code is ok i stripped everything and left only sensor on protoboard and it still looks dead.

So, how durable DHT11 sensors are? Could i somehow carelessly fry it?

have you tried it on another (arduino) pin?
It could be that the Arduino broke, not your sensor...

Hm...maybe....
Digital pins are ok, how can i tell if analog pins are ok?

connect a potmeter - middle pin to the Arduino and the outer pins of the potmeter to 5V and GND...

That looks ok.

With pot connected, minimum value is 0, maximum is 1023....

Can you post the code you used?
Did you connect the DHT to an analog pin?

The timeout error is caused whenever ur DHT11 is not respoding . Check u have wire it properly and also check for the DATA pin u've connected is on correct pin or not and try running the example code of the library .

robtillaart:
Can you post the code you used?

Nothing special there...I tought some of my other code might interfere with DHT, so at the end, i used example code (found here on Arduino playground: Arduino Playground - HomePage).

robtillaart:
Did you connect the DHT to an analog pin?

Yes. I also tested it on all analog pins.

The timeout error is caused whenever ur DHT11 is not respoding . Check u have wire it properly and also check for the DATA pin u've connected is on correct pin or not and try running the example code of the library .

Checked everything few times with no results...

nocarrier:

robtillaart:
Did you connect the DHT to an analog pin?

Yes. I also tested it on all analog pins.

The DHT gives a digital signal and no analog signal so it might not work.

Please post your code as it still is unclear why it does not work, your code will probably hold the clue..

Some of the datasheet says it requires 5k or 4k7 resistor as a pull up ... and also it mentions 5.5v as max voltage for the dht11 may be u've fried it up earlier.

I don't know what to say, but it works on digital pins.... :blush:
Not sure how i managed to overlook this at the first place...

Thank's everyone.

nocarrier:
I don't know what to say, but it works on digital pins.... :blush:
Not sure how i managed to overlook this at the first place...

You just learned a lesson you probably will never forget (and one that many made before you :wink:

Hi guys,

Please, could someone help me with this? I am receiving a zero (0) reading for temperature and humidity from my DHT11 sensor. I am using a Leonardo board, powered on the usb 5v source. There is also a soil moisture sensor with controller pinned in the same board. I am using the DHTlib library provided by Rob Tillaart (thanks!) and the code is the following above. My objective is just show in the serial monitor the output from both sensors.

//-----------------

#include <dht.h>

#define dataPin 8
dht DHT; // creates a DHT object

const int moistureAO = 0;
int AO = 0;
int tmp = 0;
int buzzPin = 11;
int LED = 13;

void setup() {
Serial.begin(9600);
Serial.print("Soil moisture sensor");
pinMode(moistureAO, INPUT);
pinMode(buzzPin, OUTPUT);
pinMode(LED, OUTPUT);
}

void loop () {
tmp = analogRead( moistureAO );
if ( tmp != AO ) {
AO = tmp;
Serial.print("A = ");
Serial.println(AO);
}
delay (1000);
if (analogRead(0) > 900) {
digitalWrite(buzzPin, HIGH);
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(buzzPin, LOW);
digitalWrite(LED,HIGH);
}
else {
digitalWrite(buzzPin, LOW);
digitalWrite(LED, LOW);
}
int readData = DHT.read22(dataPin); // Reads the data from the sensor
float t = DHT.temperature; // Gets the values of the temperature
float h = DHT.humidity; // Gets the values of the humidity

// Printing the results on the serial monitor
Serial.print("Temperature = ");
Serial.print(t);
Serial.print(" *C ");
Serial.print(" Humidity = ");
Serial.print(h);
Serial.println(" % ");

delay(2000); // Delays 2 secods, as the DHT22 sampling rate is 0.5Hz
}