OLED 1.3" I2C IIC 128x64 Serial LCD - Faulty?

Dear All,
Can anyone please advise if the attached pics show the display is faulty or whether it is a program fault?
The 128x64 (IDAFRUIT) Display Demo runs but as can be seen in the pics only the top few lines of this display is working - all the rest of the display lines just show random noise?

Please advise.

Ian

Hi

Not sure what you mean by IDAFRUIT, i assume you use the Adafruit Software.

So, i would say this: If your display is NOT a original Adafruit OLED display, then there is a good chance, that your display does not contain the SSD1306 controller (which is the one in the Adafruit display) but instead contains a SH1106 controller, which also is used for 128x64 displays. Any OLED with the SH1106 controller is NOT supported by Adafruit.

All in all, your pictures (partly visible correct bitmap) indicate such a problem.

You may want to use u8glib instead, which has support for both types of 128x64 OLED displays: With SSD1306 or with SH1106 controller.

Oliver

Thank you for your reply Oliver, greatly appreciated! Getting any sensibility out of the supplier of this I2S IIC Serial OLED is like pulling out "chickens teeth"?? You are correct about Adafruit - just my crappy typing and no it was not purchased from them - I wish it had been then I wouldn't be having the problems I am having!

To a complete newby finding out who the "reliable deallers are" to deal with is a huge problem when you don't know before hand!

Can you please take the time to explain what the "IIC" and "I2(Squared)C parts of this OLED refers to? I will be ever so grateful if you can.

The actual terminology used by OLEDS is very confusing and I have actually been on to the manufacturers site (www.heltec.cn) to try to find out both this and what "controller" is used in their 1.3" OLED - I don't know about you but my Mandarin is zip!!!!

I am also trying to locate a complete I2S scanner so I can determine which address is correct for this particular OLED as the one on the back of it (0x78, 0x7B or 0x7A) - can't see if it is an "8" or "B" - just don't work and I got the results in my pictures when I used 0x3C - can you point me in the right direction? The I2C scanner on Arduino site looks great but gettin it into a downloadable form is problematic - a further example of my limited knowledge in this new field!!!

This leads neatly into my last question - what document reader do you use to read and edit ".c; .h; .ino" files as MS Word just spits the dummy and gives up!!

I know I am asking you for a lot of information so I will be really grateful for what ever you decide to provide, if you do.

Cheers, Ian from "Down Under"

what the "IIC" and "I2(Squared)C parts of this OLED refers to

They both mean the same thing and it is the interface protocol that is used to communicate between the Arduino and the display. See:- http://en.wikipedia.org/wiki/I%C2%B2C

so I can determine which address is correct for this particular OLED

Yes the address is correct or you would not be seeing anything.

However these displays normally run off 3V3 not 5V, are you sure of the voltage? Also with I2C you need a pull up resistor from each of the signal lines to the display's power.

what document reader do you use to read and edit ".c; .h; .ino" files

You can use Notepad as all these are simply text files.

Hi

I have discussed this kind of display on my gallery page (4th pic from top): https://code.google.com/p/u8glib/wiki/gallery. At least my own OLED does not require pull up resistors and it works with 5V:

Also note, that this display might be invisible to the I2C scanner, because it might not send the ACK response.

My suggestion is, with your setup from your first post, try U8glib with the constructors

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

or
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK);
or

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);

or
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);

Oliver

At least my own OLED does not require pull up resistors

See this for why you always need a pull up resistor:-

http://www.dsscircuits.com/index.php/articles/47-effects-of-varying-i2c-pull-up-resistors

Thanks guys - for all your help and suggestions: it will take me a bit of time to check it all out and try your various suggestions.

Re the need whether or not to use a pullup resistor with this OLED - seems like what I have seen written is pretty evenly divided between pros & cons BUT who is correct???? And what/how does the internal resistors in Uno & Mega 2560 get used - do you have to include specific code in your sketch to activate them or are they automatically activated? There si a lot of differing opinion on both Arduino and Adafruit (+ other) forums on this very issue - is it possible both views are correct?

Cheers, Ian

Hi All

Of course pull up resistors are mandatory for I2C, however it is not clear whether they are included on the OLED module or not. Yet, your pictures did prove, that you are able to transfer some usefull data to your OLED. So, pullups are not required in your specific case. This also aligns with my own experience, that such kind of OLED modules often do not need pullup resistors.

