0.96" OLED (SSD1306) with Arduino & ESP32

0.96" OLED (SSD1306) with Arduino & ESP32

Quick answer: Wire SDA and SCL to your board's I2C pins (A4/A5 on an Uno, GPIO21/22 on an ESP32), install the Adafruit SSD1306 library, and address 0x3C. The one limit almost nobody mentions: this display only offers two I2C addresses, so at most two fit on one bus.

Written and fact-checked by Compoden's engineering team, India. Every price, pin and spec below is read from our live catalogue record for the exact part named. Published 19 August 2026 · Last updated 19 August 2026.

The 0.96" SSD1306 is the display half the hobby projects on the internet use, and for good reason: it is cheap, it needs only two signal wires over I2C, and one library call away from showing text or a bitmap. What trips people up is not the wiring, which is genuinely trivial — it is picking the right variant among four near-identical listings, and hitting a hard limit on how many of them can share a bus.

The four SSD1306/SSD1306-family OLEDs in our catalogue — records checked August 2026
Spec 0.96" Yellow/Blue 0.96" White 0.96" SPI/I2C 7-pin 0.91" 128x32
Price (India, COD) Rs.246 Rs.259 Rs.299 Rs.264
Resolution 128x64 128x64 128x64 128x32
Interface I2C only I2C only SPI (factory), reconfigurable to I2C I2C only
I2C address(es) 0x3C / 0x3D (SA0 jumper) 0x3C / 0x3D (SA0 jumper) 0x3C / 0x3D if reconfigured 0x3C / 0x3D (SA0 jumper)
Active current 20mA 20mA Not stated in our record 15mA
Library Adafruit SSD1306 / u8g2 Adafruit SSD1306 Adafruit SSD1306 Adafruit SSD1306
Colour Top rows yellow, bottom rows blue — fixed, not per-pixel Single colour white Monochrome blue Monochrome blue

Verdict in one line: buy the Yellow/Blue for the lowest price and the most common tutorials, the White if you want one uniform colour, the SPI/I2C variant only if you need its faster refresh, and the 0.91" only when the smaller board footprint matters more than the extra 23 rupees it costs over the 0.96".

I2C or SPI — which should you wire up?

I2C, unless you specifically need SPI's speed. All four displays in our catalogue use the SSD1306 driver IC, and three of the four are I2C-only. The fourth ships factory-configured for SPI but can be reconfigured to I2C with its onboard resistor jumpers. I2C needs four wires total (VCC, GND, SDA, SCL) and lets other I2C devices share the same two signal lines. SPI needs seven wires on this exact part (VCC, GND, SCK, MOSI, RES, DC, CS — which is why its listing is literally named "7-pin"), each display needs its own dedicated CS line, and in exchange the record states a maximum SPI clock of 10 MHz against I2C's 400 kHz — meaningfully faster screen updates. For a single status display, I2C's simpler wiring wins easily; SPI earns its extra pins only when you are redrawing the screen often enough that the refresh rate is visible.

Wires needed to connect an SSD1306 OLED: I2C vs SPI An I2C SSD1306 OLED needs four wires total: power, ground, SDA and SCL. The SPI version of the same display needs seven wires: power, ground, clock, data, reset, data/command select and chip select. Wires needed for one SSD1306 OLED — drawn to scale I2C4 wires (VCC, GND, SDA, SCL) SPI7 wires (VCC, GND, SCK, MOSI, RES, DC, CS) Bar widths proportional: 160px = 4 wires, so 40px per wire; 7 wires = 280px. I2C also lets multiple devices share the same two signal wires; SPI needs a separate CS pin each.
The "7-pin" name in our SPI listing is literal — count VCC, GND, SCK, MOSI, RES, DC and CS and you get seven, against I2C's four. Figures read from each part's own catalogue record.

How do you wire an SSD1306 OLED to an Arduino Uno?

Four wires, and they go to fixed pins because I2C is hardware, not software-selectable, on an Uno: VCC to 5V (the OLED's own record accepts 3.3-5V, and the Uno only offers 5V on its main rail), GND to GND, SDA to A4, and SCL to A5. Those are the same two pins our Arduino Uno pinout reference already flags as unavailable for anything else once I2C is running — so if your project also uses an I2C sensor, the display shares those same two wires rather than needing its own pair.

How do you wire it to an ESP32 instead?

Also four wires, but different pins and — unlike the Uno — reassignable ones: VCC to 3.3V, GND to GND, SDA to GPIO21, SCL to GPIO22, which are the ESP32's default I2C pins in our board record. The ESP32 can, unlike the ATmega328P, remap I2C to other GPIOs in software if 21/22 are already claimed by something else — but there is no reason to bother unless you are out of options, since 21/22 are free by default on a bare board.

Why can you only put two of these on one I2C bus?

Because the SSD1306 has exactly one address pin. Every one of our four listings states the same pair: 0x3C is the default, and a solder jumper labelled SA0 switches a unit to 0x3D as the only alternative. I2C addressing means every device on a bus needs a unique address, and with only two available to this chip, two displays is the hard ceiling — a third will collide with one of the first two no matter which jumper you set. If a project genuinely needs three or more small screens, the fix is not a third address; it is either an I2C multiplexer chip, or switching one or more of the extra displays to the SPI variant on its own dedicated CS pin.

What code talks to an SSD1306 over I2C?

The Adafruit SSD1306 library, which every one of our four records names, paired with Adafruit's GFX library for text and shapes. The sketch below was written for this guide and has not been compiled by us; it uses only the standard, documented calls from that library, so treat it as a wiring-correct starting point to build on rather than a pasted final program.

// SSD1306 128x64 I2C OLED - shows text on boot.
// Library: Adafruit_SSD1306 + Adafruit_GFX (install both via Library Manager).
// Wiring (Uno): SDA->A4, SCL->A5, VCC->5V, GND->GND.

#include 
#include 
#include 

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_ADDR    0x3C

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
  Serial.begin(9600);
  if (!display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR)) {
    Serial.println("SSD1306 not found - check wiring and address (0x3C/0x3D)");
    while (true);
  }
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 24);
  display.println("Compoden");
  display.display();
}

