# 128x64 OLED

**URL:** <https://forum.arduino.cc/t/128x64-oled/281206>\
**Category:** Displays\
**Created:** [January 10, 2015, 1:09am UTC](https://forum.arduino.cc/t/128x64-oled/281206 "2015-01-10T01:09:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 10, 2015, 1:09am UTC](https://forum.arduino.cc/t/128x64-oled/281206/1 "2015-01-10T01:09:09Z")

</div>

Hi all,

I have purchased a OLED display but it is very confusing

[http://www.ebay.co.uk/itm/121513407102?\_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT](http://www.ebay.co.uk/itm/121513407102?_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)

Here is what is says on the advert

> 100% brand new and high quality  
> No font: take the word with modulo software  
> Needn't backlight, the display unit can self-luminous
> 
> Specifications:  
> High resolution: 128 \* 64  
> Viewing angle:\> 160掳  
> Supports many control chip: Fully compatible with Arduino, 51 Series, MSP430 Series, STM32 / 2, CSR IC, etc.  
> Ultra-low power consumption: full screen lit 0.04W  
> Voltage: 3.3V ~ 5V DC  
> Working Temperature: -30 鈩?~ 80 鈩?Module Size: 27.0MM \* 27.0MM \* 4.1MM  
> SPI Interface, need 4 IO only.  
> Driver IC: SSD1306  
> Light color: Yellow+blue  
> Pin Definitions:  
> VCC:3.3-5V  
> GND: grounding  
> CLK: clock module  
> MOSI: Data input  
> Cs: Chip select signal  
> D/C: Command / data change
> 
> Package includes:  
> 1 x Yellow+Blue 0.96" SPI Serial 128X64 OLED LCD Display Module

As you can see is says it's SPI but the pins look like I2C (to me!) also on the actual device it has SDA+SCL but also D/C. Also it weas cheap so I am starting to think there is something missing, so at this point i am totally confused.

Here are my questions

- Does it look like I can connected this to a nano and get it working

- Is there any other hardware needed

- Is it SPI or I2C

- If it is I2C where do these lines go to on the nano (I am using the Adafruit SSD1306 libs + examples for 128x64 OLED display)

- RST

- D/C

I have tried to get this working with both SPI and I2C but ~~think~~ **KNOW** I got confused :-\

Thanks in advance

Steve

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [January 10, 2015, 7:46am UTC](https://forum.arduino.cc/t/128x64-oled/281206/2 "2015-01-10T07:46:42Z")

</div>

Hi

This OLED has an SPI interface.

Same display has been diskussed here: [OLED Display question - #11 by olikraus - Displays - Arduino Forum](http://forum.arduino.cc/index.php?topic=289282.msg2028189)

Remarks:

1. D/C is the Data/Command line (A0 in U8glib).
2. This display has no CS (Chip Select) line, which may or may not work

Oliver

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [January 10, 2015, 8:30am UTC](https://forum.arduino.cc/t/128x64-oled/281206/3 "2015-01-10T08:30:18Z")

</div>

Maybe you can connect the SCL/SDA lines (plus power/gnd) to the arduino and use an I2C scanner like [here](http://playground.arduino.cc/Main/I2cScanner) to see if it finds anything. If it does then it's I2C if not then maybe it is SPI.

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [January 10, 2015, 8:51am UTC](https://forum.arduino.cc/t/128x64-oled/281206/4 "2015-01-10T08:51:33Z")

</div>

@Riva  
Some displays may be invisible to the the I2C scanner due to the fact that they do not send a proper ACK response. This was discussed (and solved) here: [Problem with SSD1306 LCD and U8glib - Displays - Arduino Forum](http://forum.arduino.cc/index.php?topic=219419.0). So, if the i2c does not find a device, it does not mean anything.

Anyway, the OP has a SPI display.

Oliver

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 10, 2015, 9:07am UTC](https://forum.arduino.cc/t/128x64-oled/281206/5 "2015-01-10T09:07:31Z")

</div>

Quick reply @ Oliver, this is not the same display as you posted a link to (see pictures) but I will try to figure it out from all the info so far, but if anyone give shine more light on this it would be helpful.

Thanks everyone so far.

Steve

Hmmm, failed to load pics, maybe it's because I'm new....

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 10, 2015, 9:27am UTC](https://forum.arduino.cc/t/128x64-oled/281206/6 "2015-01-10T09:27:40Z")

</div>

back again,

Maybe I just don't get it but as I try to figure how to wire this I keep hitting the same issue, when I look at this display it has printed on the PCB SCL, SDA, RST and D/C, does SCL+SDA not indicate I2C. if this is SPI why are they not labelled MISO+MOSI and where are the SCK + SS

Here is what I have tried so far without success.

Display -- Nano

SCL -\> SCL (A5)  
SDA -\> SDA (A4)  
D/C -\> D3  
RST -\> D5  
VCC -\> 5v  
GND -\> GND

```cpp
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// If using software SPI (the default case):
//#define OLED_MOSI  9
//#define OLED_CLK  10
//#define OLED_DC    11
//#define OLED_CS    12
//#define OLED_RESET 13
//Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

// Uncomment this block to use hardware SPI
#define OLED_DC    6
#define OLED_CS    7
#define OLED_RESET  8
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
//*/

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2

#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{ B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000 };

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

void setup()  {                
  Serial.begin(9600);
  
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC);
  // init done
  
  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();

  // draw a single pixel
  display.drawPixel(10, 10, WHITE);
  // Show the display buffer on the hardware.
  // NOTE: You _must_ call display after making any drawing commands
  // to make them visible on the display hardware!
  display.display();
  delay(2000);
  display.clearDisplay();

 ........... full Code was not allowed > 9000 characters

```

Thanks

Steve

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 10, 2015, 12:49pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/7 "2015-01-10T12:49:39Z")

</div>

@ Oilver

I used your U8gLib and the GraphicsTest example with this construct

U8GLIB\_SSD1306\_128X64 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

and the nano connected like this

Display -- Nano  
SCL -\> 13 (D10)  
SDA-\> 11 (D9)  
D/C -\> 9 (D6)  
RST -\> NC  
VCC -\> 5V  
GND -\> GND

Still nothing.....

Steve

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [January 10, 2015, 2:48pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/8 "2015-01-10T14:48:17Z")

</div>

Hi

You could try this:

```cpp
U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9, 8);  // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8

```

Display -- Nano  
SCL -\> 13 (D10)  
SDA-\> 11 (D9)  
D/C -\> 9 (D6)  
RST -\> Arduino Pin 8  
VCC -\> 5V  
GND -\> GND

As i mentioned before, I have no confirmation, that this kind of Display (without CS) works with any Arduino library.

Oliver

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 10, 2015, 4:19pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/9 "2015-01-10T16:19:57Z")

</div>

Hi Oliver,

Connected up like you said but still nothing, it's looking like this display will not work. What is the cheapest you have seen that will work?

Steve

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [January 10, 2015, 4:27pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/10 "2015-01-10T16:27:26Z")

</div>

> scarr:  
> Hi Oliver,
> 
> Connected up like you said but still nothing, it's looking like this display will not work. What is the cheapest you have seen that will work?
> 
> Steve

I have one of [these](http://www.ebay.co.uk/itm/High-Quality-0-96-IIC-Serial-128X64-OLED-LCD-Display-Module-For-Arduino-Tool-/251550002026?pt=UK_Computing_Other_Computing_Networking&hash=item3a918c6b6a) and it works fine with Adafruit library.

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [January 10, 2015, 4:51pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/11 "2015-01-10T16:51:00Z")

</div>

Hava a look at my gallery page: [Google Code Archive - Long-term storage for Google Code Project Hosting.](https://code.google.com/p/u8glib/wiki/gallery)

SPI: Must have MOSI & SCK (or D0/D1), CS and C/D pin (usually six pins)  
I2C: Must have SCL and SDA pins (usually four pins)  
Additional reset line is ok for both displays.

Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 10, 2015, 6:44pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/12 "2015-01-10T18:44:31Z")

</div>

I also purchased this display on ebay and have been going crazy trying all sorts of stuff. I was able to get at least a flickering screen using the U8glib examples and this constructor:

U8GLIB\_SSD1306\_128X64 u8g(13, 11, U8G\_PIN\_NONE, 9);

I don't know if the flickering means anything that would lead anyone else with more experience to chime in. I'm at a loss and could use any advice available. BTW, I used the 3.3v on my UNO and not the 5v line.

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 10, 2015, 9:58pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/13 "2015-01-10T21:58:09Z")

</div>

@ Riva, If you would answer the following maybe I can get it working

1. What Arduino did you use?

2. I Assume is was I2C you used?

3. Can you list pin to pin for us?

Thanks

Steve

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [January 11, 2015, 8:08am UTC](https://forum.arduino.cc/t/128x64-oled/281206/14 "2015-01-11T08:08:23Z")

</div>

> scarr:
> 
> 1. What Arduino did you use?  
> I tested it on an UNO
> 
> 2. I Assume is was I2C you used?  
> Yes, that's the only interface it has.
> 
> 3. Can you list pin to pin for us?  
> GND to GND on arduino  
> VCC to 5V  
> SDA to A4  
> SCL to A5

I then used an I2C Scanner sketch to find the address used for the module and ensured this is the same as used in the AdaFruit 128x64 example sketch downloaded with there library.

```arduino
 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x64)

```

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [January 11, 2015, 8:34am UTC](https://forum.arduino.cc/t/128x64-oled/281206/15 "2015-01-11T08:34:15Z")

</div>

Just to avoid further frustration: The procedure from Riva will work with all Adafruit products. It will also work with 50% of the desplays from various market places.

If the procedure, mentioned by Riva, does not work then:  
A) it may have a different controller, namly the SH1106, which is not supported by the Adafruit lib, or  
B) it may not produce the correct ACK signal on the I2C line. In this case it will not be recogniced by the I2C scanner and also the Adafruit lib will not work.

Another suggestion: You select an interessting OLED from one of the marketplaces. Paste the link here and we give our comments whether we assume it will work or not.

Oliver

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 13, 2015, 6:53pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/16 "2015-01-13T18:53:05Z")

</div>

Hi All,

@ Riva

OK so I purchased a display just like yours (4 pin) SDA/DCL/GND/VCC tried it with the Adafruit

ssd1306\_128x64\_i2c example sketch and only changed the address to 0x78 on line 61 as this is the address set on the back of the display.

First tried with a Nano using SDA/SCL A4/A5 then on a UNO SDA/SCL (TWCK0/TWD0) still nothing! what am I doing wrong

P.S. here is the part I purchased

[http://www.ebay.co.uk/itm/131265232056?\_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT](http://www.ebay.co.uk/itm/131265232056?_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)

Thanks

Steve

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [January 13, 2015, 7:18pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/17 "2015-01-13T19:18:42Z")

</div>

The same display?  
Riva:   
Steve:

The heltec displays are known not to send the ACK signal (see above). Funny, although Riva's display is cheaper, it fully supports I2C.

@Steve: Try:

```cpp
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

```

Oliver

---

<div class="post-metadata">

**Author:** ![scarr](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@scarr](https://forum.arduino.cc/u/scarr)\
**Post date:** [January 13, 2015, 11:01pm UTC](https://forum.arduino.cc/t/128x64-oled/281206/18 "2015-01-13T23:01:30Z")

</div>

Oliver, thanks for pointing that out ☹ I can't believe there are so many variations!

OK, before I buy it, is this one good?

[http://www.ebay.co.uk/itm/0-96-Inch-I2C-IIC-Serial-128-x-64-OLED-LCD-LED-Display-Module-For-Arduino-/271719319564?pt=UK\_Computing\_Other\_Computing\_Networking&hash=item3f43bbc80c](http://www.ebay.co.uk/itm/0-96-Inch-I2C-IIC-Serial-128-x-64-OLED-LCD-LED-Display-Module-For-Arduino-/271719319564?pt=UK_Computing_Other_Computing_Networking&hash=item3f43bbc80c)

Thanks

P.S. Your suggestion didn't work, but thanks for trying.

U8GLIB\_SSD1306\_128X64 u8g(U8G\_I2C\_OPT\_NO\_ACK);

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [January 14, 2015, 7:36am UTC](https://forum.arduino.cc/t/128x64-oled/281206/19 "2015-01-14T07:36:36Z")

</div>

> scarr:  
> OK so I purchased a display just like yours (4 pin) SDA/DCL/GND/VCC tried it with the Adafruit
> 
> ssd1306\_128x64\_i2c example sketch and only changed the address to 0x78 on line 61 as this is the address set on the back of the display.
> 
> First tried with a Nano using SDA/SCL A4/A5 then on a UNO SDA/SCL (TWCK0/TWD0) still nothing! what am I doing wrong

I used an I2C scanner and set the address to what it found (0x3C in my case)

```arduino
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x64)

```

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [January 14, 2015, 7:44am UTC](https://forum.arduino.cc/t/128x64-oled/281206/20 "2015-01-14T07:44:40Z")

</div>

> olikraus:  
> The same display?

I'm at work so will have to wait until go home and check this. I did look up purchase history on eBay but the display is not showing for some reason (I wanted to be sure about the seller). I do keep a list of stuff I bought but just the title and price and the top eBay search entry looks to be the same.

> High Quality 0.96" IIC Serial 128X64 OLED LCD Display Module For Arduino Tool £3.25

I will take pictures when I have it in my hands again.

[Next page](https://forum.arduino.cc/t/128x64-oled/281206.md?page=2)
