DHT11 sensor with Arduino UNO: Time out error, -999.0, -999.0

Hello,

I am trying to get meaningful information from a DHT11 sensor using an Arduino UNO board.

This should be a straight-forward little project but i am out of ideas about what i might be doing wrong, except that the DHT11 sensor might be broken. I tried another DHT11 sensor and same problem.

This is the library that i'm using: Arduino/libraries/DHTstable at master · RobTillaart/Arduino · GitHub

I'm using the example sketch: Arduino/dht11_test.ino at master · RobTillaart/Arduino · GitHub
I changed the digital pin to 7 based on my setup and also changed the default baud rate from 115200 to 9600:

//    FILE: dht11_test.ino
//  AUTHOR: Rob Tillaart
// VERSION: 0.1.01
// PURPOSE: DHT library test sketch for DHT11 && Arduino
//     URL:
//
// Released to the public domain
//

#include <dht.h>

dht DHT;

#define DHT11_PIN 7

void setup()
{
  Serial.begin(9600);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()
{
  // READ DATA
  Serial.print("DHT11, \t");
  int chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK:  
 Serial.print("OK,\t"); 
 break;
    case DHTLIB_ERROR_CHECKSUM: 
 Serial.print("Checksum error,\t"); 
 break;
    case DHTLIB_ERROR_TIMEOUT: 
 Serial.print("Time out error,\t"); 
 break;
    default: 
 Serial.print("Unknown error,\t"); 
 break;
  }
  // DISPLAY DATA
  Serial.print(DHT.humidity, 1);
  Serial.print(",\t");
  Serial.println(DHT.temperature, 1);

  delay(2000);
}

This is the current output from the Arduino IDE Serial Monitor:

DHT TEST PROGRAM 
LIBRARY VERSION: 0.2.3 - dhtstable

Type, status, Humidity (%), Temperature (C)
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0
DHT11, Time out error, -999.0, -999.0

DHT11sensors.jpg

DHT11sensorbackinfo.jpg

This is my connection setup with R1 as a 10K Ohm pull up resistor:

humidity-sensor.png

DHT11sensors.jpg

DHT11sensorbackinfo.jpg

humidity-sensor.png

No code posted = no help possible

Change the pin back to the original and what happens?

Thank you for posting the code, but it is bad manners to make a substantial change to a post that has already been commented on which makes the comment look like nonsense

UKHeliBob:
Thank you for posting the code, but it is bad manners to make a substantial change to a post that has already been commented on which makes the comment look like nonsense

No worries, UKHeliBob. I knew there was no code in post #1 when you posted.

.

UKHeliBob:
Thank you for posting the code, but it is bad manners to make a substantial change to a post that has already been commented on which makes the comment look like nonsense

I have very slow internet currently and i realized that i didn't include the code after pressing the 'Post' button. It took several minutes to load the editor and save the modified post. Anyway, i'm sorry if you were offended by my code omission and slow editing due to my poor internet connection.

ieee488:
Change the pin back to the original and what happens?

I changed it back to digital pin 5 and same error results in Serial Monitor but changing to a different digital pin shouldn't make any difference?

i'm sorry if you were offended by my code omission

It happens so frequently, as does not using code tags, that I don't bother to get offended. Life is too short !

Maybe the problem is with the 10 K Ohms resistor? I found this value in some online tutorial. Should i use a different value pull-up resistor instead?

DryRun:
I have very slow internet currently and i realized that i didn't include the code after pressing the 'Post' button. It took several minutes to load the editor and save the modified post. Anyway, i'm sorry if you were offended by my code omission and slow editing due to my poor internet connection.
I changed it back to digital pin 5 and same error results in Serial Monitor but changing to a different digital pin shouldn't make any difference?

The whole point of changing back to pin D5 and removing any other extraneous parts and associated code is to verify that you have a working DHT11.

.