I2C OLED Display troubleshoot Guide min

I2C OLED Display not working? 7 things you should check before considering it dead


Is your brand new I2C OLED display not working? Don’t worry. Previously, we studied the interfacing of an OLED display with NodeMCU in the post mentioned here. Now, sometimes it may happen that due to some basic errors, the display may not work. Here, in this guide, I will describe the maximum possible issues that can lead to the failure of OLED Display. If you have bought a display like this, then the following tutorial will help you.

Why my OLED Display is not working?

You bought an OLED display, made connections, uploaded a demo code, BUT the display did not light up! You did try a lot of different things but no luck? Then you are in right place. Whether you interface OLED with Arduino, NodeMCU, or any other board, there are some common checks you should do before thinking your OLED is dead.

Possible reasons behind non-working OLED display

Pin Connection of OLED Display

Check the proper pin-out. If you have the wrong connections, then the display will not even start! So following is a pin connection for some popular development boards.

OLED Display PinsNode MCU PinsArduino UNO PinsArduino Nano Pins
SCLD1A5A5
SDAD2A4A4
VCC3V3.3V/5 V3.3V/5 V
GNDGNDGNDGND
OLED Display pin connection with different boards

Type of OLED display

As mentioned in the previous post, I2C OLED comes with different variants. In one of the variants, it comes with a reset pin and another one is without a reset pin. 

Code statement for displays without Reset pin:

#define OLED_RESET -1 

Code statement for displays with Reset pin:

#define OLED_RESET 4     //if reset pin is connected to pin 4

Address of your I2C OLED display

Most of the time, the address may be the main cause of the failure of your OLED display. Before programming, make sure the address of your I2C display is proper. Here, address I2C address is different for different resolutions of the display. Following are the two addresses for the OLED displays currently available in the market.

#define OLED_ADDR 0x3C // here address is 0x3C for 128x32 display
#define OLED_ADDR 0x3D // here address is 0x3D for 128x64 display

If both of the above addresses won’t work, you should try using the I2C device scanner program. It will find the address of the connected peripheral.

Resolution of your display

Resolution is also defined in the library of the OLED display. Depending on the resolution of the OLED display, you may need to make necessary changes in the program. The following code snippet shows the block where we declare size and executes the command for OLED display.

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

In the library file, you need to change the header file. To make necessary changes, follow the steps below:

  1. Open “My Computer” > Documents > Arduino > libraries > Adafruit_SSD1306.
  2. From the library folder, open Adafruit_SSD1306.h file.
  3. You need to uncomment the statement which defines the resolution of your display and comment all other statements.
  1. Open “My Computer” > Documents > Arduino > libraries > Adafruit_SSD1306.
  2. From the library folder, open Adafruit_SSD1306.h file.
  3. You need to uncomment the statement which defines the resolution of your display and comment all other statements.
OLED Display not Working
Resolution definitions in the library file

Power source of your OLED Display

If you are powering your OLED display by an onboard power source and the board itself powered by Computer/Laptop USB, then try powering it with the external power source. OLED display needs input voltage around 3.7v to 6v. Here, 5v will be the ideal source.

Check program for display.display() command

For programming of OLED display, display.display() is a necessary command in order to display the contents. This statement should be executed every time whenever changes are made in the display contents. Check for the missing command, if your display is not getting updated.

Inspect your code for invalid display instructions

Still, is your I2C OLED display is not working even after trying the above solutions? Then there are high possibilities that your program has some invalid instructions for OLED display. So better you recheck your program.

If you find any other problem or solution regarding the OLED display, do comment and share your contribution in this article.

OLED Display Troubleshoot Guide

Subscribe
Notify of
guest
22 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Deepti
Deepti
4 years ago

Really helped a lot. Saved my day.

Ayuti Algur
Ayuti Algur
4 years ago

I had searched for many solutions but this worked instantly. Thanks

Diego
Diego
3 years ago

You are master! My OLED was not work. On the label of my OLED is: “128×64” but after using I2C scanner I got adress 0x3C. It means I have 128×32! The supplier made a mistake. Now works perfectly. Thank you! But on my Arduino Nano works with pin A4-SDA and A5-SCI.

Last edited 3 years ago by Abhishek
John
John
Reply to  Diego
2 years ago

Hey – I found the same address (0x3C) but when I use the 128×64 test code (and change the address in the test code) it works at the higher resolution. You might find your display just has the wrong address, and is still 128×64.

John
John
Reply to  Diego
2 years ago

Hey – I found the same address (0x3C) but when I use the 128×64 test code (and change the address in the test code) it works at the higher resolution. You might find your display just has the wrong address, and is still 128×64.

Milan
Milan
Reply to  Diego
2 months ago

My display is 128×64, but its address must be 0x3C, 0x3D isn’t working. I almost gave up, this was the last solution and now it works perfectly.

Lennart
Lennart
3 years ago

Thank you so much! I had the same problem as Diego, I received a display that was mislabeled as 128×64 when it was acutally 128×32.

Also, just FYI for anyone else having trouble with their I2C Displays: At least on my computer, the USB ports weren’t powerful enough to supply both the ESP8266 and the display with enough current. When I connected it to an external power source, it worked flawless.

KevLis
KevLis
3 years ago

display.display() did the trick. Feel like a complete idiot... Thanks a lot!

hicham
hicham
Reply to  KevLis
1 year ago

thank you so much

Aurelien Vanderstraeten
Aurelien Vanderstraeten
1 year ago

hello,

I have a problem, it seems that the screen only works on a little part in the top. I have look on the internet to find an answer but i do not find anything. Could you help me please ? For exemple, i will just write “hello” on the screen but it didn’t work.
 
Thank you

Merlin
Merlin
1 year ago

There are some strips of lines across the 128*32 OLED screen, don’t know whether it is damaged or not. I use

ssd1306_128*32_i2c 

code. Any help?

IMG_20220817_093042.jpg
Jocelyn
Jocelyn
Reply to  Merlin
1 year ago

I have the same problem of Merlin but not solution after many changes and test

Jocelyn
Jocelyn
Reply to  Merlin
1 year ago

Merlin the problem is the driver.

Instal SH110X Adafruit librairie and run Adafruit SH110X
select
OLED_QTPY_SWH1106
select
SH1106_128X64_I2C

Adrian
Adrian
Reply to  Jocelyn
4 months ago

You helped me a lot, Sir!
Thank you!

Bob
Bob
Reply to  Merlin
11 months ago

Use 128*64

Kilo Del Toro
Kilo Del Toro
1 year ago

My problem: uploading the stock example script didnt work, even after follow many suggestions online. The screen was just black. I turned on the serial monitor and could see something was happening. I struggled with this for a while before remembering I already had an old script that worked. Its just a stripped down version of the example script. (no comments or anything extra) and it worked first try! *One thing I did just now notice is that the baud rate is different for the serial.begin command. This uses 115200, example script uses 9600. But that shouldn’t/wouldn’t affect the screen… Read more »

Nándor Udvarhelyi
Nándor Udvarhelyi
7 months ago

Hello,
I bought such displays on Aliexpress (I2C SSD1306 12864 LCD Screen Board 1.3 Inch). Two thirds of the display is full of dots and only one third of the display works, if I use the 0.96 inch display it works well. This is an example program from the Arduino IDE.
The motherboard is UNO R3.
Please help me because I’ve tried everything.
Hi. Unándi

20230830_105930.jpg
Steven Moseley
Steven Moseley
7 months ago

my oled work in samples but not on my sketch

22
0
Would love your thoughts, please comment.x
()
x