NederlandsKlik deze knop voor de Nederlandstalige website

Adding a 128×64 pixels white OLED display to your Arduino project

Nowadays, OLED screens for electronics projects are very affordable. They come in many shapes and sizes. Some are monochrome or two color but you can also get full color screens. They are definately worth a look when your Arduino projects needs to display some shar, crisp output. This post is about a nice little 128×64 pixels white OLED display based on the SSD1306 OLED driver IC.

0.96 inch 128x64 pixels white OLED display 6 pin SPI module
White 0.96 inch 128×64 6 pin SPI OLED display module

Getting it to work

I was trying to get a tiny 0.96 inch monochrome (white) screen from VNG Systems to work on my Arduino Uno and Nano. It has a resolution of 128×64 pixels and has a nice sharp and bright image. It is a 6 pin SPI version. As the instructions suggested, I hooked it up to my Nano and installed the U8glib library. Unfortunately I could not get it to work, and after a while of tinkering around I decided to find a different approach. After some Googling I tried rewiring the connections and finaly got it working with the Adafruit SSD1306 library,

Connecting the 0.96 Inch 128×64 pixels white OLED display module

This screen is the 6 pin SPI version, so hooking it up to your Arduino is easy. I found some different approaches on the internet but this is what worked for me. Connect the screen to your Arduino like this:

OLEDArduino
GNDGND
VCC5V
SCLD10
SDAD9
RESD13
DCD11
The 0.96 inch 128x64 pixels white OLED module displaying text
The 0.96 inch 128×64 pixels white OLED module displaying text

Installing and modifying the Adafruit SSD1306 library

Start the Arduino IDE and install the Adafruit SSD1306 library:

  • Go to Sketch > Include library > Manage libraries
  • Search for ‘SSD1306’, then select and install the Adafruit library

Then open the file ‘Adafruit_SSD1306.h‘ (located in your libraries folder, for me it was in ~/Arduino/libraries/Adafruit_SSD1306/).

Find the lines:

and change it to:

Note: If you’re using Windows and have trouble opening or editing the file, use a text editor like Notepad++ instead of Window’s default Notepad.

Don’t forget to save the file!

Running the example sketch

Now it’s time to test your display. You can do so by using the example sketch ‘ssd1306_128x64_spi‘ which comes with the SSD1306 library.

  • Go to File > Examples > Adafruit SSD1306
  • Load the ‘sd1306_128x64_spi’ sketch

Compile and upload it to your Arduino and you shoud see the demo animations. Study the exampe to see how you can incorporate the OLED screen into your own projects!

The 0.96 inch 128x64 pixels white OLED module displaying animations
The 0.96 inch 128×64 pixels white OLED module displaying animations
0.96 Inch White SPI OLED Display Module 12864 LED For Arduino
Tested and recommended by OneGuyOneBlog.com:

0.96 Inch White SPI OLED Display Module 12864 LED For Arduino

This post is also available in Dutch.

Add a Comment

Your email address will not be published. Required fields are marked *