I have ESP32 WIFI LORA 32 BOARD by Heltec and TTGO and both function with DHT22 when I use 12, 13 or 25 pins. But when I try to use 32 until 39 pins, the temperature and humidity can not read and show ZERO in serial monitor. Important that the sensor send a signal, I read with multimeter.
The pinout diagram is in: http://www.heltec.cn/download/WIFI_LoRa_32_Diagram.pdf
My sketch is simple:
#include <SimpleDHT.h>
byte pinDHT22 = 25;
float temperature = 0;
float humidity = 0;
SimpleDHT22 dht22;
void setup() {
Serial.begin(115200);
}
void loop() {
TEMPERATURA();
delay(2000);
}
void TEMPERATURA(){
dht22.read2(pinDHT22, &temperature, &humidity, NULL);
Serial.print(temperature);
Serial.print(” °C “);
Serial.print(humidity);
Serial.print(“% “);
}