Create a desktop information hub that displays real-time data from the web. This beginner-friendly ESP32 project teaches you how to connect to WiFi, parse JSON data from public APIs, and render elegant graphics on an I2C OLED display.
While many IoT projects live purely in the cloud, having a physical hardware dashboard adds a level of utility to your workspace. By utilizing the NTP (Network Time Protocol) and Weather APIs, this dashboard provides instant utility without needing to check your phone.
We use a 1.3-inch OLED display based on the SH1106 driver. Unlike traditional LCDs, OLEDs don't require a backlight, providing true blacks and high visibility at any angle.
| Part Name | Qty |
|---|---|
| ESP32 DevKit V1 | 1 |
| 1.3" I2C OLED Display (SH1106 or SSD1306) | 1 |
| Jumper Wires | 4 |
Connections are minimal thanks to the I2C protocol, which only requires two signal wires and power.
| Peripheral | Device Pin | ESP32 Pin | Notes |
|---|---|---|---|
| OLED Display | SDA | GPIO 21 | Data Line |
| OLED Display | SCL | GPIO 22 | Clock Line |
| Power | VCC | 3.3V | Logic Voltage |
| Power | GND | GND | Common Ground |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH1106.h>
#include <WiFi.h>
#define OLED_SDA 21
#define OLED_SCL 22
Adafruit_SH1106 display(OLED_SDA, OLED_SCL);
void setup() {
display.begin(SH1106_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
WiFi.begin("SSID", "PASSWORD");
while (WiFi.status() != WL_CONNECTED) { delay(500); }
}
void loop() {
display.clearDisplay();
display.setCursor(0, 0);
display.println("IoT DASHBOARD");
display.drawLine(0, 10, 128, 10, WHITE);
display.setCursor(0, 20);
display.print("WiFi: CONNECTED");
display.setCursor(0, 35);
display.print("Temp: 22.5 C");
display.display();
delay(10000);
}