Still my suggestion is to give a try to u8glib with the setup of your picture. All the example sketches include the constructors, and checking the options will be as simple as uncommenting exactly one of the constructors in the examples of U8glib.

The "GraphicsTest" example looks like this in line 89:

//U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SSD1306_128X64 u8g(4, 5, 6, 7);    // SW SPI Com: SCK = 4, MOSI = 5, CS = 6, A0 = 7 (new white HalTec OLED)
//U8GLIB_SSD1306_128X64 u8g(10, 9);     // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);  // I2C / TWI 
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);    // Display which does not send ACK
//U8GLIB_SSD1306_ADAFRUIT_128X64 u8g(13, 11, 10, 9);    // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SSD1306_ADAFRUIT_128X64 u8g(10, 9);        // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1306_128X32 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SSD1306_128X32 u8g(10, 9);             // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)
//U8GLIB_SSD1306_128X32 u8g(U8G_I2C_OPT_NONE);  // I2C / TWI 
//U8GLIB_SH1106_128X64 u8g(13, 11, 10, 9);  // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_SH1106_128X64 u8g(4, 5, 6, 7); // SW SPI Com: SCK = 4, MOSI = 5, CS = 6, A0 = 7 (new blue HalTec OLED)
//U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);   // I2C / TWI 
//U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK); // Display which does not send ACK

Uncomment this line:

//U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);   // I2C / TWI

Compile and upload the example. Will this work? I am very confident it will.

The problem here is not the Adafruit and not the OLED Display. It is the combination of both. I can not promise, that u8glib will work, but i did work together with a lot arduino users and i received a lot of feedback about successful installations.

Moreover, i sometimes order "strange" OLEDs from far east, just to make it work with U8glib. Of course you do not need to use u8glib (it might appear to be strange by itself), but at least you would know the exact controller type: SSD1306 or SH1106. Please also note, that the displays often are offered as SSD1306, although they contain a SH1106.

Oliver

seems like what I have seen written is pretty evenly divided between pros & cons BUT who is correct?

Did you not read that link I posted?

Yes the I2C always needs pull up resistors. On the Arduino these are provided by the internal pull up resistors that are automatically enabled using the wire library. The debate is if the 35K pull up resistors are sufficient.

Anyone who has looked at the signals with an oscilloscope will tell you yes. It might actually work without them but that is not to say they are not needed. The fact that it can actually works is absolutely no proof at all, something that non engineers find hard to understand. But that is the truth.

Hi Oliver – I finally got around to trying out your u8glib code suggestions and you are correct, either of the following SH1106 constructor code lines works with my 1.3” I2C 128x64 OLED (4 pins; Vcc, GND, SCL, SDA) – that is up to a certain point, see below:
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK); // Display which does not send ACK
Or
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE); // I2C / TWI

However, when I run your “Menu” and “Colour” programs nothing seems to happen, that is I get the four menu items printed to the OLED in the former case and just the “Hello World” in the latter?
There are no instructions or explanations on how to drive either of these programs in their respective codes and I don’t mean to be disrespectful at all in this manner, but I find the u8glib code not to be intuitive and rather hard to follow compared to say standard Arduino code?

Clearly my novice status in this highly complex area of programming and all of its “different” variants is having a big impact on my lack of clear understanding of just what to do here!
I have played around with the Arduino serial monitor in trying to communicate with these two programs but whatever I enter, e.g., alphas / numerals / hex from what I see from within the code itself should be entered, does not get any response.

So, how do I communicate with these two (or any other of the u8glib libraries for that matter) programs in using the serial monitor? Really appreciate your continued help in elucidating what for me is a “brick wall” at this point in using these particular programs!

In all of my digging into various websites I have located the Datasheet and Specification Manual for the SH1106 Driver for my OLED and have attached them to this post for all who might be interested.

These two documents have to be the very best Chinese to English translations for technical documents I have ever seen and there is a wealth of information contained in them which is clearly well over and above standard Datasheets info! For instance, it shows you how to select the other protocols that this OLED can utilize if you want to run the OLED under SPI etc, etc., rather than I2C! Additionally, the Spec manual not only shows you which chip locations are to be addressed and what values are to be used but it also includes sample (Arduino??) code for this, as well. Directly programming the control chip is a bit out of my league at that moment!!!

