> For the complete documentation index, see [llms.txt](https://wiki.openelab.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.openelab.io/aiot/openelab/1.3-inch-oled-i2c-128-x-64-pixel-display.md). Agents can also search and read this documentation through its [MCP server](https://wiki.openelab.io/~gitbook/mcp).

# 1.3 inch OLED I2C 128 x 64 Pixel Display

### 1.3 inch OLED I2C 128 x 64 Pixel Display

***

### Product Link

{% embed url="<https://openelab.io/products/13incholedi2c?variant=43509790638278>" %}

### Introduction

The AZDelivery 1.3 inch OLED Display is very compact with a screen diagonal of 3.7 cm and due to the high contrast, characters and writing are very legible. The Display consists of 128x64 white OLED pixels which are individually controlled By the built-in SH1106 chip.

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2FpNtEaOZ9OEG4pJ5MA5iu%2Fimage.png?alt=media&amp;token=802c8ef4-8fe0-42a4-a3e4-97a1d8f782bb" alt=""><figcaption></figcaption></figure>

It is perfect for easy use with microcontrollers like ATmega, STM32, 8051, AVR, PIC, DSP, ARM, MSP430, PLC, TTL-Logic, etc.. For use with a board we recommend the U8glib library which also contains some example sketches.

### Features

* Supports up to 132 X 64 dot panels&#x20;
* Embedded 132 X 64-bit SRAM&#x20;
* Operating Voltage:&#x20;
  * Logic Voltage Supply: VDD1 = 1.65V - 3.5V&#x20;
* DC-DC voltage supply: VDD2 = 3.0V - 4.2V&#x20;
* OLED operating voltage supply:&#x20;
  * External VPP supply = 6.4V - 13.0V&#x20;
  * Internal VPP generator = 6.4V - 9.0V&#x20;
  * Maximum segment output current: 200μA&#x20;
  * Maximum common absorption current: 27mA&#x20;
* 400KHz fast I2 C bus interface&#x20;
* Programmable frame rate and multiplexing
* Row remapping and column remapping (ADC)&#x20;
* Vertical scrolling " on-chip oscillator&#x20;
* Programmable internal charge pump circuit output&#x20;
* 256 levels of contrast control on monochrome passive OLEDs&#x20;
* Wide operating temperature range: -40 to +85°C&#x20;
* Available in COG form, thickness: 300μm

### Pinout

1、 SDA: Bidirectional data line.&#x20;

2、SCL: Clock signal line.&#x20;

3、GND: Power negative.&#x20;

4、VCC: Positive 3.3V-5V.

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2F2vmBOVWXIpm7VyANFIhs%2Fimage.png?alt=media&amp;token=125585b7-5ca5-4fcc-9012-e82f040e5680" alt=""><figcaption></figcaption></figure>

### Specification <a href="#specification" id="specification"></a>

| Dimensions              | 36 x 34 x 3mm     |
| ----------------------- | ----------------- |
| Point matrix            | 128 x 64          |
| Pixel size              | 0.21 mm × 0.21 mm |
| Pixel distance          | 0.23 mm × 0.23 mm |
| Pixel colour            | White             |
| Display mode            | Passive matrix    |
| Communication interface | I2C               |
| Low energy consumption  | <11ma             |
| Supply voltage          | 3.3V to 5V        |
| Operating temperature   | -20 to 70 ℃       |

### Dimensions

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2Fj2MS11WfObSC7k3w1SYI%2Fimage.png?alt=media&amp;token=3151c898-ed22-46ff-b5a1-121e35e65a17" alt=""><figcaption></figcaption></figure>

### How to Use

Because the OLED display uses I2C communication protocol, wiring is very simple. You just need to connect to the Arduino Uno I2C pins as shown in the table below.

| **Pin** | **Wiring to Arduino Uno** |
| ------- | ------------------------- |
| Vin     | 5V                        |
| GND     | GND                       |
| SCL     | A5                        |
| SDA     | A4                        |

If you’re using a different Arduino board, make sure you check the correct I2C pins:

* Nano: SDA (A4); SCL (A5)
* MEGA: SDA (20); SCL (21)
* Leonardo: SDA (20); SCL (21)

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2FooouAGagOG7iLQjZUwr6%2Fimage.png?alt=media&amp;token=bf8efdf6-009f-4b77-8898-898aaa7410c7" alt=""><figcaption></figcaption></figure>

#### Libraries

To control the OLED display you need the [adafruit\_SSD1306.h](https://github.com/adafruit/Adafruit_SSD1306) and the [adafruit\_GFX.h](https://github.com/adafruit/Adafruit-GFX-Library) libraries. Follow the next instructions to install those libraries.

1\. Open your Arduino IDE and go to **Sketch** > **Include Library** > **Manage Libraries**. The Library Manager should open.

2\. Type “**SSD1306**” in the search box and install the SSD1306 library from Adafruit.

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2F9Aou5XEssgjvlhF42XHw%2Fimage.png?alt=media&amp;token=8423709c-4664-4973-9af4-1ebce14702c0" alt=""><figcaption></figcaption></figure>

3\. After installing the SSD1306 library from Adafruit, type “**GFX**” in the search box and install the library.

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2Fd6j5vTOWimp69h2XPzqc%2Fimage.png?alt=media&amp;token=328a639f-bed6-462c-aa8e-268db4ce6e4d" alt=""><figcaption></figcaption></figure>

4\. After installing the libraries, restart your Arduino IDE.

#### Tips for writing text using these libraries

Here’s some functions that will help you handle the OLED display library to write text or draw simple graphics.

* display.clearDisplay() – all pixels are off
* display.drawPixel(x,y, color) – plot a pixel in the x,y coordinates
* display.setTextSize(n) – set the font size, supports sizes from 1 to 8
* display.setCursor(x,y) – set the coordinates to start writing text
* display.print(“message”) – print the characters at location x,y
* display.display() – call this method for the changes to make effect

#### Testing the OLED Display

After wiring the OLED display to the Arduino and installing all required libraries, you can use one example from the library to see if everything is working properly.

In your Arduino IDE, go to **File** > **Examples** > **Adafruit SSD1306** and select the example for the display you’re using.

<figure><img src="https://1292444914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtgOfPnscWebs1eh82EKq%2Fuploads%2FGEsBTgdtXgJ5cZMv4crb%2Fimage.png?alt=media&amp;token=34cac53b-c847-45a3-9615-c5ac69ca7b4c" alt=""><figcaption></figcaption></figure>

If your OLED doesn’t have a RESET pin, you should set the OLED\_RESET variable to -1 as shown below:

```c
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
```

<figure><img src="https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/05/oled_reset.png?resize=772%2C143&#x26;quality=100&#x26;strip=all&#x26;ssl=1" alt="set RESET pin arduino IDE OLED display" height="143" width="772"><figcaption></figcaption></figure>

Upload the code to your Arduino board. Don’t forget to select the right board and COM port in the **Tools** menu.

You should get a series of different animations in the OLED as shown in the following short video.

{% file src="/files/rxMr9DbrL0a4GJ64rjvB" %}
