Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

SSD1306 OLED with ESP32-S3-DevKitC-1 — I2C wiring and code

Connect a 128×64 SSD1306 OLED to an ESP32-S3-DevKitC-1 on GPIO8 (SDA) and GPIO9 (SCL) at 3.3 V and show uptime and free heap.

Arduino C++Verified — core esp32 3.3.12, Adafruit SSD1306 2.5.17, 3 Nov 2026Compile-only

Community draft — report a mistake

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-1Only the pins used are shown · 3.3 V logicSSD1306 OLED 0.96″ (128×64, I2C)3V38 · 89 · 9GNDGNDVCCSCLSDA
Every connection
ESP32-S3-DevKitC-1SSD1306 OLED 0.96″ (128×64, I2C)WireNotes
GNDGNDblack
3V3VCCred
9SCLyellow
8SDAblue

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 Wire pins 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-esp32s3.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// 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

Serial Monitor · 115200Output
OLED 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.

↑↓ to move · Enter to open