Skip to content

SSD1306 based OLED connected to Arduino

pacodelgado edited this page Mar 26, 2015 · 16 revisions

A few weeks ago i bought one of these cheap "I2C OLED 0.96 inch displays" on eBay. Since it took me a while to get it up and running, i want to share my insights to you. I will give three example sketches, each using a different library (Adafruit, u8g and hobby components).

This is how the display looks like

OLED connected to Arduino Back side of OLED

Although it was sold as an I2C display, it turned out that it operates as an SPI device as default. If you look at the back side, you can see that it is in "4SPI" mode. I2C operation will be researched in another post later.

Specification

  • Display technology: OLED
  • Size: 0.96"
  • Resolution: 128x64
  • Protocol: SPI
  • Chipset: SSD1306

PIN name confusion

The display has the following pins: GND, VCC, D0, D1, RES, DC, CS. Since pin names are often named differently, i will give an overview of commonly used names for refernce:

Pin Alternate Names Description
VCC
GND
D0 SCL,CLK,SCK
D1 SDA,MOSI
RES RST,RESET
DC A0

Working sketches

I got the display working with three different libraries:

  • Adafruit
  • u8g
  • hobby components
Clone this wiki locally