Skip to content

SSD1306 based OLED connected to Arduino

pacodelgado edited this page Mar 26, 2015 · 16 revisions

A few weeks ago I bought two of these cheap "I2C OLED 0.96 inch displays" on eBay. Since it took me a while to get them up and running, i want to share my findings with you. I will give three example sketches, each using a different library (Adafruit, u8g and smart 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 by default. If you look at the back side, you can see that it is in 4-wire SPI mode. I2C operation will be researched in another post later.

Specification

  • Display technology: OLED
  • Size: 0.96"
  • Resolution: 128x64
  • Protocol: SPI
  • Power supply range: 3V-5V
  • Chipset: SSD1306, Datasheet

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 Power supply
GND Ground
D0 SCL,CLK,SCK Clock
D1 SDA,MOSI Data
RES RST,RESET Rest
DC A0 Data/Command
CS Chip Select

Working sketches

Adafruit

  • Wiring for sketch:
  • Sketch

u8g

  • Wiring for sketch:
  • Sketch

Smart Components sketch

Clone this wiki locally