Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measured temperature is about 7-8 degrees(in Celsius) less than the real temperature #195

Open
abattya opened this issue Sep 23, 2022 · 1 comment

Comments

@abattya
Copy link

abattya commented Sep 23, 2022

Hello, the code works for me, but i measure around 24-25 Celsius, but there is only 18 degress here. I use 3.3V supply(but i also tried with 5V) and a 10k resistor between data and VCC.
What can I do?

  • board: ESP32 DEVKIT C

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.19

CODE:

#include <DHT.h>
#define DHTPIN 4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);

float h = 0;
float t = 0;

void setup() {
Serial.begin(9600);
dht.begin();

}

void loop() {

if (isnan(h)) {
Serial.println("Failed to read Humidity from DHT sensor!");
return;
}

if (isnan(t)) {
Serial.println("Failed to read celsius from DHT sensor!");
return;

}
h= dht.readHumidity();
t= dht.readTemperature();

Serial.print(F("Humidity: "));
Serial.print(h);
Serial.print("°% ");
Serial.print(F("Temperature: "));
Serial.print(t);
Serial.println("°C ");

delay(3000);
}

@caternuson
Copy link

What is measuring 18 degrees? How close together is that device and the DHT22?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants