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

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

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.

1 Like

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

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.

1 Like

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.

4 Likes

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.

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

1 Like

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.

4 Likes

I am having this same issue, while interfacing with Arduino Nano, How to solve it?
I am completely new to


these topics.
I had also attached my wiring diagrams for reference.

This is forum for devices from Particle–it looks like you have an Arduino there. You will get better help in a forum for you particular device.

That said the usual problem is no pull-up resistors on the SCK and SDA.

It also look like you are using a resistor to power a 3.3V display from a 5V supply which I really cannot recommend. Lots of other ways to get 3.3V that are better if you do some research.

Your pull-up resistors go from the SCK and SDA pins on the display to display supply pin. Any value from 2.2k to 4.7k ohm should be fine. If you have buy something, get 4.7k ohm.

Your processor may be able to use internal pull-up on these lines but with the mix of 3.3V and 5V systems, I cannot recommend that either.

2 Likes