OLED Animation Maker OLED Maker
🛠️ Blank Screen Fix

SSD1306 OLED Not Working or Blank? 12 Fixes That Actually Work

If I had a rupee for every "my OLED is dead" message, I could buy another crate of 0.96" modules. Most of them aren't dead. In the lab I see the same five causes again and again. Work through t...

By Ashish Jul 11, 2026 ~20 min Troubleshooting
📖

A tutorial you can follow

I wrote this for makers. You get the wiring, the code and the mistakes I see most.

🔌

Hardware you already own

It suits SSD1306 and SH1106, and you'll find pin tables where they help.

💻

Code you can paste

Sketches you can upload in Arduino IDE as they are.

✨

A free tool for you

Want more animations? Preview and export them at oledanimationmaker.com.

Arduino OLED Blank Screen Fix, Checklist That Actually Works: examples of pixel art and animations on a 128x64 SSD1306 OLED display Close-up of a small monochrome OLED module that should show text

If I had a rupee for every "my OLED is dead" message, I could buy another crate of 0.96" modules. Most of them aren't dead. In the lab I see the same five causes again and again. Work through this list in order. Don't skip ahead and rewrite your whole sketch.

Generated Arduino code window in OLED Animation Maker with Adafruit SSD1306 includes and PROGMEM frames

Your fast checklist

  1. Is your power and GND solid? Measure VCC on the module pins
  2. Are SDA and SCL on the right pins for your board?
  3. Does your I2C scanner find 0x3C or 0x3D?
  4. Does the address in your sketch match what the scanner found?
  5. Did you call display.display() after drawing?
  6. Still garbage or shifted? You might have an SH1106, not an SSD1306

1. Power problems make your OLED look dead

Cheap modules are labeled 3.3-5V, but some clones are picky. On an Uno, I'd try 5V first. On an ESP32, use 3.3V. Don't feed 5V into the GPIO side of a 3.3V-only board.

Put a multimeter between module VCC and GND while the Arduino is powered. If you read 0V, you've got a bad jumper or breadboard rail. Reseat your Dupont wires too. Half of the "broken" displays in my class are a wire that looks plugged in but isn't.

2. You swapped SDA and SCL, or used the wrong pins

BoardSDASCL
Uno / Nano (AVR)A4A5
Mega 25602021
Leonardo23
ESP32 (common defaults)2122
ESP8266 (NodeMCU)D2 (GPIO4)D1 (GPIO5)

Swap SDA and SCL and the scanner finds nothing. Swap them back. Don't touch the code yet.

3. Run the I2C scanner (before you argue with libraries)

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  while (!Serial) { ; }
  Serial.println(F("I2C scan"));
}

void loop() {
  byte n = 0;
  for (byte a = 1; a < 127; a++) {
    Wire.beginTransmission(a);
    if (Wire.endTransmission() == 0) {
      Serial.print(F("Found 0x"));
      if (a < 16) Serial.print('0');
      Serial.println(a, HEX);
      n++;
    }
  }
  if (!n) Serial.println(F("Nothing found"));
  delay(3000);
}

Found 0x3C or 0x3D: your hardware link works. Fix the address or init in your sketch.
Nothing found: it's wiring or power. Libraries can't help you yet.

4. You've got the wrong address in your code

Adafruit examples sometimes default to 0x3D. Many Amazon modules are 0x3C. Use whatever number the scanner printed:

display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // or 0x3D

5. You drew pixels but never called display()

It's embarrassing, and it's extremely common. Adafruit draws into a RAM buffer. Your panel stays black until:

display.clearDisplay();
display.setCursor(0, 0);
display.println(F("Hello"));
display.display(); // <-- without this, blank forever

6. "SSD1306 allocation failed"

begin() returned false. That usually means you've got the wrong bus address, or the device never ACKs. On an Uno it can also mean you're out of SRAM, so the 1 KB buffer failed to allocate. Check these:

  • Your address matches the scanner
  • You aren't creating two full 128×64 displays on a Uno without enough RAM
  • You picked the right board in Tools → Board

