SSD1306 Monochrome OLED with Arduino

Last Updated on 14 October 2023 by Suffocation

I'd like to connect a small 128x64 pixel OLED display for a small project. I've developed a small prototype for this which I'd like to present here.

Ich betreibe das Display an einem Arduino Uno über den Wire Bus.

Components

Hardware

  • Arduino Uno or similar
  • OLED Display SD1306
  • Prototype shield or a breadboard
  • A few connecting cables

Software

  • Arduino IDE (Installation)
  • Adafruit Adafruit_SSD1306 Unified Library
  • Test programme from the library

Experimental setup

I'm using the prototype add-on board (See here).

The display is powered by the Arduino. Additionally, data communication takes place via the Wire bus, which is located on ports A4 and A5 of the Arduino Uno.

Schematic

Library

There are also other libraries for the SD1306, but the Adafruit one, with minor adjustments, was the easiest for me to use. With others, I also had the problem that the Arduino's memory was too small.

Either get the latest version via GITHUB or install it via the library manager.

https://github.com/adafruit/Adafruit_SSD1306

As it goes here.

Programming

Library preparation

A very annoying characteristic of the Adafruit library is that the display size define in the preprocessor has to be changed within the library. This is set to 128x32 pixels by default.

Also search the library on the hard drive, the file is named:

Adafruit_SSD1306.h

In the current version, line 74 is commented out and line 73 is reinstated.

Example programme

I am using an example program belonging to the library:

Pfad: Adafruit SDD 1306 -> sdd1306_128x64_i2c

How to choose a test program you will find here.

Upload the program to the Arduino, and it should all work then.

Further projects

Sources

https://github.com/adafruit/Adafruit_SSD1306

Leave a Reply

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