30 Days Lost in Space → Help Center

Troubleshooting

Display Shows Nothing (OLED)

Your OLED display stays completely black after uploading your code. No text, no pixels, nothing. Or it worked before and stopped.

What You See

You wired up the OLED screen and uploaded code that should show text or graphics. The screen is completely dark. Not even a flicker.

Or the screen was working in a previous project and now it will not turn on with your new code.

The 30 Days kit's screen is a 1.3-inch, 128x64 OLED with an SH1106 driver chip, and it talks to the board over I2C. The wiring, the library and the constructor line all have to agree, so there are several places where things can go wrong.

Most Likely Causes

1. Wrong I2C Address

I2C devices have an address, a number that identifies them on the bus. Your kit's screen answers at 0x3C, which is what U8g2 uses unless you tell it otherwise. A few screens answer at 0x3D instead (the back may say 0x7A). If the code and the screen disagree, the screen never receives the data.

Fix: Run the I2C scanner sketch below to see which address your screen actually uses. If it finds 0x3D, set the address before begin(). U8g2 takes the address doubled:

u8g2.setI2CAddress(0x3D * 2);  // only if the scanner found 0x3D
u8g2.begin();

2. SDA and SCL Wires Swapped

I2C uses two wires: SDA (data) and SCL (clock). On the HERO Board, as on the Uno, SDA is pin A4 and SCL is pin A5. Swap them and communication fails completely, and nothing else tells you why.

Fix: Read the labels on the screen's own header, not the order in a picture: screens differ, and the kit's reads GND, VCC, SCL, SDA. Then check:

  • SDA goes to A4
  • SCL goes to A5

Some boards also have SDA and SCL pins near the USB port. Those are the same as A4 and A5.

3. Library Not Installed

The sketch can't drive the screen without the U8g2 library.

Fix: Open the Library Manager in the Arduino IDE, search for U8g2 and install it. You don't need a separate #include <Wire.h>: U8g2 includes it and starts the I2C bus itself (the Day 21 sketch has no Wire line), though adding one does no harm.

4. Wrong Constructor (U8g2)

U8g2 has dozens of constructors for different driver chips, resolutions and connections. The wrong one sends commands the screen does not understand.

The constructors the course uses for your SH1106 screen:

// Full buffer: draw, then sendBuffer() (Days 21 and 22)
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

// Page buffer: far less RAM, drawn in a firstPage()/nextPage() loop (Day 23 onward)
U8G2_SH1106_128X64_NONAME_2_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

Fix: Copy the constructor line from that day's sketch. Most online tutorials are written for the SSD1306, a near-twin chip, and their constructor compiles fine but leaves your screen blank or shifted (see cause 8). Use an SSD1306 constructor only if your screen really is one, for example from another kit:

U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

5. Forgot to Call begin() or sendBuffer()

With U8g2, you must call u8g2.begin() in setup(). If you skip this, nothing works.

With a full-buffer (_F_) constructor, you also need to call u8g2.sendBuffer() after drawing. Without it, your drawing commands fill a buffer in memory but never actually send the data to the screen. A page-buffer (_1_ or _2_) constructor draws inside a firstPage()/nextPage() loop instead.

Fix:

void setup() {
  u8g2.begin(); // REQUIRED
}

void loop() {
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_ncenB08_tr);
  u8g2.drawStr(0, 20, "Hello World");
  u8g2.sendBuffer(); // REQUIRED in full-buffer mode
}

6. Power Issue

The kit's screen runs from the board's 5V pin, as in the Day 21 wiring. If you are powering several other parts as well, the supply can sag.

Fix: Make sure VCC on the screen goes to the board's 5V pin and GND goes to GND. Screens differ here too: some put VCC first on the header and some GND, so read yours. Swapped, the screen stays black. Try disconnecting other components temporarily to see if the screen works on its own.

7. Bad Solder Joints on the Display Module

Many OLED modules come with unsoldered header pins. If you soldered the pins yourself and one joint is cold (looks dull and blobby instead of shiny and cone-shaped), that connection might be intermittent or completely open.

Fix: Inspect the solder joints under good light. Reheat any joints that look dull, blobby, or have visible gaps. Apply a tiny bit more solder if needed.

8. Shifted Picture or a Stripe of Noise

The SH1106 keeps 132 columns of memory for a 128-column panel, so code written for the SSD1306 writes into the wrong columns, even though the two screens look identical.

Symptom: The screen stays black, or you see the picture shifted sideways with a band of noise down one edge.

Fix: Use the SH1106 constructor from cause 4. If your screen really is an SSD1306 and you're running a course sketch, it's the other way round: change SH1106 to SSD1306 in that line.

Test Code: I2C Address Scanner

Upload this first. It scans every possible I2C address and tells you what devices it finds.

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  delay(200);
  Serial.println("I2C Scanner - looking for devices...");
}

void loop() {
  int deviceCount = 0;

  for (byte address = 1; address < 127; address++) {
    Wire.beginTransmission(address);
    byte error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("Device found at address 0x");
      if (address < 16) Serial.print("0");
      Serial.println(address, HEX);
      deviceCount++;
    }
  }

  if (deviceCount == 0) {
    Serial.println("No I2C devices found! Check SDA/SCL wiring.");
  } else {
    Serial.print("Found ");
    Serial.print(deviceCount);
    Serial.println(" device(s).");
  }

  Serial.println("---");
  delay(3000);
}

Open the Serial Monitor at 9600 baud. You should see something like:

Device found at address 0x3C
Found 1 device(s).

If it says "No I2C devices found," your wiring is wrong (SDA/SCL swapped, loose connection, or no power to the display).

Test Code: OLED Hello World (U8g2)

Once the I2C scanner finds your display, use this to confirm the display works:

#include <U8g2lib.h>
#include <Wire.h>

// Your kit's SH1106 screen. Change this line only if your screen is different
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);

void setup() {
  u8g2.begin();
  Serial.begin(9600);
  Serial.println("OLED test starting...");
}

void loop() {
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_ncenB08_tr);
  u8g2.drawStr(0, 15, "Hello World!");
  u8g2.drawStr(0, 35, "OLED is working.");
  u8g2.drawStr(0, 55, "You got this.");
  u8g2.sendBuffer();
  delay(1000);
}