Skip to content
Free IDE

← Components

SSD1306 OLED display 128×64 (I2C)

A 128 × 64 dot OLED screen whose dots light up on their own (no backlight). It talks to the ESP32 over I2C (only 2 data wires: SCL and SDA). The ssd1306.py driver does NOT come in the firmware: copy the file to the board first. You draw in memory (text, dots, rectangles) and it only shows on the screen with oled.show(). Careful: the pin order changes from maker to maker (VCC and GND swapped).

Pinout

GNDVCCSCLSDAOLED 128×64 · 0x3CGNDVCCSCLSDA
PinConnect toNote
GNDGNDcheck the order printed on YOUR module
VCC3V3on some modules VCC comes before GND
SCLGPIO22 (wiring used in the example)I2C clock
SDAGPIO21 (wiring used in the example)I2C data
FastMindLocal AI assistant

The AI that remembers your life and lives on your computer

  • Long-term memory with the source of every answer
  • Works offline: your data stays on your PC
  • Reads PDFs, slides, photos and meeting recordings
Download free for Windows

Essential plan free forever

MicroPython example

# FIRST: copy ssd1306.py (micropython-lib) to the board — it does not come in the firmware.
from machine import Pin, I2C
import ssd1306
import time

# wiring used here (common on the DevKit): SCL on GPIO22 and SDA on GPIO21
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
print(i2c.scan())  # the OLED answers at 60 (0x3C)

oled = ssd1306.SSD1306_I2C(128, 64, i2c)  # address 0x3C
oled.fill(0)  # clears everything (in memory)
oled.text("Hello, ESP32!", 0, 0)  # the 8x8 font has no accents
oled.rect(0, 16, 128, 48, 1)  # frame
oled.show()  # now it shows on the screen

n = 0
while True:
    oled.fill_rect(8, 32, 112, 8, 0)  # clears only the counter line
    oled.text("counter: %d" % n, 8, 32)
    oled.show()
    n += 1
    time.sleep(1)

Specifications

ItemValueSource
Resolution128 × 64 dotsPyPlaca component catalog
I2C address0x3C (alternative 0x3D)Typical datasheet values
Pin orderGND, VCC, SCL, SDA — varies by maker (variant with VCC and GND swapped)Typical datasheet values
Driverssd1306.py — copy it to the boardTypical datasheet values; micropython-lib: micropython/drivers/display/ssd1306/ssd1306.py
Power supply3.3 V in the simulatorPyPlaca component catalog — Under review: module VCC range (does it accept 5 V?)
Pull-up on SDA/SCLthere are modules with and without the resistors (a property of the part); without a pull-up I2C does not workPyPlaca component catalog — Under review: check on the lab module
Screen colorwhite in the simulatorUnder review: there are blue and yellow + blue modules — which one is in the lab?

Values marked "Under review" will still be checked against the parts in the lab.

FastTeacherFor teachers

From the syllabus to a planned semester

  • Teaching plan and calendar built automatically
  • Class diary ready to paste into SIGA
  • Slides and exercise lists with answer keys
Meet FastTeacher

Free Community edition · Windows

FastMindLocal AI assistant

The AI that remembers your life and lives on your computer

  • Long-term memory with the source of every answer
  • Works offline: your data stays on your PC
  • Reads PDFs, slides, photos and meeting recordings
Download free for Windows

Essential plan free forever

FastTeacherFor teachers

From the syllabus to a planned semester

  • Teaching plan and calendar built automatically
  • Class diary ready to paste into SIGA
  • Slides and exercise lists with answer keys
Meet FastTeacher

Free Community edition · Windows