meta data for this page
This is an old revision of the document!
SSH1106/SSD1306 OLED Display with I²C communication
The SSD1306 and SH1106 (often misspelled as SSH1106 or SSH1306) are both popular single-chip CMOS OLED drivers used for small monochrome displays (0.91“, 0.96”, 1.3“). While they are very similar and often share the same I²C address (0x3C), they are not directly compatible because of differences in memory mapping and supported operating modes.
The key difference is that the SH1106 has more internal RAM (132×64) compared to the SSD1306 (128×64). As a result, a 128×64 display using an SH1106 chip may display garbage pixels or appear shifted by 2 pixels on each side when controlled with a standard SSD1306 library.
- SSD1306: Works with standard libraries like Adafruit_SSD1306
- SH1106: Requires specific libraries, such as Adafruit_SH110x or U8g2 (using U8G2_SH1106_128X64_NONAME…)
| Feature | SSD1306 | SH1106 (SSH1106) |
|---|---|---|
| Max Resolution | 128 x 64 | 132 x 64 |
| Internal RAM | 128 x 64 bits | 132 x 64 bits |
| Addressing | Page, Horizontal, Vertical | Mostly Page Mode only |
| Hardware Scroll | Yes | No |
| Typical Use | 0.96” OLED | 1.3“ OLED |
| Driver Library | Adafruit_SSD1306 | U8g2 / Adafruit_SH110x |
Both are commonly used with Arduino, Raspberry Pi, and ESP8266/ESP32 via I²C (SDA/SCL) or SPI, typically requiring only 4 pins (VCC, GND, SDA, SCL). If an SH1106 display is initialized with an SSD1306 library, the screen will likely show “garbage” or shifted lines.
Pinout
| Pin Label | Function | Description |
|---|---|---|
| GND | Ground | Ground (0V) |
| VCC | Power | 3.3V or 5V (Most modules have a voltage regulator) |
| SCL | Clock | I²C Clock (D0 pin) |
| SDA | Data | I²C Data (D1 pin) |
- Note on Ordering: On some cheap modules, VCC and GND are swapped. Verify your module label before powering it up to avoid damage.
- I²C Address: Usually 0x3C or 0x3D.
Features of particular types
SSH1106 Arduino
- Installing the olikraus/u8g2 library (installation only works manually) from here: https://github.com/olikraus/u8g2
- Example program:
#include <Arduino.h> #include <U8g2lib.h> #include <Wire.h> // Constructor for SH1106 128x64 I2C (Hardware I2C) // U8G2_R0: No rotation. U8X8_PIN_NONE: No hardware reset pin. U8G2_SH1106_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); void setup(void) { u8g2.begin(); } void loop(void) { u8g2.firstPage(); do { u8g2.setFont(u8g2_font_ncenB14_tr); // Set font u8g2.drawStr(0, 24, "Hello World!"); // Draw text } while ( u8g2.nextPage() ); }
I²C topics on lamaPLC
This page has been accessed for: Today: 3, Until now: 20





