New ESP32-S3 development board is now available → /products
</>OceanLabz
ESP32Intermediate~60 min

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

#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

  1. Install the ESP32 board package (see our Getting Started tutorial).
  2. Install libraries: Adafruit SSD1306, Adafruit GFX, DHT sensor library.
  3. Flash the sketch below, editing WIFI_SSID / WIFI_PASS.
  4. 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).
  • oled_web_server.ino

Keep going