7. You see an image, but it's shifted or wrapped

That's the classic SH1106 sold as SSD1306 problem. Your picture looks like it slid two pixels sideways. The fix is an SH1106-capable library and init, or a true SSD1306 if you'd rather buy one. Details: SH1106 vs SSD1306.

8. Your display works once, then freezes or flickers

  • You're calling display() every millisecond with heavy drawing. Slow down.
  • Your jumper wires are long on a noisy bench. Shorten the cables and share a common GND.
  • Power dips when motors or servos share your 5V rail. Give them their own supply.

9. Bad Dupont wires and cold solder joints bite you

Module pins that barely grip the breadboard rows give you intermittent ACKs. Wiggle the four OLED wires while the scanner runs. If devices appear and vanish, replace your cable set. Factory modules sometimes ship with cold solder on the header. A quick reflow on VCC, GND, SDA and SCL has rescued more "dead" panels than new code ever did.

10. Logic level and 5V vs 3.3V confusion trip you up

An Uno is 5V tolerant on I2C with most SSD1306 breakouts, since they level-shift or tolerate 5V. An ESP32 is 3.3V, so don't feed a 5V-only rail into its GPIO. If you borrow a level shifter, make sure you didn't leave SDA floating on the 3.3V side.

11. You tied the reset pin wrong

You'll see many I2C tutorials pass -1 for reset, because the module hardwires RES. If your breakout exposes RES and you clamp it low by accident, your panel stays dark forever. Leave RES floating or high as the module silkscreen says.

12. You've mixed up libraries (U8g2 constructor vs Adafruit begin)

Paste a U8g2 constructor into an Adafruit sketch (or the reverse) and you'll waste hours. Pick one stack per project. If you want the trade-offs for animation libraries, read U8g2 vs Adafruit SSD1306.

The workshop triage order I actually use

  1. Meter VCC on your module
  2. Scanner
  3. Minimal "OK" sketch below
  4. Only then put your animation or GIF code back

When students reverse that order, they "debug animation maths" for twenty minutes on an unpowered display.

Minimal "prove hardware works" sketch

If this fails after a good scanner result, look at your address and library install. I'd start there:

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

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

void setup() {
  Serial.begin(9600);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("begin failed"));
    for (;;);
  }
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(10, 24);
  display.print(F("OK"));
  display.display();
}

void loop() {}

Still stuck? Here's what I'd do

Here's my last resort. Try another known-good OLED on the same wires. If the second module works, you've found it: the first module or its header solder is bad. That happens more than sellers will admit. If neither works, the Arduino's I2C pins or USB power are the suspects.

Scanner finds 0x3C, glass stays black

This one's the failure that eats a whole lab period. Serial Monitor prints Found 0x3C, so VCC, GND, SDA and SCL are good enough for an ACK. Yet the panel's still black. The bus is alive, but the controller isn't lighting pixels. Don't swap libraries yet. I'd run through these steps on the same wires.

  1. The scanner and your sketch are different programs. A hit at 0x3C plus display.begin(SSD1306_SWITCHCAPVCC, 0x3D) still fails. Many 4-pin modules answer at 0x3C, but some 128×64 boards, and the Adafruit example default, use 0x3D. Copy the scanner's number into begin.
  2. Check the address jumper or 0Ω resistor on the back of your module. Silkscreen often prints 0x78 or 0x7A. Those are 8-bit write addresses, and you'll need the 7-bit form: 0x78 is 0x3C, 0x7A is 0x3D. If you pass 0x78 to begin() it never matches, even when the scanner just found 0x3C.
  3. Construct the object with reset -1 if you've got a 4-pin I2C board: Adafruit_SSD1306 display(128, 64, &Wire, -1);. That last argument is a GPIO wired to RES. If you pass pin 4 and pin 4 is low, or you clip the module's RES pad to GND, the chip can still ACK and never leave reset. You'll stare at dark glass forever.
  4. After begin() returns true, force the contrast. A value of 0x00 looks just like a dead panel. Then push a full white rectangle, so a bad cursor can't hide the test from you. It's the fastest check there is.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// 4-pin I2C modules: reset is -1 (RES is tied on the PCB).
