Skip to content
OLED

0.96" SSD1306 OLED Display (128x64, I2C)

Crisp 128x64 OLED display with individual pixels — draw graphics, not just text, over I2C.

The SSD1306 drives a 0.96-inch monochrome OLED panel at 128x64 pixels over I2C (an SPI variant also exists, but the 4-pin I2C module is what most people reach for first). Unlike character LCDs, every pixel is individually addressable, so you can draw shapes, plot graphs, show custom fonts and icons, and scroll bitmap animations — not just fixed-width text.

Because OLED pixels are individually lit rather than backlit through a filter, contrast is excellent and there's no potentiometer to fiddle with like on character LCDs. The tradeoff is a bit more setup: you need both Adafruit's GFX library (the generic drawing engine) and the SSD1306-specific driver on top of it, and the API is graphics-oriented (draw calls + a buffer you flush to the screen) rather than the simple print() calls a character LCD uses.

Specifications

Display128 × 64 pixels, monochrome OLED
Operating voltage3.3V – 5V (most breakout modules have an onboard regulator)
InterfaceI2C (this module); SPI variants also exist on other boards
I2C address0x3C default on most modules, 0x3D on some — scan to confirm
Viewing technologySelf-emissive OLED — high contrast, no backlight, wide viewing angle
Driver + graphics libraryRequires Adafruit GFX (drawing engine) plus the Adafruit SSD1306 driver on top of it

Pinout

PinNameDescription
1GNDGround
2VCCPower, 3.3V–5V DC depending on the module's onboard regulator
3SCLI2C clock line
4SDAI2C data line

Pin order varies more between SSD1306 modules than most parts — some print GND/VCC/SCL/SDA left to right, others VCC/GND/SCL/SDA. Always check the silkscreen labels on your specific board rather than assuming pin position. Unlike the character-LCD backpacks, most SSD1306 breakouts genuinely work fine at 3.3V, making them an easier fit for ESP32/Pi/STM32 without the 5V-rail workarounds those LCDs need.

Variants

The 128×64 0.96" module is the default choice and what almost every SSD1306 tutorial assumes. If you only need a single line of status text, the 128×32 version is smaller and cheaper with identical code. Watch out for boards labeled 1.3" — many of those actually use the SH1106 controller, which looks like a drop-in replacement but needs a different library despite the shared resolution.

VariantTemp rangeHum rangeAccuracyProtocolPrice
SSD1306 0.96" (128×64)~$2–5
SSD1306 0.91" (128×32)~$2–4
SH1106 1.3" (128×64)~$3–6

Board Integration

Library

Adafruit SSD1306by Adafruit

Arduino IDE → Tools → Manage Libraries → search "Adafruit SSD1306" → Install (accept the prompt to also install "Adafruit GFX Library")

Wiring

Component pinBoard pinNote
VCC5VMost modules accept 5V and regulate down internally; 3.3V also works on most boards.
GNDGND
SDAA4Uno's hardware I2C data pin.
SCLA5Uno's hardware I2C clock pin.

Code

C++

Notes

  • Every draw call (print, drawLine, fillRect, etc.) only writes to an in-memory buffer - nothing appears on the screen until you call display.display().
  • display.clearDisplay() clears the whole buffer; if you only want to update part of the screen without a full redraw/flicker, draw a filled black rectangle over just that region first, as in the uptime example.
  • If display.begin() fails, double-check the I2C address (0x3C vs 0x3D) with a scanner sketch before assuming the module is faulty.