Skip to main content
deleted 60 characters in body
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 18

Hey guys iI get this error everytimeevery time. I used the DHT tester file from the library : https://codeload.github.com/adafruit/DHT-sensor-library/zip/masterthis library wich gave. Which gives me thisan error.

And then I realized that in my code i realize that Arduino recognizerecognizes only the readTemperaturereadTemperature function, not the readHumidityreadHumidity, but it doesntdoesn't give any compile error. Also, when iI read the sensor, this is the output:

Humidity Sensor Test
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%

Humidity Sensor Test
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor:
#include "DHT.h"
#define DHTPIN 5    // whatwhich digital pin we're connected to
#define DHTTYPE DHT11   // DHT 11

DHT dht(DHTPIN, DHTTYPE);
 

//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>

// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 
 

void setup() {
  Serial.begin(9600);
  delay(300);
  lcd.begin(16,2);
  Serial.println("Humidity Sensor Test");
 
  dht.begin();
  delay(300);
}

void loop() {
    // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  int h = dht.readHumidity();
  int t = dht.readTemperature();

    // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  // print from 0 to 9:

   lcd.print("Temp: ");
   lcd.print(t);
   lcd.print("C");
  
  // set the cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");
    
  Serial.print("Temp: ");
  Serial.print(t);
  Serial.print("C, Humidity: ");
  Serial.print(h);
  Serial.println("%");
 
  delay(2500);
}

Also iI have the 10k resistor between Data and powerdata and Vcc pins. Data is connected to digital pin 5. AnyoneHas anyone had this problem before?

Hey guys i get this error everytime. I used the DHT tester file from the library : https://codeload.github.com/adafruit/DHT-sensor-library/zip/master wich gave me this error.

And then in my code i realize that Arduino recognize only the readTemperature function, not the readHumidity, but it doesnt give any compile error. Also when i read the sensor, this is the output:

Humidity Sensor Test
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor:
#include "DHT.h"
#define DHTPIN 5    // what digital pin we're connected to
#define DHTTYPE DHT11   // DHT 11

DHT dht(DHTPIN, DHTTYPE);
 

//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>

// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 
 

void setup() {
  Serial.begin(9600);
  delay(300);
  lcd.begin(16,2);
  Serial.println("Humidity Sensor Test");
 
  dht.begin();
  delay(300);
}

void loop() {
    // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  int h = dht.readHumidity();
  int t = dht.readTemperature();

    // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  // print from 0 to 9:

   lcd.print("Temp: ");
   lcd.print(t);
   lcd.print("C");
  
  // set the cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");
    
  Serial.print("Temp: ");
  Serial.print(t);
  Serial.print("C, Humidity: ");
  Serial.print(h);
  Serial.println("%");
 
  delay(2500);
}

Also i have the 10k resistor between Data and power and connected to digital pin 5. Anyone had this problem before?

I get this error every time. I used the DHT tester file from this library. Which gives me an error.

And then I realized that in my code Arduino recognizes only the readTemperature function, not readHumidity, but it doesn't give any compile error. Also, when I read the sensor, this is the output:

Humidity Sensor Test
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%
Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor:
#include "DHT.h"
#define DHTPIN 5 // which digital pin we're connected to
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>

// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 

void setup() {
  Serial.begin(9600);
  delay(300);
  lcd.begin(16,2);
  Serial.println("Humidity Sensor Test");
  dht.begin();
  delay(300);
}

void loop() {
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  int h = dht.readHumidity();
  int t = dht.readTemperature();

  // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  // print from 0 to 9:

  lcd.print("Temp: ");
  lcd.print(t);
  lcd.print("C");

  // set the cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");

  Serial.print("Temp: ");
  Serial.print(t);
  Serial.print("C, Humidity: ");
  Serial.print(h);
  Serial.println("%");
  delay(2500);
}

Also I have the 10k resistor between data and Vcc pins. Data is connected to digital pin 5. Has anyone had this problem before?

Bumped by Community user
Bumped by Community user

Humidity Sensor Test 
Temp: 0C, Humidity: 0% 
Temp: 0C, Humidity: 0% 
Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor: #include "DHT.h" #define DHTPIN 5 // what digital pin we're connected to #define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

//I2C LCD: #include <Wire.h> // Comes with Arduino IDE #include <LiquidCrystal_I2C.h>

// Set the LCD I2C address LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() { Serial.begin(9600); delay(300); lcd.begin(16,2); Serial.println("Humidity Sensor Test");

dht.begin(); delay(300); }