The SH1106 Manual clearly states that Pull-up resistors are definitely required for this OLED but there is ambiguity on just what is the correct(?) value to be used. One other site I visited has investigated this in depth and has determined that 4K7 ohms is the “best value for this pull-up resistor” and that is what I have used – refer the attached pics. The chip actually has 132x64 resolution capability but the display is set inside this to 128x64.

The chip handling section towards the end of the Spec Manual also includes information on what not to clean your OLED with, which in the absence of knowing you might otherwise use and create problems for your chip or OLED!!!

As good as these translations are there are still the odd few examples of wrong words appearing – one very humorous one was; “if your OLED gets ‘dewed’ [meaning wet!], it will corrode the pins ………”

All in all, the contained info will provide a lot of help for a great many of the forum users who use this type of chip/OLED!

One final question is, I have noted that various 0.96” and 1.3” monochrome OLED LCDs have either a green tag (as in my case) or a red tag on them when purchased – what is the significance of these coloured tags as I have not been able to find any reference to them???
Cheers, Ian

SH1106 datasheet.pdf (1.4 MB)

SH1106 V2.3.pdf (688 KB)

I might be wrong, but i think your questions are not directly related to this thread. So it might be better to start a new thread for your questions.

I tried to locatz your questions, this seems to be the first:

So, how do I communicate with these two (or any other of the u8glib libraries for that matter) programs in using the serial monitor?

I do not understand the question and perhaps you should be more specific and describe (in a new thread) what you intend to do. Then helping would be better. The actual answer would be (according to my understanding of your question): You need to write a program.

Second question seemst to be:

what is the significance of these coloured tags as I have not been able to find any reference to them???

What is a coloured tag?

Oliver

Oliver I don't understand what "you don't understand" from my latest post - I have been very explicit? 1. My latest post is totally pertinent to my original OLED I2C Faulty(??) post - that is why I continued on from the original rather than start a new thread. It's all about getting this particular OLED working properly! 2. I understood from your earlier comments to me that you actually wrote this particular u8glib code yourself - perhaps I am mistaken? 3. If 2., is correct then I would have thought you would have fully understood that the "Menu" and "Colour" programs I referred to were examples that appear within the u8glib Library examples when you include this library in a sketch? 4. What I am trying to do is to see what the "Menu" & "Colour" programs actually do and how you can manipulate them, eg., how you select the different menu items in the case of the "Menu List" examples [Look at my attached JPEG - it clearly shows the Menu list I am talking about]. 5. Do you select each list item by entering "something" in the serial monitor when running this program??? 6. I am interesting in using a similar Menu Selection program in another program I am writing BUT before I can do this I have to know how this "Menu Selection process" works first and how you select the different menu irems - which it seemingly does not presently do in this particular u8glib code example???? 7. The green tags [stick on labels attached to the OLED display - which is clearly visible in my attached jpegs] come from the suppliers of the various OLEDs when the OLEDs are purchased! I have also seen red tags as well on OLEDs when looking at different sellers web sites? These coloured labels are exceedingly common and have appeared on ALL OLEDs I have look at thus far, so I am totally surprised that you don't understand what I am talking about? 8. Have you actually looked at my pictures I attached to my last post???

Hopefully I have clarified what it is you don't understand in my questions? If not then I give up as I must be speaking Swahili! Cheers, Ian

vgtlcs: Oliver I don't understand what "you don't understand" from my latest post - I have been very explicit? 1. My latest post is totally pertinent to my original OLED I2C Faulty(??) post - that is why I continued on from the original rather than start a new thread. It's all about getting this particular OLED working properly!

Oh, my mistake, i have not seen that you are the OP.

vgtlcs: 2. I understood from your earlier comments to me that you actually wrote this particular u8glib code yourself - perhaps I am mistaken?

Correct, i am the author of u8glib.

vgtlcs: 3. If 2., is correct then I would have thought you would have fully understood that the "Menu" and "Colour" programs I referred to were examples that appear within the u8glib Library examples when you include this library in a sketch? 4. What I am trying to do is to see what the "Menu" & "Colour" programs actually do and how you can manipulate them, eg., how you select the different menu items in the case of the "Menu List" examples [Look at my attached JPEG - it clearly shows the Menu list I am talking about]. 5. Do you select each list item by entering "something" in the serial monitor when running this program???

