ESP32 OLED Web Server — Live Sensor Dashboard
Serve a live dashboard from the ESP32 itself: temperature & humidity readings on a browser page and an SSD1306 OLED.
Everything you need
Required Components
Total: ₹865
#Introduction
Turn an ESP32 into a tiny web server that reports live temperature and humidity — on a web page and on an OLED display.
#Wiring
- DHT11 data → GPIO 4
- OLED SDA → GPIO 21, SCL → GPIO 22
- Both powered from 3V3 and GND
#Steps
- Install the ESP32 board package (see our Getting Started tutorial).
- Install libraries: Adafruit SSD1306, Adafruit GFX, DHT sensor library.
- Flash the sketch below, editing
WIFI_SSID/WIFI_PASS. - Open the IP shown on the OLED in your browser.
#How it works
The ESP32 hosts a minimal HTTP server. Every request re-reads the DHT11 and renders an HTML page; the same reading is pushed to the OLED over I2C.
#Troubleshooting
- OLED blank → check I2C address (0x3C vs 0x3D) and wiring.
- DHT reads 0 → most modules need the data pin pulled up (onboard on breakouts).
Source Code
⬇ Download Code- oled_web_server.ino