My DHT11 keeps giving wrong values—what’s wrong?

If your DHT11 is giving wrong readings (e.g., unrealistic humidity/temperature values, NaN errors, or erratic data), here are the most common causes and fixes: 1. Wiring Issues (Most Common Problem) Check: Pull-up resistor : A 4.7kΩ–10kΩ resistor must connect the DATA line to VCC (DHT11 won't work reliably without it). Loose connections : Ensure wires are firmly plugged into the correct pins. Short circuits : Check if any wires are touching accidentally. Fix: Re-wire the circuit like this: text DHT11 VCC → 5V DHT11 GND → GND DHT11 DATA → Digital Pin (e.g., D2) 4.7kΩ resistor between DATA and VCC 2. Power Supply Problems Symptoms: Readings are 0 , -999 , or randomly jump . Sensor gets warm (indicates a wiring mistake). Fix: Use a stable 5V supply (some 3.3V boards may not provide enough power). If using a long cable (>1m), add a 100nF capacitor between VCC and ...