ok, this is more clearer now to me. Maybe a better question would have been "How do i modify the cursor in the menu example of u8glib?". But the answer is easy: Attach one or more buttons to the ports of your Arduino Board. The buttons should connect the port with GND. The actual port numbers must be provided here:

uint8_t uiKeyPrev = 7;
uint8_t uiKeyNext = 3;

vgtlcs: 6. I am interesting in using a similar Menu Selection program in another program I am writing BUT before I can do this I have to know how this "Menu Selection process" works first and how you select the different menu irems - which it seemingly does not presently do in this particular u8glib code example????

The menu selection process is just an example. I would say, it has nothing to do with u8glib itself. U8glib just draws something on the display. U8glib is NOT a user interface library (like m2tklib). In the menu example, the serial object is not used at all, so i was confused about your question. Moreover, the menu example reads and reacts on port levels as you can see by looking at the code.

vgtlcs: 7. The green tags [stick on labels attached to the OLED display - which is clearly visible in my attached jpegs] come from the suppliers of the various OLEDs when the OLEDs are purchased! I have also seen red tags as well on OLEDs when looking at different sellers web sites? These coloured labels are exceedingly common and have appeared on ALL OLEDs I have look at thus far, so I am totally surprised that you don't understand what I am talking about?

I am a software programmer and electronics freak. Why they display vendor attac hes thes tags? How do i know this? I guess i am the wrong person to answer this. In fact i never cared about these tags. Maybe they include an RFID chip which allows easy identification during the manufactoring process. Or it is for a better and easier handling of the user or the person who assembles this display? I had a similar tag on the display of my smartphone, which i purchased recently. What could have been its purpose???

vgtlcs: 8. Have you actually looked at my pictures I attached to my last post???

I never read posts, i never try to understand them and i never look at any picture. ;)

vgtlcs: Hopefully I have clarified what it is you don't understand in my questions? If not then I give up as I must be speaking Swahili! Cheers, Ian

Yes, thanks, this reply was more clearer to me.

Oliver

all sorts of screens normally come with a piece of plastic film on as screen protection whilst in transit. the tag is just something to pull to remove the plastic film .

I soldered a 128x64 module using an arbitrary eBay 1.3" OLED for myself. I opted for the 4wire SPI version (not I2C as found in this post). As the thread is somehow confusing (controller type, I2C pull-ups, ...) here is my take away:

I am not using my 1.3" display module with Arduino IDE, but programming it with AVR Studio - so here is a different view. I have some experience in using 0.96" OLEDs of the same screen size, which work well and have the SD1306 controller included. I know my 1.3" OLED which I use now has instead an SH1106 built in and it shows very similar (read: identical) effects, when driven by (my) SD1306 firmware (only top rows show data). I think this should be simply related in the way the pixels are addressed (different address spaces for both controllers). Will have to look into this now.

Obviously the thread opener also has the SH1106 version, and this should be the reason for having the difficulties he ran into by using SD1306 supporting software. By using the correct SH1106 constructor of the u8glib he was able to solve the problem. Pull-ups are out of discussion in this special case, obviously.

Protection foil tag color green vs. red: interesting. Mine is green as well. Maybe a hint for SH** controllers, maybe not. Thanks for the thread - helped a lot. Especially to get the SH1106 data sheet.

I believe I might have some relevant information for the OP here.

I too bought a cheaper Chinese display on Amazon (from Lanmu Direct), thinking it would work with the Adafruit SSD1306 driver code, although I was porting it to a different MCU (LPC-1769 from NXP, which is ARM Cortex-M3). In spite of having to convert things to C and such, I was able to make it work. Initially I had the same problems as shown in the pics of the OP (only 1/8 of the screen showing the logo). This turned out to be operation in Page Address mode instead of Horizontal Address mode that the SSD1306 was expecting. By modifying a few register sends in the inner loop, I was able to get my version of the Adafruit library code to do proper text and graphics on the full screen (minus the 2 pixel columns along each edge).

