Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: OLED 0,96" vs. 1,3"

  1. #1
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32

    OLED 0,96" vs. 1,3"

    Hi all,
    I have Teensy 4 and two OLED displays. 0,96" works fine but on 1,3" I can see just random points.

    My code is:

    Code:
    #include <Wire.h>               // SCL pin 19, SDA pin 18
    #include <Adafruit_GFX.h>      
    #include <Adafruit_SSD1306.h>   
    
    Adafruit_SSD1306 display(128, 64, &Wire, -1, 1000000);  
    
    void setup()
    {
      display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
      delay(100);
      display.clearDisplay();
      display.display();
    }
    
    void loop()
    {
      display.clearDisplay(); // clear buffer
      
          display.setTextSize(1);
          display.setTextColor(1);
         
          
          display.setCursor(50,50);
          display.print("test");
    
          
        display.display();
        delay(1000);
      }
    Code and connection is the same.
    Maybe you can help me find where is poblem.
    Thanks a lot.


    Click image for larger version. 

Name:	oled1.jpg 
Views:	15 
Size:	91.8 KB 
ID:	23828
    Click image for larger version. 

Name:	oled2.jpg 
Views:	18 
Size:	170.4 KB 
ID:	23829

  2. #2
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    I would not be surprised if the 1.3" display is on another I2C-address. The zero ohm resistors near the 4 pin connector are differently strapped.
    Did you run the I2C scanner example sketch on both displays? [Examples > Wire > Scanner]

    Paul

  3. #3
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    You also may want to try to run at a lower I2C clock frequency:
    Code:
    Adafruit_SSD1306 display(128, 64, &Wire, -1, 400000);
    Paul

  4. #4
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32
    Scanner shows me the same address for both displays, 0x3C.

    I tried change frequency but no change.

    Click image for larger version. 

Name:	oled3.jpg 
Views:	11 
Size:	237.5 KB 
ID:	23830

  5. #5
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Allright. Now it's time to measure whether pullups are present the I2C lines.
    With the display disconnected from the Teensy, measure with an ohm-meter between the SDA pin and GND and between the SCL pin & GND.

    Paul

  6. #6
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32
    It is 0.54MOhm

  7. #7
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Allright, no I2C pullups apparently.
    So you know what to do I guess? See this post.

    Paul

  8. #8
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32
    OK, I added 2x 4.7k - see picture - is it correct or wrong assembly? I have the same wrong result. I tried change frequency, no change.
    Click image for larger version. 

Name:	oled4.jpg 
Views:	10 
Size:	117.7 KB 
ID:	23834
    Thanks

  9. #9
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Looks OK to me.
    Could it be that your 1.3" OLED has a different controller, like the SH1106? [I see 1.3" OLEDs offered with that SH1106 controller]
    Last edited by PaulS; 02-24-2021 at 07:00 PM.

  10. #10
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    When searching further about the difference between an SSD1306 and a SH1106, I saw some display pictures looking very similar to your picture in message #4.
    Here is such a thread.
    And another thread. The solution is in message #11 of this thread.

    Hope this helps,
    Paul

  11. #11
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32
    now it works, good job PaulS :-)

    Click image for larger version. 

Name:	oled5.jpg 
Views:	9 
Size:	143.5 KB 
ID:	23837

  12. #12
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Great! [nice demo to show appreciation, haha]
    What was the issue in the end? Was it indeed an SH1106 controller on the 1.3" OLED?

    Regards,
    Paul

  13. #13
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32
    Yes, pullups and SH1106. 👍

  14. #14
    Junior Member
    Join Date
    Mar 2021
    Posts
    5

    RE: mounting

    Quote Originally Posted by frohr View Post
    now it works, good job PaulS :-)

    Click image for larger version. 

Name:	oled5.jpg 
Views:	9 
Size:	143.5 KB 
ID:	23837


    I love these little displays i've just struggled on coming up with a good mounting solution for them in my project box's

    Anyone have any suggestions?

  15. #15
    Member
    Join Date
    Nov 2020
    Location
    Czech Republic
    Posts
    32
    I use just 3d printed box according oled display dimensions and then hot gun glue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •