SSD1306 0.96" OLED practical reference
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.
Key specifications
- Display: 128 × 64 pixels, monochrome OLED
- Operating voltage: 3.3V – 5V (most breakout modules have an onboard regulator)
- Interface: I2C (this module); SPI variants also exist on other boards
- I2C address: 0x3C default on most modules, 0x3D on some — scan to confirm
- Viewing technology: Self-emissive OLED — high contrast, no backlight, wide viewing angle
- Driver + graphics library: Requires Adafruit GFX (drawing engine) plus the Adafruit SSD1306 driver on top of it
Pinout and connection notes
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.
- GND: Ground
- VCC: Power, 3.3V–5V DC depending on the module's onboard regulator
- SCL: I2C clock line
- SDA: I2C data line
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
SSD1306 0.96" OLED at a glance
Specifications
- Controller
- SSD1306 monochrome OLED controller
- Common panel
- 0.96-inch, 128 × 64 pixels; confirm the actual panel resolution
- Interface
- This four-pin reference is for I2C modules; SPI versions have different pins
- I2C address
- Often 0x3C; some modules use 0x3D. Scan the bus to confirm
- Supply
- Depends on breakout regulator and pull-up design; check the board before applying 5 V
- Display behavior
- Self-emissive pixels, no backlight; static bright content can cause uneven ageing
- Software
- Use a driver matching the controller, panel dimensions and selected interface
Pinout
| Pin | Name | Description |
|---|---|---|
| GND | Ground | Ground reference; verify the printed pin label. |
| VCC | Module supply | Use the voltage supported by this exact breakout. Do not infer 5 V tolerance from the OLED panel alone. |
| SCL | I2C clock | I2C clock line; pull-up voltage must be safe for the controller. |
| SDA | I2C data | I2C data line; pull-up voltage must be safe for the controller. |
Wiring & code
Board integration
Library
Adafruit SSD1306 by Adafruit
Arduino IDE → Tools → Manage Libraries → search "Adafruit SSD1306" → Install (accept the prompt to also install "Adafruit GFX Library")
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| VCC | 5V | Most modules accept 5V and regulate down internally; 3.3V also works on most boards. |
| GND | GND | |
| SDA | A4 | Uno's hardware I2C data pin. |
| SCL | A5 | Uno's hardware I2C clock pin. |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
Serial.begin(9600);
// 0x3C is the most common address — 0x3D shows up on some modules
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 not found — check wiring and I2C address"));
while (1) delay(10);
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println(F("Hello, SolderHub"));
display.println(F("128x64 OLED"));
display.display();
}
void loop() {
static unsigned long lastUpdate = 0;
static int counter = 0;
if (millis() - lastUpdate > 1000) {
lastUpdate = millis();
display.fillRect(0, 20, SCREEN_WIDTH, 10, SSD1306_BLACK); // clear just this line
display.setCursor(0, 20);
display.print(F("Uptime: "));
display.print(counter++);
display.print(F("s"));
display.display(); // nothing shows up until display() is called — it flushes the buffer
}
}- The address is almost always 0x3C on 128x64 modules — 0x3D shows up on some 128x32 or oddball boards, so change the value in display.begin() if yours doesn't initialize.
- Nothing appears on screen until display.display() is called — every draw call (println, fillRect, etc.) only touches an internal buffer first.
- Redrawing the whole screen every frame causes visible flicker; the partial-clear-and-redraw approach here (fillRect just the changed line) keeps the rest of the screen stable.
