Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

SSD1306 vs SH1106 — why your 1.3-inch OLED shows garbage

SSD1306 and SH1106 OLED controllers compared — sizes, RAM width, libraries for Arduino and MicroPython, and how to tell which one your OLED module has.

Community draft — report a mistake

SSD1306SH1106
Typical module0.96" 128×64 (also 0.91" 128×32)1.3" 128×64
Controller RAM128 × 64132 × 64 — the panel sits 2 columns in
Horizontal addressing modeYesNo (page mode only)
Arduino librariesAdafruit SSD1306, U8g2Adafruit SH110X, U8g2
MicroPython driverssd1306.pysh1106.py (community driver)
I2C address0x3C (0x3D on some)0x3C (0x3D on some)
Typical price in India₹150–250₹250–400

The two controllers are close cousins, which is exactly why they cause trouble: a 1.3” OLED is often listed as “SSD1306” but has an SH1106 inside. Point the wrong library at it and you get a shifted image, a strip of random pixels on one edge, or nothing at all. Details come from the Solomon Systech and Sino Wealth datasheets; prices are indicative.

The technical difference

  • The SH1106 has a 132-pixel-wide memory for a 128-pixel panel, so everything must be drawn 2 columns in.
  • The SSD1306 can take a whole screen in one continuous stream (horizontal addressing). The SH1106 can’t — it needs one command per 8-pixel-tall “page”.

Libraries handle both — as long as you pick the right one.

How to tell which you have

  1. Size is the best clue. 0.96” and 0.91” modules are almost always SSD1306. 1.3” modules are usually SH1106.
  2. Try the SSD1306 sketch. A clean picture = SSD1306. Noise down one side or a shifted image = SH1106.
  3. Some sellers print the controller on the listing or the back of the board — trust a photo of the board over the title.

Both use the same 4 pins (VCC, GND, SCL, SDA), the same I2C address and the same 3.3–5 V supply, so wiring doesn’t change.

Code changes

Arduino, SSD1306 — the ESP32 guide:

Adafruit_SSD1306 display(128, 64, &Wire, -1);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

Arduino, SH1106 — install Adafruit SH110X:

Adafruit_SH1106G display(128, 64, &Wire, -1);
display.begin(0x3C, true);

Drawing calls (print, drawLine, display()) are the same Adafruit GFX functions, with SH110X_WHITE instead of SSD1306_WHITE.

U8g2 supports both: pick an SSD1306_128X64 or SH1106_128X64 constructor.

MicroPython: the Pico W guide uses ssd1306.py (Pico W OLED guide); for SH1106 use an sh1106.py driver with a similar API.

Verdict

  • 0.96” SSD1306: cheapest, best supported, the one in all our guides. Buy this unless you need bigger text.
  • 1.3” SH1106: noticeably easier to read from a distance; worth ₹100 more — just use the SH1106 library.

Seeing “SSD1306 allocation failed” instead? That’s a memory problem, not the controller — see the fix. For other display types, see best displays under ₹300.

↑↓ to move · Enter to open