science tinker

OLED display (SSD1306)

A tiny screen of 128 × 64 pixels that can show text, shapes and simple pictures, using only two signal wires.

Light, sound and displays · Elements inside: CHNOInSnSiCu

Function: what the SSD1306 does in a circuit

A tiny screen of 128 × 64 pixels that can show text, shapes and simple pictures, using only two signal wires.

  • Shows text, shapes and simple animations on 128 × 64 pixels
  • Needs only the two I²C wires, SDA and SCL
  • Makes its own light, so it is easy to read in the dark

SSD1306 key facts

Screen0.96 inch, 128 × 64 pixels, one colour
Driver chipSSD1306
InterfaceI²C, address 0x3C
Supply3.3 V to 5 V
Currentabout 20 mA with half the pixels lit
Memory needed1 KB of RAM for the frame buffer
Textbuilt-in 5 × 7 pixel font, 6 × 8 per character: 21 characters by 8 lines at size 1
LibraryAdafruit_SSD1306 with Adafruit_GFX

SSD1306 pinout

The connections, in the order they appear on the part:

No.Name
1GND
2VCC
3SCL
4SDA

How to connect the SSD1306 to an Arduino

Connect GND to GND, VCC to 5V, SCL to A5 and SDA to A4 on an Uno (pins 21 and 20 on a Mega).

Example sketch:

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(128, 64, &Wire, -1);

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.print("Hello");
  display.drawRect(0, 16, 60, 30, SSD1306_WHITE);
  display.display();      // send the drawing to the screen
}

void loop() {}

Run this in the free simulator

How it works

Every pixel is its own organic LED, so lit pixels glow and unlit pixels are truly black: there is no backlight. An SSD1306 chip on the glass drives all 8,192 pixels and listens on the I²C bus at address 0x3C. Your sketch draws into a copy of the screen held in the Arduino's memory with the Adafruit GFX functions (drawPixel, drawLine, fillRect, print) and nothing appears until display.display() sends that copy to the screen.

What it is made of

  • Pixels: Thin layers of organic (carbon-based) light-emitting compounds between two electrodes CHNO
  • Front electrode: Indium tin oxide, a conductor you can see through InSnO
  • Glass and driver: Glass with an SSD1306 silicon chip bonded to it SiO
  • Board: Glass-fibre and epoxy with copper tracks CuSn

Where the materials come from: Indium as a by-product of zinc refining; tin from cassiterite; silica sand for the glass.

The chemistry

In an OLED, electrons and "holes" meet inside an organic molecule and give up their energy as light. The molecule chosen sets the colour.

Biology connection

Fireflies and glow-worms also make light from organic molecules, without a hot filament. Biology calls it bioluminescence; an OLED does a similar job with electricity. How the eye sees →

Safety and the environment

The frame buffer uses 1 KB of the Uno's 2 KB of RAM. A picture left on for months can burn in, so blank the screen when idle.

Did you know? A 128 × 64 OLED has 8,192 pixels, yet the whole module is smaller than a postage stamp.

Try it in the simulator

Build and code a circuit with an OLED display in these practice projects:

Questions students ask

What does the SSD1306 do?

A tiny screen of 128 × 64 pixels that can show text, shapes and simple pictures, using only two signal wires. Main functions: shows text, shapes and simple animations on 128 × 64 pixels; needs only the two I²C wires, SDA and SCL; makes its own light, so it is easy to read in the dark.

Why does nothing appear on my OLED?

The drawing functions only change a copy of the screen in the Arduino's memory. Call display.display() after drawing to send it to the OLED, and check that display.begin() uses address 0x3C.

What are the connections of the SSD1306?

In order: GND, VCC, SCL, SDA.

How do I connect the SSD1306 to an Arduino?

Connect GND to GND, VCC to 5V, SCL to A5 and SDA to A4 on an Uno (pins 21 and 20 on a Mega).

How does the SSD1306 work?

Every pixel is its own organic LED, so lit pixels glow and unlit pixels are truly black: there is no backlight. An SSD1306 chip on the glass drives all 8,192 pixels and listens on the I²C bus at address 0x3C. Your sketch draws into a copy of the screen held in the Arduino's memory with the Adafruit GFX functions (drawPixel, drawLine, fillRect, print) and nothing appears until display.display() sends that copy to the screen.

What is the SSD1306 made of?

Pixels: Thin layers of organic (carbon-based) light-emitting compounds between two electrodes. Front electrode: Indium tin oxide, a conductor you can see through. Glass and driver: Glass with an SSD1306 silicon chip bonded to it. Board: Glass-fibre and epoxy with copper tracks.

Is the SSD1306 safe? How should it be recycled?

The frame buffer uses 1 KB of the Uno's 2 KB of RAM. A picture left on for months can burn in, so blank the screen when idle.

More light, sound and displays

Know someone who would use this?

It’s free for every learner. Send it to your class, team or club.

Updated · Free, no sign-up ·

Connected tools

The same idea from another angle, across the site.