void loop() { // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) int h = dht.readHumidity(); int t = dht.readTemperature();

//DHT11 Sensor:
#include "DHT.h"
#define DHTPIN 5    // what digital pin we're connected to
#define DHTTYPE DHT11   // DHT 11

DHT dht(DHTPIN, DHTTYPE);


//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>

// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 


void setup() {
  Serial.begin(9600);
  delay(300);
  lcd.begin(16,2);
  Serial.println("Humidity Sensor Test");

  dht.begin();
  delay(300);
}

void loop() {
    // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  int h = dht.readHumidity();
  int t = dht.readTemperature();

    // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  // print from 0 to 9:

   lcd.print("Temp: ");
   lcd.print(t);
   lcd.print("C");
  
  // set the cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");
    
  Serial.print("Temp: ");
  Serial.print(t);
  Serial.print("C, Humidity: ");
  Serial.print(h);
  Serial.println("%");

  delay(2500);
}

lcd.setCursor(0, 0); // print from 0 to 9:

lcd.print("Temp: "); lcd.print(t); lcd.print("C");

// set the cursor to (16,1): lcd.setCursor(0,1); lcd.print("Humidity: "); lcd.print(h); lcd.print("%");

Serial.print("Temp: "); Serial.print(t); Serial.print("C, Humidity: "); Serial.print(h); Serial.println("%");

delay(2500); }

Humidity Sensor Test Temp: 0C, Humidity: 0% Temp: 0C, Humidity: 0% Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor: #include "DHT.h" #define DHTPIN 5 // what digital pin we're connected to #define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

//I2C LCD: #include <Wire.h> // Comes with Arduino IDE #include <LiquidCrystal_I2C.h>

// Set the LCD I2C address LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() { Serial.begin(9600); delay(300); lcd.begin(16,2); Serial.println("Humidity Sensor Test");

dht.begin(); delay(300); }

void loop() { // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) int h = dht.readHumidity(); int t = dht.readTemperature();

// set the cursor to (0,0):

lcd.setCursor(0, 0); // print from 0 to 9:

lcd.print("Temp: "); lcd.print(t); lcd.print("C");

// set the cursor to (16,1): lcd.setCursor(0,1); lcd.print("Humidity: "); lcd.print(h); lcd.print("%");

Serial.print("Temp: "); Serial.print(t); Serial.print("C, Humidity: "); Serial.print(h); Serial.println("%");

delay(2500); }

Humidity Sensor Test 
Temp: 0C, Humidity: 0% 
Temp: 0C, Humidity: 0% 
Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor:
#include "DHT.h"
#define DHTPIN 5    // what digital pin we're connected to
#define DHTTYPE DHT11   // DHT 11

DHT dht(DHTPIN, DHTTYPE);


//I2C LCD:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>

// Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 


void setup() {
  Serial.begin(9600);
  delay(300);
  lcd.begin(16,2);
  Serial.println("Humidity Sensor Test");

  dht.begin();
  delay(300);
}

void loop() {
    // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  int h = dht.readHumidity();
  int t = dht.readTemperature();

    // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  // print from 0 to 9:

   lcd.print("Temp: ");
   lcd.print(t);
   lcd.print("C");
  
  // set the cursor to (16,1):
  lcd.setCursor(0,1);
  lcd.print("Humidity: ");
  lcd.print(h);
  lcd.print("%");
    
  Serial.print("Temp: ");
  Serial.print(t);
  Serial.print("C, Humidity: ");
  Serial.print(h);
  Serial.println("%");

  delay(2500);
}
Source Link

Arduino Uno Sensor DHT11 Failed to read from DHT sensor

Hey guys i get this error everytime. I used the DHT tester file from the library : https://codeload.github.com/adafruit/DHT-sensor-library/zip/master wich gave me this error.

And then in my code i realize that Arduino recognize only the readTemperature function, not the readHumidity, but it doesnt give any compile error. Also when i read the sensor, this is the output:

Humidity Sensor Test Temp: 0C, Humidity: 0% Temp: 0C, Humidity: 0% Temp: 0C, Humidity: 0%

My code is here:

//DHT11 Sensor: #include "DHT.h" #define DHTPIN 5 // what digital pin we're connected to #define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

//I2C LCD: #include <Wire.h> // Comes with Arduino IDE #include <LiquidCrystal_I2C.h>

// Set the LCD I2C address LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() { Serial.begin(9600); delay(300); lcd.begin(16,2); Serial.println("Humidity Sensor Test");

dht.begin(); delay(300); }

void loop() { // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) int h = dht.readHumidity(); int t = dht.readTemperature();

// set the cursor to (0,0):

lcd.setCursor(0, 0); // print from 0 to 9:

lcd.print("Temp: "); lcd.print(t); lcd.print("C");

// set the cursor to (16,1): lcd.setCursor(0,1); lcd.print("Humidity: "); lcd.print(h); lcd.print("%");

Serial.print("Temp: "); Serial.print(t); Serial.print("C, Humidity: "); Serial.print(h); Serial.println("%");

delay(2500); }

Also i have the 10k resistor between Data and power and connected to digital pin 5. Anyone had this problem before?