OLED 4pin I2C (GND VDD SCK SDA) with Photon [SOLVED]


#1

Hi folks,

after spending hours on searching hopefully you can help me.

I’ve got a 4pin OLED display with the description GND VDD SCK SDA. This should be then SPI.
I tried several combinations of wiring it with my photon and running it with “Adafruit_SSD1306/Adafruit_SSD1306.h”.
Sadly, without any success. Could anyone give me a hint, how to wire and code it.

I tried the following:
define OLED_DC D3 [wired to SDA]
define OLED_CS D4 [wired to SCK]
define OLED_RESET D5 [not wired]
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);

GND is wired to GND and VDD to 3,3V.

I switched SDA/SCK but this also didn’t work.
Almost all descriptions are covering the 6pin display.

Thanks for any comment
Stefan


#2

SPI would at least require three lines (CS, SS, MOSI)
And these are A2, A3, A5 on the HW SPI interface.

And as it happens very similar questions where asked before

But if you only have four pins you are not dealing with SPI but with I2C I’d say and that would be D0/D1 for SDA/SCK.

Providing a link to a datasheet for your exact board would remove all need for guesses.


#3

Hi ScruffR,

thanks for your reply and the blog link.
I tried it with several combinations, but nothing worked.
The display is an GM009605 from here https://www.amazon.de/Zoll-serielle-OLED-Display-Modul-Arduino/dp/B00NHKM1C0/ref=sr_1_1?s=ce-de&ie=UTF8&qid=1487070756&sr=1-1&keywords=0%2C96+Zoll+I2C+IIC+SPI+serielle+128+x+64+OLED+LCD

But it has SCK instead of SCL. Here is a picture:

and here the test code:

Any ideas?

Thanks a lot
Stefan


#4

You can verify the wiring and the I2C address with the I2C scanner used in this thread.

Once you can talk to it, well the rest is easier.


#5

Hi @steb

I don’t see any pull-up resistors in your photo. If the display board does not have its own pull-ups, you need to add them. A pair 4.7k ohm to 3.3V for each line is the traditional value but if you don’t have that exact value, anything from 1k to 10k will work.


#6

I bought a similar screen, but don’t have the exact pinout I used. This is the photo I have. Looks like D0 to the far right pin, and D1 to the second pin. I did use VIN for VCC (5V).

And here is the sketch that was called for that particular project: https://github.com/Here-Be-Dragons/Photon-Weather-Station/blob/master/weather-screen.ino

The one thing I would try changing would be to change the I2C address to 0x3C, and check for any indications on the back for what could be a different address from the two known.


#7

Thank you all for answering!!!

The trick was to add the resistors for the pull-up.
@bko: You’re my man :wink: Thanks.

@qwerty: You OLED is based on SCL. My has SCK, exactly this was the problem. It was confusing, because I received two different OLEDs from the same provider.

And here is the datasheet, they finally send to me:

Cheers
Stefan


#8

Just to clarify here:
4-wire SPI does not include the Vcc/GND pins but refers to the 4 dedicated SPI lines CS/SS, SCK, MOSI & MISO.
This display fearures a 2-wire inteface and in this particular case I2C.

For that reason I’d alter the topic title (which was: “OLED 4pin SPI (GND VDD SCK SDA) with Photon”) accordingly.