Particle IoT

Interface Photon with OLED (SPI)

particle logo

Interface Photon with OLED

Want your Photon to display sensor reading or any other information. OLED display can be a perfect fit for this purpose. This is a 0.96 inch blue OLED display module. The display module can be interfaced with any microcontroller using SPI/IIC protocols. It is has a resolution of 128x64.

OLED (Organic Light-Emitting Diode) is a self light-emitting technology composed of a thin, multi-layered organic film placed between an anode and cathode. In contrast to LCD technology, OLED does not require a backlight. OLED possesses high application potential for virtually all types of displays and is regarded as the ultimate technology for the next generation of flat-panel displays.


  • OLED Driver IC: SSD1306
  • Resolution: 128 x 64
  • Visual Angle: >160°
  • Input Voltage: 3.3V ~ 6V
  • Compatible I/O Level: 3.3V, 5V
  • Mini Size: 2.7 x 2.8cm
  • Only Need 2 I/O Port to Control
  • Pixel Color: Blue
  • Full Compatible with Arduino
  • Working temperature: -30°C ~ 70°C
  • Module volume ( generous ): 27.0 x 27.0 x 4.1mm
  • Factory configured for SPI protocol (can be easily changed to IIC)

Setting up SPI/I2C Connection with GMS096A OLED Module

For the SPI setup, the module comes in 4 wire SPI configuration by default and to make it work with the arduinos you can use these libraries from Adafruit.

For the I2C setup it demands a little bit of work on the module. Start with resoldering the resistor from position R3 to R1 and then short the R8 resistor with some solder tin (0 Ohm resistor). The R6 and R7 pullup resistors are already soldered, nothing to do there. Once done, the module is ready for I2C communication! The CS Pin is not necessarily needed, so just connect it to GND. The DC Pin selects the address. For standard address wire it to GND. The RES-pin needs a low pulse at startup and high voltage during operation (as in SPI mode), a 100nF capacitor to GND and a 10k res to Vcc would be ideal!

Step 1: Materials Needed

  1. A Breadboard (
  2. Power Supply unit (
  3. Jumper Wires (
  4. OLED Display(

Step 2: Connect Photon with OLED (SPI)

Connect Photon with OLED as shown in the diagram.

  • D0 ---- SDA
  • D1 ---- SCK
  • D2 ---- DC
  • D3 ---- CS
  • D4 ---- RES

Step 3: Software integration for OLED

Login to the url

Opens up the Web IDE. On the lefthand side you will see the Libraries option. Click on it and search for Adafruit_SSD1306. You have to do some modification in the example code. Please refer the video for implementation

Customise the display

Modify the example code as shown to get customised output.

#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306.h"

// Uncomment this block to use hardware SPI
// If using software SPI (the default case):
#define OLED_MOSI   D0
#define OLED_CLK    D1
#define OLED_DC     D2
#define OLED_CS     D3
#define OLED_RESET  D4

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

void setup()   {                
    // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
    // init done
    display.display(); // show splashscreen
    display.clearDisplay();   // clears the screen and buffer
    // text display tests
    display.println("Hello, world!");
void loop() {

Will get us the following output.