Adafruit_SSD1306 display(128, 64, &Wire, -1);

void setup() {
  Serial.begin(9600);
  // Uno/Nano: Wire.begin() uses A4/A5.
  // Mega: pins 20 and 21. ESP32: Wire.begin(21, 22) first.
  // ESP8266 NodeMCU: Wire.begin(D2, D1) first.
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("begin failed"));
    for (;;);
  }
  display.ssd1306_command(SSD1306_SETCONTRAST);
  display.ssd1306_command(0xCF);
  display.clearDisplay();
  display.fillRect(0, 0, 128, 64, SSD1306_WHITE);
  display.display();
}

void loop() {}

If the rectangle lights, then your earlier sketch never called display(), used contrast 0, or drew off-screen. If it stays black while begin() succeeds, the init sequence doesn't match the chip. If your white field slid about two columns, or you only see a bright strip at the left edge, you've got an SH1106 PCB. That controller is 132×64 internally, so you'll see a column offset when you drive it with an SSD1306 constructor. Install Adafruit SH110X and construct Adafruit_SH1106G, or use the U8g2 SH1106 constructor. The I2C address can still be 0x3C. The address doesn't identify the controller.

Pull-ups, a second chip, and breadboard rows

Hobby SSD1306 boards usually include I2C pull-ups, often 4.7k or 10k from SDA and SCL up to VCC. Don't add another pair "because I2C needs resistors" unless the listing says your board doesn't ship with them. You'd only make it worse. A second OLED, an RTC, or a sensor with its own 4.7k puts those resistors in parallel. Two 4.7k pull-ups come to about 2.4k. On a short Uno jumper that often still works. On a Mega with 20 cm leads, or an ESP8266, the edges slow down and your scanner flips between Found 0x3C and Nothing found.

Here's what you'll see: the OLED scans only when the RTC is unplugged. Keep one pull-up pair on the bus. Lift the extra resistors, or use a module that lets you disable them. You can also drop the clock as a test: Wire.setClock(100000); before begin() makes a marginal breadboard ACK at 100 kHz when 400 kHz fails. If 100 kHz is reliable and 400 kHz isn't, shorten your wires instead of rewriting the sketch.

Breadboard contact gives you the same symptom. Maybe the header pin sits in row 30 and the Dupont plug sits in row 31, or the plastic body stops the pin from seating. Wiggle SDA while your scanner loops every three seconds. If 0x3C appears and vanishes, move the module to another section of the breadboard and replace all four jumpers. A cold joint on the module header does this too. Reflow VCC, GND, SDA and SCL before you call the panel dead.

Two devices at the same address also look blank. Both ACK, so the scanner prints a single 0x3C, and neither finishes init cleanly. Unplug one board. If the other panel wakes up, you've got a duplicate address. Move one module's address resistor or solder jumper to 0x3D, or put a mux between them. Two full 128×64 Adafruit objects also take 2 KB of SRAM. On an Uno the second begin() can print allocation failed even when you've wired both panels correctly.

5V Uno versus 3.3V boards

On an Uno or Nano, wire module VCC to 5V, SDA to A4 and SCL to A5. Most SSD1306 breakouts tolerate that, and their onboard pull-ups then sit at 5V, which matches the Uno's GPIO. The Mega 2560 uses the same 5V rail, but I2C is on pins 20 and 21, not A4/A5. A breadboard that worked on your Uno goes black on a Mega until you move those two jumpers. Your sketch doesn't have to change on AVR, because Wire.begin() picks the hardware pins for the board you selected. If Tools → Board is still Uno while a Mega is plugged in, you're debugging the wrong pin map.

