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 Arduino Nano ESP32 — I2C on A4/A5

Show text on an SSD1306 OLED from an Arduino Nano ESP32 using the Nano’s usual I2C pins, A4 (SDA) and A5 (SCL), powered from 3V3.

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

Community draft — report a mistake

On the Nano ESP32 a 0.96″ OLED goes exactly where it would on a classic Nano: SDA to A4, SCL to A5. The only change is power — use 3V3.

The sketch shows uptime and free heap every second.

Wiring

Arduino Nano ESP32Only the pins used are shown · 3.3 V logicSSD1306 OLED 0.96″ (128×64, I2C)3V3A4A5GNDGNDVCCSCLSDA
Every connection
Arduino Nano ESP32SSD1306 OLED 0.96″ (128×64, I2C)WireNotes
GNDGNDblack
3V3VCCred
A5SCLyellow
A4SDAblue

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

  • I2C stays on A4/A5 like on every Nano, so Wire.begin() needs no pins. Inside, A4/A5 are the S3’s GPIO11/12.
  • Power the OLED from 3V3: its pull-ups then sit at 3.3 V. Most OLED boards also accept 5 V on VCC, but there is no 5V pin on this Nano — VBUS is only live on USB.
  • A4 and A5 are ADC2 pins, so you can’t use them for analog with Wi-Fi on anyway — I2C is a good use for them.

Code

ssd1306-nanoesp32.inoArduino C++Open in PlaygroundOpen in Playground
// SSD1306 128x64 I2C OLED on an Arduino Nano ESP32.
// GND → GND, VCC → 3V3, SDA → A4, SCL → A5 — the same pins as on a classic Nano.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(128, 64, &Wire, -1);

void setup() {
  Serial.begin(115200);
  uint32_t t0 = millis();
  while (!Serial && millis() - t0 < 3000) {}
  Wire.begin();  // SDA = A4, SCL = A5 on the Nano ESP32
  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() {
  display.clearDisplay();
  display.setTextSize(2);
  display.setCursor(0, 0);
  display.print("Nano ESP32");
  display.setTextSize(1);
  display.setCursor(0, 28);
  display.printf("Uptime: %lu s", millis() / 1000);
  display.setCursor(0, 44);
  display.printf("Free heap: %u KB", ESP.getFreeHeap() / 1024);
  display.display();
  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

Common errors

“SSD1306 not found at 0x3C”

Try 0x3D; check A4/A5. Full fix.

Sketch uploads but the board doesn’t start

Something holds B1 (GPIO0) low at power-up. Keep B0/B1 free.

↑↓ to move · Enter to open