Pandabyte OLED Module: Display Output Guide

by pandabyte in Circuits > Arduino

16 Views, 0 Favorites, 0 Comments

Pandabyte OLED Module: Display Output Guide

oled.jpg

Pandabyte OLED Module is a compact display module used for learning graphical display output with microcontrollers such as Arduino compatible boards, ESP32, or Raspberry Pi Pico.

The module contains a 0.96 inch OLED display that communicates using the I2C interface, making it simple to connect using only two wires.

A key feature of this module is that it supports two connection methods:

  1. Traditional male headers for standard jumper-wire connections
  2. OR
  3. 4-pin Grove connector for quick plug-and-play prototyping

In this guide, you will learn:

  1. Module pin configuration
  2. I2C communication
  3. OLED text display
  4. Circuit connections
  5. Arduino programming examples


Supplies

item list.png

Hardware:

  1. PandaByte OLED Module
  2. Development Board (We will use PandaByte xC3m ESP32C3 Dev board)
  3. Grove Shield/Expansion Board
  4. Cables: Dupont, USB, and Grove

Software:

  1. Arduino IDE
  2. Adafruit SSD1306 Library
  3. Adafruit GFX Library

Library Links:

  1. https://github.com/adafruit/Adafruit_SSD1306
  2. https://github.com/adafruit/Adafruit-GFX-Library

Circuit Connections

oled.png

Perform the connection based on the table.

Install the Libraries

  1. Open Arduino IDE
  2. Go to:
  3. Sketch → Include Library → Manage Libraries
  4. Search and install:
  5. Adafruit SSD1306
  6. Adafruit GFX

Programming

Program : Hello World Display

Display “Hello World” on the OLED screen.

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

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

#define OLED_RESET -1

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup() {

// Initialize I2C
Wire.begin();
// Wire.begin(1, 0);

// Initialize OLED Display
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
while(true);
}

display.clearDisplay();

display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);

display.setCursor(10, 20);

display.println("Hello");
display.println("World!");

display.display();
}

void loop() {

}

Output

The OLED screen will display:

Hello

World!

Important Info

The module uses a 0.96 inch I2C OLED display.

Communication is performed using the I2C protocol.

OLED display can have one of the following I2C addresses:

  1. 0x3C or 0x3D
  2. The address can be selected by moving the slide switch at the back of the OLED module

On PandaByte xC3m Dev Board:

  1. SDA → GPIO 1
  2. SCL → GPIO 0

The display resolution is:

  1. 128 × 64 pixels

Multiple text sizes and graphics can be displayed using the Adafruit GFX library.