ESP32 defaults are GPIO21 (SDA) and GPIO22 (SCL), and you must power the module from 3.3V. If you feed the OLED from the ESP32 5V pin while SDA and SCL go straight to GPIO, the module pull-ups rise to 5V and pull the ESP32 pins above 3.3V. Power the display from 3.3V so the resistors and the GPIO agree. If you aren't on the default pair, call Wire.begin(21, 22) before display.begin.

On an ESP8266 NodeMCU the silk says D2 (GPIO4, SDA) and D1 (GPIO5, SCL), with VCC from the 3.3V pin. If your Uno sketch only calls Wire.begin() with no arguments, it talks on the wrong pins, and your scanner reports nothing. Take a second look at contrast on 3.3V, since it's an easy one to miss. A sagging rail plus a low contrast value looks gray or fully black even though the scanner still finds the chip. The white-rectangle sketch above, with contrast 0xCF, separates "dim" from "not initialized."

Bench symptoms you'll see and the matching fix

What you seeLikely causeChange this
Scanner: nothingNo VCC, swapped SDA/SCL, wrong board pins, open breadboard rowMeter your module VCC, swap the data lines, check the pin table
Scanner: 0x3C, glass blackSketch uses 0x3D or 0x78, RES held low, contrast 0, no display()7-bit address, reset -1, contrast 0xCF, push the buffer
You see barely visible grayContrast command near 0, or a 3.3V rail saggingSSD1306_SETCONTRAST then 0xCF; shorten power leads
Your picture slid ~2 columnsSH1106 panel, SSD1306 constructorSH1106 init; the RAM is 132 columns with an offset
It dies when you plug in a second moduleSame address, or pull-ups in parallelGive each device its own address, and keep one pull-up pair
ACK blinks while you touch the wiresDupont not seated, or a cold header jointNew jumpers, different breadboard rows, reflow the four pins

I keep a copy of the white-rectangle sketch on the classroom laptop, and I don't let students paste animation code until that rectangle is solid. If a second known-good OLED also stays black on those same four wires, blame the Arduino I2C pins or the USB 5V rail. The bitmap isn't the problem.

FAQ: questions you'll probably ask

My scanner finds 0x3C but the OLED stays black. Is the glass dead?

Usually not. Put that exact address in begin(), construct the display with reset -1 unless RES is really wired to a GPIO, send contrast 0xCF, draw a full white rectangle, and call display(). If the rectangle is shifted by about two columns, you should switch from an SSD1306 constructor to SH1106.

My board says 0x78. Why does begin(0x78) fail?

0x78 is the 8-bit write address. Shift it right by one bit and you get 0x3C, which is what Wire and Adafruit expect from you. The rear resistor or solder blob picks 0x78 or 0x7A (0x3C or 0x3D). It doesn't mean you should pass 0x78 to begin(), and I wouldn't try.

Do I need to add 4.7k resistors on SDA and SCL?

Only if your module documentation says pull-ups aren't fitted. A normal 0.96" breakout already has them. A second board with its own 4.7k makes the bus stiffer, and it can turn a long cable into intermittent ACKs for you. I'd remove one pair instead of adding a third.

I moved from Uno to Mega or ESP32 with the same sketch and got a black screen. Why?

On an Uno or Nano you'll use A4 and A5 at 5V. A Mega uses pins 20 and 21. ESP32 uses GPIO21 and GPIO22 with the OLED on 3.3V, and ESP8266 NodeMCU uses D2 and D1. On Espressif boards call Wire.begin(SDA, SCL) before display.begin. Also check that Tools → Board matches the PCB on your desk.

Related guides you might like

When the screen works, try an animation

Use the free maker to export Adafruit code once your Hello World is solid.

Open oledanimationmaker.com →

Free tools: OLED Animation Maker for your SSD1306 and SH1106 animations, Assemble Studio for your name and logo animations, the Shadow Box Lamp Generator for your 3D-printed shadow lamps, Text to STL for your 3D-printed names and keychains, and 3MF to Web to show your 3D prints on any website. New: the Image to Byte Array converter, the OLED Robot Eyes generator and the Lithophane Maker. See all tools.