This issue is common with the DHT11 on ESP32. Here’s what you can try:
-
Use a 10K pull-up resistor between DATA and VCC (essential for signal stability).
-
Power the DHT11 with 5V instead of 3.3V, if your module supports it (most do).
-
Switch to the “DHTesp” library—it’s more reliable on ESP32 than the Adafruit one.
-
Double-check wiring and ensure you're using the correct GPIO number (GPIO4, not a labeled pin like D4).
-
Use short wires, and try another sensor if nothing works—some cheap modules are faulty.
These steps usually fix the "Failed to read from DHT sensor!" issue. If the error still persist you can comment.