OLED Tutorial | Convert SPI to I2C




About: Hi, I'm Nemeen, Electronics Enthusiast! I have seen a huge decline in electronics hobbyist in past few years. I started this channel in order to inspire you to create. Hopefully, you will find something tha...

In this tutorial, we are going to learn about OLED displays. Which can be very easily interfaced with Arduino and can display important parameters for your project, and see how to convert these screens from SPI to I2C,

So let's get started!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Watch the Video !

If you don't want to read all the stuff You can watch my video Click Here

Step 2: SPI V/s I2C

These OLED displays come in various sizes and two different interface number one I2C which use the I2C bus of the Arduino and requires four pins to operate two for the power and the other two are SCL which is nothing but serial clock and SDA which is serial data.

Talking about SPI it is faster than I2C. But we generally prefer the I2C interface over the SPI because it requires fewer numbers of pins as compared to SPI but if you have SPI OLED you can easily convert it to I2C.

1.3 inch OLED SPI - https://www.gearbest.com/lcd-led-display-module/pp...

0.96 inch OLED I2C - https://www.gearbest.com/lcd-led-display-module/pp...

0.91 inch OLED I2C - https://www.gearbest.com/other-accessories/pp_0098...

Step 3: Convert SPI to I2C

If you flip around your display you will observe your display has indications to convert SPI to I2C (ICC means I2C). you will need to switch resistor from SPI to I2C and short the resistor path R8.

Now Vcc and the GND lines are the same but CLK will be your SCL, MOSI will be your SDA and you need to connect reset pin to Vcc and the other two pins to the GND

And now you can use the SPI OLED as I2C


not all models support conversion please check before you purchase

Step 4: Connections to Arduino

Now to interface this display to Arduino first we will need to connect the power and then connect SCL pin to SCL and the SDA pin to SDA pin of the Arduino. If you don’t know which pins you need to connect head over to the google and search I2C pins of the Arduino and here, you can see for the Arduino nano A5 is SCL and A4 is SDA. Similarly, you can do that for Arduino Uno and Arduino mega


Add 10K pull-up resistor to SDA & SCL to avoid random Freez

Step 5: Programming

Now to display the information on OLEDs we need to program the Arduino for that, we will be using u8glib library.

Open Arduino IDE, in Sketch Tab select, Include Library then Manage Library, Now search u8glib library, scroll down and install it.

Let’s start with the Hello World program,

Here first you need to know your display model number mine is SD1306. So in program you need to uncomment your display model number in order for it to work.

In all the function first two parameters are x and y coordinates by changing them you can change the position of the text

And the third parameter for this function is text which you can change

There are several other functions which can be used to display circle or ellipse

You should check out the reference manual for the library if you want to learn more


Step 6: Thank You

If you like my work

Feel free to check out my YouTube channel for more awesome stuff:


You can also follow me on Facebook, Twitter etc for upcoming projects




Check out JLCPCB
$2 PCB Prototype (10pcs,10*10cm): https://jlcpcb.com

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    11 Discussions


    3 months ago

    Hello Nematic. Thank you for posting the SPI to 12C
    I just received my SSD3106 and it is a new version they then the one you converted.
    My 3106 is missing the R1 and R8. From your video you moved a resistor and bridged R8
    I don't have a hot air gun so is it possible to add in a resistor to R1 and it looks to be a 472 ohm SDA resistor.

    OLED Photo.jpg

    7 months ago


    Thank you. Great tutorial! Clear instructions, pictures, video and examples.

    I have this 6-pin OLED display, which seems to be SPI, but the eBay seller listing it as I2C:


    It does not seem to have, or I cannot identify, the relevant selection resistor and pads to select between SPI and I2C. See attached image.

    Can you provide some advice on how to go about converting this OLED display to I2C, if possible?

    3 replies

    Reply 5 months ago

    Mate, the one you have is called 4 wire SPI. I believe you can change it to i2c by swapping the resistors on the back of the board.


    Reply 7 months ago

    Your disply is I2C you dont have to do anything just use standard I2C 4 pin config


    Reply 7 months ago

    Hi, thanks for the response. How can you tell it is I2C? I've already tried it. I replaced an existing and working I2C 128x32 OLED display, connecting to the same pins (GND, VCC, SCL, SDA) and it did not work. So, it is either faulty or it is SPI.


    Reply 8 months ago

    This is a 16 bit oled you can't use I2C with it, but however, you can use it in 3 pin SPI mode just short BS0 jumper


    9 months ago

    it just took 5 minutes.


    1 year ago

    thank you thank you thank you
    i have 2 of this display and they are spi and i hate spi i will try this when i go home and will post comment about the reslut

    2 replies

    Reply 1 year ago

    You hate SPI ? Physically, it's almost the same than I2C (not ICC but IIC), SPI is full duplex and doesn't need extra addressing.


    Reply 1 year ago

    will for beginner link me i like i2c because its only need 2 wire spi need 3 and sometime more and you can connect multi device so easy !