I2C OLED display example

This example shows how to connect an I2C OLED display to one of my Arduino’s. Being relatively small size, requiring only 2 connections SDA and SCL from the Arduino but still having good text and graphical capabilities I snapped a couple up cheaply on the net. Here is a picture of the OLED display I bought, these are common on many sites at the moment

i2c oled lcd

i2c oled lcd

The first problem was connecting it up, this proved straightforward enough as the display can take standard 5v and GND and as its an I2C device on my Arduino UNO I hooked up A4 and A5 which are SDA and SCL respectively



Pin LabelArduino PINI2C FunctionNotes
VCCPowerPowerRegulated 5V supply.
SDAA4SDASerial data in
SCLA5SCL I2C clock



Now finding a working library proved to be problematic, I tried various ones and no success, eventually I located the Multi LCD library and have mirrored it at the following link

There are a few examples but here is a basic hello world that will show you how to display some text



#include <Arduino.h>
#include <Wire.h>
#include <MicroLCD.h>
//LCD_SH1106 lcd; /* for SH1106 OLED module */
LCD_SSD1306 lcd; /* for SSD1306 OLED module */
void setup()
void loop()
lcd.println("Hello, world!");
lcd.println("Hello, world!");




I2C 128X64 OLED LCD LED Display Module For Arduino on Amazon

I2C OLED displays on Amazon UK

0.96″ 128×64 I2C Interface White Color OLED Display Module for Arduino / RPi / AVR / ARM / PIC