Now that I know the two parts are different, I have not had a chance to compare the data sheets, but I suspect that I will find that the SH1106 supports the same instructions for Page Mode that the SSD1306 does, which explains how I made it work. I couldn't get scrolling to work, so those aren't supported by the 1106 part, but screen inversion works, clearing the screen works, and the text and graphics features all work. I had to put a pixel offset of 2 in (the 1106 part is 132x64, not 128x64 like the 1306, so 2 columns on either edge aren't available), but I assume if you adjust the widths properly, you could also make the Adafruit code work.

If anyone is interested, I may put up a code snippet on Github to show how I modified the Adafruit library.

Best of luck to anyone who wants to save a few bucks on the display. But these parts are workable.

NOTE: I was using 4-wire SPI mode, so I didn't have to modify the jumpers on the back. The speed is worth it in my opinion, for anyone contemplating the SPI-vs-I2C decision.

Best wishes, Mike

golab: Protection foil tag color green vs. red: interesting. Mine is green as well. Maybe a hint for SH** controllers, maybe not. Thanks for the thread - helped a lot. Especially to get the SH1106 data sheet.

Interesting enough, I just received 2 I2C 128x64 (yellow/blue and white (mono)) with "read tag" and one I2C 128x64 white/mono with "green tag". All boards are have identical layout and no visible differences have been found. While "red tag" OLEDs worked out of the box with ADAFRUIT SSD1306, "green tag" one did not work at all. To make it work I had to add pullup resisters (270 om) on both lines (SDA,SCL) and use U8g2 library. Strange but it works fine for both types of controller: U8G2_SSD1306_128X64_NONAME_1_HW_I2C and U8G2_SH1106_128X64_NONAME_1_HW_I2C.

All OLEDs were connected to Arduino Nano and powered by 3.3V ext. supply.

Hello to all,

I'm going to reply to this post, even if it is quite old, to help if someone encountered the same problem attempting to use an OLED display. Recently I bought a 128x64 I2C OLED display from a german company through Amazon. The display was clearly of chinese manufacture but I bought it through Amazon spending some more Euros to get the piece faster and because the german company made available an ebook with a tutorial on how to install Arduino libraries and to get the demo program working. I want to premise that I'm a beginner with Arduino but a professional working with microcontrollers, compilers and digital devices since 30 years. The ebook from the german company stated to install Adafruit libraries and run the demo program but with great disappointment the OLED displayed only the first line of graphics with the remaining filled by random garbage pixels. I got the SSD1306 controller datasheet and looked at the Adafruit library code to understand what was wrong, but without success. Finally googling around I reached this post and saw that the photos published by Ian displayed the same problem I had with my display. Following the suggestions I installed the u8glib (really the more recent u8g2 library) and BINGO!! :) Now the display works fine and displays text and graphic correctly. More exactly in the library examples I used the following constructor for the display object:

U8X8_SH1106_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);

The teaching from this story is: 1) From now on I'll buy directly from china, probably having the same kind of problems (insufficient or bad documentation) but at least saving money. 2) Arduino is great, there is a lot of powerful and low cost hardware but this come at the cost of generic and inconcludent documentation from the manufacturers and importers. Fortunately there are places like this, the Arduino forum, with a lot of peoples experimenting and solving problems!! Hello to all and have a nice exprerimenting.

WORKING 1.3 inch OLED with I2C interface (from China) (128x64 pixel)

I was having the same issues as many of you here and found a solution that works well for me. There are several libraries for the SH1106 and the first one I found gave me a random display mess as many have described.

The WORKING library I found at:
https://github.com/wonho-maker/Adafruit_SH1106

I added some basic code in my project to switch between the 0.96" and 1.3" displays as follows:

#define OLED_096_INCH 1
#define OLED_130_INCH 2

#define DISPLAY_SIZE OLED_130_INCH // Select Display Size

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

#if (DISPLAY_SIZE == OLED_096_INCH)
#include <Adafruit_SSD1306.h>
#endif
#if (DISPLAY_SIZE == OLED_130_INCH)
#include <Adafruit_SH1106.h>
#endif

#define OLED_RESET 4

#if (DISPLAY_SIZE == OLED_096_INCH)
Adafruit_SSD1306 display(OLED_RESET);
#endif
#if (DISPLAY_SIZE == OLED_130_INCH)
Adafruit_SH1106 display(OLED_RESET);
#endif

void setup() {

#if (DISPLAY_SIZE == OLED_096_INCH)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
#endif
#if (DISPLAY_SIZE == OLED_130_INCH)
display.begin(SH1106_SWITCHCAPVCC, 0x3C);
#endif

// rest of the code is the same…

Cheers!

i have some problem(freeze screen) via 1.3 sh106 I2C in uno board
please help me

my library is Adafruit_SH1106-master