Skip to main content

Using a Monochrome 1.3" 128x64 OLED display

What is the OLED monochrome display?

The OLED monochrome display is a small (tiny) and high-readability display. It is useful for displaying data, e.g. weather information or small graphics like what you see on Tamagotchi. For more information, please visit here.

In this tutorial, we will be using Adafruit SSD1306 128 x 64 OLED with I2C communication. It can support SPI communication as well.

Display Configuration
If you have the older non-STEMMA version of the OLED, you'll need to solder the two jumpers on the back of the OLED. Both must be soldered 'closed' for I2C to work!

Wiring

Wiring up the sensor is simple:

  1. Power (VIN to 5V)
  2. Ground (GND to GND)
  3. Data to Arduino SDA pin (A5 on Uno)
  4. CLK to Arduino SCL pin (A4 on Uno)

Library

To use this code you will need the Adafruit_SSD1306 Library. We have a tutorial on how to install a library here.

Getting started

We will be using the example code ssd1306_128x64_i2c from the Adafruit_SSD1306 library.

Change the OLED_RESET pin from -1 to 4.

#define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)

Create your own bitmap

Create your pixel art

Piskel is a free online tool for you to create pixel art. You can specify the canvas size, import images, draw your own graphics etc, and then export it as a PNG.

piskel

Convert your image into bitmap code

image2cpp was created by GitHub user javl and provides a handy way to create bitmaps without installing any additional software. Know more here.

Upload your image, select your preferred image settings, and generate code!

image2cpp

You will see the code generated at the bottom and you can paste it in Arduino directly. Screenshot 2024-04-24 at 11.53.32.png