void loop() {
  // Screen is static after setup(); redraw here for live data.
}

Why does my OLED stay blank, or print "SSD1306 not found"?

Almost always one of three things. First, the address: try 0x3D if 0x3C fails, since the SA0 jumper can ship set either way from the factory. Second, the wiring: SDA and SCL are easy to swap by mistake, and on an Uno they are the same A4/A5 pins used for analog input, so double-check nothing else is wired there. Third, our record for the Yellow/Blue and SPI variants both flag the ribbon cable connecting the glass panel to its driver board as fragile — a display that worked once and now shows nothing, especially after being handled, is worth checking for a cracked or partially detached ribbon before you suspect the code.

Which variant should you actually buy?

For a first build or any tutorial you are following, the 0.96" Yellow/Blue OLED (Rs.246) — cheapest, and what most guides assume you have. If the dual-colour split bothers you or clashes with your project's look, the 0.96" White OLED (Rs.259) is the same panel in one colour. Need faster redraws for an animation or a fast-changing graph, or plan to run three or more small displays on separate SPI chip-select pins? The 0.96" SPI/I2C 7-pin OLED (Rs.299). Building something small enough that a shorter, narrower board matters more than screen height, such as a wearable? The 0.91" 128x32 OLED (Rs.264) — note it costs slightly more than the larger 0.96" despite fewer pixels, so buy it for the smaller footprint, not to save money. All four available cash on delivery across India.

What should you read next?

Wiring this to a bus that already has other devices? Our What Is I2C? guide covers addressing and common wiring mistakes in more depth, and the ESP32 pinout guide is worth checking before you claim GPIO21/22 for something else.

Not sure which display fits your build? Open Soldr, describe what you want shown and on which board, and it will pick the variant and generate the wiring.

Frequently asked questions

SSD1306 OLED ko Arduino se kaise jodein?

Chaar taar: VCC ko 5V par, GND ko GND par, SDA ko A4 par, aur SCL ko A5 par (Arduino Uno par). Fir Adafruit SSD1306 aur Adafruit GFX library install karein, aur code mein address 0x3C daalein - agar screen kuch nahi dikhaye toh 0x3D try karein, kyunki kuch units factory se isi address par set hoti hain.

Do I need a library for the SSD1306 OLED?

Yes, practically speaking. All four of our SSD1306 listings name the Adafruit SSD1306 library (one also supports u8g2 as an alternative), paired with Adafruit's GFX library for text and shapes. Writing your own SSD1306 driver from scratch is possible but not worthwhile when a well-tested library handles the initialisation sequence and framebuffer for you.

How many I2C OLED displays can I connect to one Arduino or ESP32?

Two, and that is a hard limit on this exact chip, not a software restriction. Every SSD1306 in our catalogue offers only two I2C addresses, 0x3C and 0x3D, selected by a solder jumper labelled SA0. A third display has no free address to take. To run more than two small screens, either add an I2C multiplexer chip, or use our SPI/I2C 7-pin variant on its own dedicated chip-select pin instead of sharing the I2C bus.

Why does my OLED show "SSD1306 not found" or stay blank?

Check the address first — try 0x3D if 0x3C fails, since the SA0 jumper can ship either way. Then check SDA/SCL are not swapped, especially on an Uno where they double as the A4/A5 analog pins. Our own record for two of these displays also flags the glass panel's ribbon cable as fragile — a previously-working display that goes blank after handling is worth inspecting for a cracked ribbon before you suspect the code.

What is the price of a 0.96 inch OLED display in India?

At Compoden, the 0.96" Yellow/Blue SSD1306 is Rs.246, the 0.96" White is Rs.259, the 0.96" SPI/I2C 7-pin variant is Rs.299, and the smaller 0.91" 128x32 is Rs.264. All available with cash on delivery across India. Prices checked August 2026.

Back to blog

Open this project in the Soldr app → What is Soldr.ai → parts, wiring and code for what this guide builds