The ESP32-S3 has enough RAM and speed to make a small OLED dashboard trivial. Its default I2C pins, GPIO8 (SDA) and GPIO9 (SCL), are free for general use on this board.
The sketch prints the board name, uptime and free heap every second — a handy health monitor for any S3 project.
Wiring
| ESP32-S3-DevKitC-1 | SSD1306 OLED 0.96″ (128×64, I2C) | Wire | Notes |
|---|---|---|---|
| GND | GND | black | |
| 3V3 | VCC | red | |
| 9 | SCL | yellow | |
| 8 | SDA | blue |
3.3–5 V (on-board regulator) part, 3.3 V board. Most modules have a regulator and run from 3.3 V or 5 V. Their I2C pull-ups go to VCC, so on ESP32 and Pico power the OLED from 3.3 V to keep SDA/SCL at a safe level.
Board quirks
- On the S3, GPIO8/GPIO9 are the core’s default
Wirepins and neither is a strapping pin — unlike on the C3. - Every S3 GPIO can be routed to I2C, so
Wire.begin(sda, scl)works with other pins if 8 and 9 are taken. - Check the GND/VCC order on your OLED before wiring; some clones swap them.
Code
// SSD1306 128×64 I2C OLED on an ESP32-S3-DevKitC-1.
// GND → GND, VCC → 3V3, SDA → GPIO8, SCL → GPIO9 (the S3 core's default Wire pins). Address 0x3C.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void setup() {
Serial.begin(115200);
Wire.begin(8, 9); // SDA, SCL
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("SSD1306 not found at 0x3C — try 0x3D, and check the GND/VCC order on your module");
while (true) delay(1000);
}
display.setTextColor(SSD1306_WHITE);
Serial.println("OLED ready");
}
void loop() {
static uint32_t count = 0;
display.clearDisplay();
display.setTextSize(2);
display.setCursor(4, 0);
display.print("ESP32-S3");
display.setTextSize(1);
display.setCursor(4, 28);
display.printf("Uptime: %lu s", millis() / 1000);
display.setCursor(4, 44);
display.printf("Free heap: %u KB", ESP.getFreeHeap() / 1024);
display.display();
Serial.printf("Frame %lu\n", count++);
delay(1000);
}// SSD1306 128×64 I2C OLED on an ESP32-S3-DevKitC-1.
// GND → GND, VCC → 3V3, SDA → GPIO8, SCL → GPIO9 (the S3 core's default Wire pins). Address 0x3C.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void setup() {
Serial.begin(115200);
Wire.begin(8, 9); // SDA, SCL
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("SSD1306 not found at 0x3C — try 0x3D, and check the GND/VCC order on your module");
while (true) delay(1000);
}
display.setTextColor(SSD1306_WHITE);
Serial.println("OLED ready");
}
void loop() {
static uint32_t count = 0;
display.clearDisplay();
display.setTextSize(2);
display.setCursor(4, 0);
display.print("ESP32-S3");
display.setTextSize(1);
display.setCursor(4, 28);
display.printf("Uptime: %lu s", millis() / 1000);
display.setCursor(4, 44);
display.printf("Free heap: %u KB", ESP.getFreeHeap() / 1024);
display.display();
Serial.printf("Frame %lu\n", count++);
delay(1000);
}Library: Adafruit SSD1306 (Adafruit (also install Adafruit GFX Library)) — compiled with Adafruit SSD1306 2.5.17.
Expected serial output
OLED ready
Frame 0
Frame 1
Frame 2OLED ready Frame 0 Frame 1 Frame 2
Common errors
“SSD1306 not found at 0x3C”
Try 0x3D, check SDA on GPIO8 and SCL on GPIO9, then run the I2C scanner.
“SSD1306 allocation failed”
Rare on the S3, which has plenty of RAM — usually a wrong display size. Full fix.