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
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;
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
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); }