OLED display 0.96″ (SSD1306)
128×64 pixels, I2C
A small monochrome display with excellent contrast. Write text, draw graphs, show sensor values. Only 4 wires.
Open the course →How it works
It communicates over I2C — two lines: SDA (data) and SCL (clock). The ESP32 is the "master" and sends what to draw to address 0x3C. The Adafruit_SSD1306 library keeps a copy of the screen in memory (1 kB); you draw into it with print(), drawLine()… and finally call display() to show it.
Pins and wiring
| Pin | What it is | Where it connects / why |
|---|---|---|
| GND | Ground | → GND. WARNING: on some modules the order is VCC-GND-SCL-SDA — read the label on the board! |
| VCC | Power | → 3V3 (the module has a regulator, tolerates 5 V too). |
| SCL (SCK) | I2C clock | → GPIO 22 (default SCL on the ESP32). |
| SDA | I2C data | → GPIO 21 (default SDA on the ESP32). |
Specifications
Resolution128 × 64
Diagonal0.96″ (24 mm)
InterfaceI2C, address 0x3C (rarely 0x3D)
Power3.3 – 5 V, ~20 mA
Colourwhite, blue or yellow-blue
LibrariesAdafruit SSD1306 + Adafruit GFX
Tips and typical mistakes
- Nothing shows? 1) check the address with an I2C scanner, 2) did you call display(), 3) SDA/SCL swapped.
- OLED pixels age — do not leave the same static text for days without change.
- I2C allows several devices on the same two wires — OLED + sensor together, no problem.