Problem with SainSmart SPI 1.3" OLED

Well, today i got my Sainsmart OLED, which i ordered because i thought i broke the chinese OLED while Soldering the Jumper for I2c.

I changed the code to spi

//----- OLED instance
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13

And i wired everything up (i got a white cable) on my breadboard with a arduino pro mini 3.3v 8mhz OLED -> Arduino 3.3V -> VCC Ground -> GND SDIN -> D9 SCLK -> D10 DC -> D11 RST -> D13 CS -> D12

3.7V from Lipo -> Raw Ground -> GND

and now it looks exactly like the first OLED from China.

What did i have done wrong? I cant imagine i got 2 dead OLEDs in a row. I tested the first one with my Raspi too, and i got the same image. Atleast, i hope they arent dead :) Thanks for every help ~Straw


A quick look at the description from sainsmart: Driver IC: SH1106
An SH1106 does not work with the SSD1306 library from Adafruit. T

However, the SH1106 is almost (but not fully) compatible with the SSD1306. This makes some far east vendors sell their OLEDs as SSD1306 compatible devices, which is misleading.

Try u8glib, at least to ensure that your display is not broken.


Could you help me with the wiring? i tried to use the hello world sketch from the library, but dont know how to wire a0, because the sainsmart oled dont got any pin with this label

thanks :)



I know it's been since December 2014, I hope you've gotten past there from now. I stumbled on this page with the same question, but now that I have an answer of mine I thought I'd post it:

  • I use the U8GLIB library
  • I configured it with the hardware SPI

My pin configuration is:

  • CS = Pin 9
  • RST = Pin 6
  • DC = Pin 7
  • SCLK = Pin 13
  • SDIN = Pin 11
  • Gnd = Gnd
  • 3.3V = 3V3

Note the pins are labelled from left to right if the J1 connector is at the bottom and the flat oled cable is on the top. The pin names (CS, RST, etc) are written up-side down on the left.

Here is how I initialized my library:

#include "U8glib.h"
#define DISP_CS 9
#define DISP_A0 7
#define DISP_RST 6
  U8GLIB_SH1106_128X64 u8g(DISP_CS, DISP_A0, DISP_RST);

Hope that helps you or others who stumble across here.


Thanks for posting. Not sure why i missed your previous post :(