OLED Display

In this project, you'll learn how to connect and control an Organic Light Emitting Diode (OLED) display which uses the SSD1306 controller chip.

There are two versions of this display, an I2C version with four connections and a SPI version with seven connections. The tradeoff between them is the I2C version using fewer connection wires is slower than the SPI version using more connection wires.

Parts needed:
  • Arduino
  • 0.96" OLED display with the SSD1306 controller.
  • Wires
  • Breadboard
OLED SSD1306 I2C display      OLED SSD1306 SPI display
1 Making the connections

I2C Version - This OLED display uses the I2C protocol which uses four wires.

OLED pins Arduino pins Description
SCL A5 SCL
SDA A4 SDA
GND GND Ground
VCC 5V Power


SPI Version - This OLED display uses the SPI protocol which uses seven wires.

OLED pins Arduino pins Description
GND GND Ground
VCC 3.3V or 5V Power
D0 10 CLK
D1 9 MOSI
RES 13 Reset
DC 11 Data/Command select
CS 12 Chip select
2 Download the following libraries:
3 Install the libraries by selecting Sketch from the Arduino IDE menu, then select Include Library, then select Add .ZIP Library. Locate and select the files one at a time that you just downloaded in step 2. It should be in the Download folder.

(Refer to this document for more information on how to install a library if you run into problems.)
4 Create a new program by selecting File from the menu
  • then select Examples
  • then select Adafruit SSD1306
  • then select FirstExample
If you are using the SPI version make sure that you uncomment the code for this.
3 Upload and run the program. You should see some really cool graphics.