What it is: The DHT11 is a low-cost digital temperature and humidity sensor. It measures 0–50 °C (±2 °C) and 20–90 % RH (±5 %) and sends both values as a digital signal over a single data wire.
How it works: An onboard chip samples a thermistor and a humidity element, then clocks the result out on the DATA pin using a timed one-wire protocol. The DHT library handles that timing for you.
Wiring:
DHT11 DATA -> GPIO10
DHT11 VCC -> 3V3
DHT11 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
If you use a bare 3-pin DHT11 (no module PCB), add a 10k pull-up resistor between DATA and 3V3.
Libraries (Arduino IDE -> Library Manager): "DHT sensor library" by Adafruit (it will also install "Adafruit Unified Sensor"), plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: big temperature in °C and humidity in % on the OLED, same values printed to Serial. Updates every 2 seconds (the DHT11 can only be read about once per second).
Gotchas: The DHT11 is slow and coarse — if you need decimals or faster updates, use the DHT22. A reading of "nan" means a wiring or timing fault; check the DATA pin and pull-up.