How-to · Beginner · 3 min read
SSD1306 OLED Display
0.96 inch I2C Wiring and Code
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
The SSD1306 is the driver chip in most small monochrome OLED displays, such as the popular 0.96 inch 128x64 module. It connects over I2C (address 0x3C) or SPI, runs from 3.3 to 5 V on most modules, and needs no backlight, so it is crisp and low-power. Use the Adafruit SSD1306 or U8g2 library to draw text and graphics.
Key specs at a glance
- Sizes
- 0.91 inch 128x32, 0.96 inch 128x64; 1.3 inch modules often use SH1106
- Interface
- I2C (4 pins) or SPI (6 to 7 pins)
- I2C address
- 0x3C (some 0x3D)
- Supply
- 3.3 to 5 V on most modules
- Current
- About 10 to 25 mA depending on lit pixels
- Frame buffer
- 1 KB RAM for 128x64 (half of an Uno's RAM)
Wiring an SSD1306 OLED (I2C)
Check the pin order printed on your module: some read GND-VCC-SCL-SDA, others VCC-GND-SCL-SDA.
| OLED pin | Arduino Uno | ESP32 | Pico |
|---|---|---|---|
| GND | GND | GND | GND |
| VCC | 5V or 3.3V | 3.3V | 3V3 |
| SCL | A5 | GPIO 22 | GP5 |
| SDA | A4 | GPIO 21 | GP4 |
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- Pico:
- GND
- VCC
- Arduino Uno:
- 5V or 3.3V
- ESP32:
- 3.3V
- Pico:
- 3V3
- SCL
- Arduino Uno:
- A5
- ESP32:
- GPIO 22
- Pico:
- GP5
- SDA
- Arduino Uno:
- A4
- ESP32:
- GPIO 21
- Pico:
- GP4
Draw text with the Adafruit SSD1306 library
Install Adafruit SSD1306 and Adafruit GFX Library from the Library Manager.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1); // -1 = no reset pin
void setup() {
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
for (;;); // not found
}
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("Hello!");
display.setTextSize(1);
display.println("Temp: 24.6 C");
display.display(); // push buffer to screen
}
void loop() {}MicroPython on ESP32 or Pico
MicroPython includes an ssd1306 driver in many builds (or install it with mip). Create an I2C object, then oled = ssd1306.SSD1306_I2C(128, 64, i2c), call oled.text("Hello", 0, 0) and oled.show().
SSD1306 vs SH1106: why your 1.3 inch screen looks shifted
Many 1.3 inch OLEDs look identical but use the SH1106 driver, which has a 132-column memory. With the SSD1306 library they show a 2-pixel offset, noise along one edge, or nothing. Use the Adafruit SH110X library or U8g2's SH1106 constructor instead.
Memory, speed and burn-in tips
- The 128x64 buffer takes 1 KB, half an Arduino Uno's RAM. If your sketch crashes, use U8g2 in page mode, or an ESP32/Pico.
- Call
display.display()only after you finish drawing a frame. - Raise I2C speed to 400 kHz with
Wire.setClock(400000)for smoother animation. - OLED pixels age when lit for months. Dim the display, blank it when idle, or shift static content occasionally.
Try it: Display memory and refresh rate calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Using the SSD1306 library on an SH1106 1.3 inch module.
- Running out of RAM on an Uno with a 128x64 buffer plus other libraries.
- Forgetting display.display(), so nothing appears.
- Assuming the pin order; GND and VCC swap between suppliers.
- Leaving a static screen on 24/7, which causes visible burn-in.
Frequently asked questions
What is the I2C address of an SSD1306 OLED?
0x3C on almost all 128x64 and 128x32 modules. Some have a jumper on the back for 0x3D. Run an I2C scanner if unsure.
Does an SSD1306 OLED work with 5 V Arduino boards?
Most modules include a regulator and accept 3.3 to 5 V on VCC, and work with Uno I2C pins. Check your module's listing; bare panels are 3.3 V only.
SSD1306 or 16x2 LCD: which should I use?
The OLED shows graphics, has deep blacks, wide viewing angles and draws little power. The 16x2 LCD has bigger text that is easier to read across a room and in sunlight.
Can I use two SSD1306 displays together?
Yes, if one is set to 0x3D, or by using two I2C buses (ESP32 and Pico have two) or a TCA9548A multiplexer.
Why does my OLED show random dots?
Usually a wrong driver (SH1106 vs SSD1306), a missing clearDisplay() call, or a wrong height setting (128x32 vs 128x64).
Parts for this guide
- ₹49View
Terms in this guide
Projects that use it
Put this into practice: 171 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- SSD1306 128x64 dot-matrix OLED controller datasheet (Solomon Systech)
- SH1106 datasheet (Sino Wealth)
- Adafruit SSD1306 library documentation
- U8g2 library reference
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

