Skip to content
My Account

Electronics

Show Your Own Logo on an OLED with an Arduino Nano

An Arduino Nano and an SSD1306 OLED on I2C that shows a black and white logo, with the Adafruit libraries.

  • Arduino
  • 2 min read
No ratings yet, be the first.

A small OLED display on an Arduino Nano that shows your own logo. The display talks over I2C and needs only four wires, and the logo is a black and white bitmap stored in the program.

There is also a version for a much smaller chip, in 0.91-inch OLED Display on an ATtiny85. For the display itself, see the SSD1306 OLED display guide.

Wiring

The display has four pins: VCC, GND, SCL and SDA. On an Arduino Nano, I2C uses A4 for SDA and A5 for SCL.

Display pinArduino Nano pin
VCC5V or 3V3, as your display supports
GNDGND
SCLA5
SDAA4
Diagram of an OLED display and an Arduino Nano on a breadboard, connected with power and two data wires

Libraries

The sketch uses the Adafruit libraries for the SSD1306 driver. Install these in the Library Manager of the Arduino IDE:

  • Adafruit SSD1306
  • Adafruit GFX Library

The sketch

The display is set up as 128 by 64 pixels on I2C address 0x3C. The loop clears the display, draws the bitmap and waits eight seconds:

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);

static const unsigned char PROGMEM StudioPieters_glcd_bmp[] = {
  // the bytes of your bitmap
};

void setup() {
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(1000);
  display.clearDisplay();
  display.display();
}

void loop() {
  display.clearDisplay();
  display.drawBitmap(0, 0, StudioPieters_glcd_bmp, 128, 64, 1);
  display.display();
  delay(8000);
}

The first display.display() shows the splash screen of the Adafruit library, which is why the sketch waits a second and clears the display before the loop starts.

Good to know

  • The repository holds the sketch, the logo and the images, and is under the MIT licence.

The project is in the Arduino-OLED-I2C repository on GitHub.

Advertisement
All projects

More projects

Keep building.

Electronics, 3D printing and CNC builds, documented from the first idea to the last screw.

All projects