> Source: https://www.tinkered.ai/components/oled-sh1107-128x128/arduino-uno (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/oled-sh1107-128x128/arduino-uno. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# SH1107 OLED 128×128 with an Arduino Uno

A full 128x128 monochrome frame is exactly 2,048 bytes, the whole of the Arduino Uno's SRAM, so on the Uno the SH1107 has to be drawn with U8g2's page-buffer constructor (_1_), one strip of the screen at a time. Electrically it is simple: VCC on the Uno's 5V through the module's regulator, and I2C on A4 and A5.

## Wiring

| SH1107 OLED 128×128 | Arduino Uno | Note |
| --- | --- | --- |
| VCC | 5V |  |
| GND | GND |  |
| SCL | SCL |  |
| SDA | SDA |  |

## What to know on the Arduino Uno

- 128 × 128 pixels at one bit each is 2,048 bytes, the Uno's entire SRAM. U8g2's _F_ full-buffer constructor therefore cannot work on the Uno, and Adafruit_SH110X, which also keeps a full frame, fails the same way. (Arduino UNO R3 tech specs)
- In page mode the do/while body between firstPage() and nextPage() runs once for each 8-pixel-tall strip, 16 times per frame. Anything the loop computes, such as a sensor reading, belongs before firstPage(), not inside it. (U8g2 library reference, page buffer mode)
- U8g2 takes the address in 8-bit form, so the sketch writes setI2CAddress(0x3C * 2). On the Uno's single bus no other 0x3C device, such as an SSD1306 OLED, can sit beside it. (Sino Wealth SH1107 datasheet V2.1, p. 15)
- The module regulates its supply for the controller's 1.65 V to 3.5 V logic, which is what lets VCC take the Uno's 5V. (Sino Wealth SH1107 datasheet V2.1, p. 1)

## Code

Libraries: olikraus/U8g2

```cpp
// SH1107 OLED 128×128 on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/oled-sh1107-128x128/arduino-uno
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>

// SH1107 128x128, PAGE-BUFFER mode ("_1_", a 128 B page buffer) so it fits an Uno.
U8G2_SH1107_128X128_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);

void setup() {
  Serial.begin(9600);
  u8g2.setI2CAddress(0x3C * 2);   // 8-bit address (0x3C << 1)
  u8g2.begin();
  Serial.println(F("SH1107 U8g2 ready"));
}

void loop() {
  u8g2.firstPage();
  do {
    u8g2.drawFrame(0, 0, 128, 128);           // border
    u8g2.setFont(u8g2_font_ncenB10_tr);
    u8g2.drawStr(14, 26, "SH1107");
    u8g2.setFont(u8g2_font_6x12_tr);
    u8g2.drawStr(12, 52, "128x128 OLED");
    u8g2.drawStr(12, 70, "I2C @ 0x3C");
    u8g2.drawDisc(64, 100, 18);               // filled circle
  } while (u8g2.nextPage());
  delay(1000);
}
```

Compiled for arduino:avr:uno on 2026-10-30.

## Questions

### Why does my SH1107 128x128 OLED sketch not fit on an Arduino Uno?

A full frame buffer is 2,048 bytes, all of the Uno's SRAM. Use a U8g2 _1_ (page buffer) constructor such as U8G2_SH1107_128X128_1_HW_I2C, as the example does.

### Can I use Adafruit_SH110X with a 128x128 OLED on an Uno?

No. It holds the whole frame in RAM, which the Uno cannot spare. U8g2 in page mode is the way to drive it on an Uno.

### Which Uno pins does the SH1107 OLED use?

SDA on A4 and SCL on A5, with VCC on 5V and GND to GND; the address is 0x3C.

## More

- [SH1107 OLED 128×128 reference](https://www.tinkered.ai/components/oled-sh1107-128x128.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the SH1107 OLED 128×128 on the Arduino Uno in the browser, with this wiring and code, free: https://www.tinkered.ai/components/oled-sh1107-128x128/arduino-uno
