Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use OLED: Examples, Pinouts, and Specs

Image of OLEDDesign with OLED in Cirkit Designer

Introduction

An Organic Light Emitting Diode (OLED) is a type of display technology that uses organic compounds to emit light when an electric current is applied. It is known for its high contrast ratios, deep blacks, and wide viewing angles. OLED displays are commonly used in various applications, including:

Explore Projects Built with OLED

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!

Technical Specifications

Key Technical Details

Parameter Value
Display Type OLED
Resolution 128x64 pixels
Interface I2C / SPI
Operating Voltage 3.3V - 5V
Current Consumption 20mA (typical)
Viewing Angle >160 degrees
Operating Temperature -40°C to 85°C
Dimensions 27.0mm x 27.0mm x 4.1mm

Pin Configuration and Descriptions

I2C Interface

Pin Number Pin Name Description
1 GND Ground
2 VCC Power Supply (3.3V - 5V)
3 SCL Serial Clock Line
4 SDA Serial Data Line

SPI Interface

Pin Number Pin Name Description
1 GND Ground
2 VCC Power Supply (3.3V - 5V)
3 SCK Serial Clock
4 MOSI Master Out Slave In
5 RES Reset
6 DC Data/Command
7 CS Chip Select

Usage Instructions

How to Use the Component in a Circuit

Connecting to an Arduino UNO (I2C Interface)

  1. Connect the GND pin of the OLED to the GND pin of the Arduino.
  2. Connect the VCC pin of the OLED to the 5V pin of the Arduino.
  3. Connect the SCL pin of the OLED to the A5 pin of the Arduino.
  4. Connect the SDA pin of the OLED to the A4 pin of the Arduino.

Sample Code for Arduino UNO

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

// Define the OLED reset pin
#define OLED_RESET -1

// Create an instance of the SSD1306 display
Adafruit_SSD1306 display(OLED_RESET);

void setup() {
  // Initialize the display
  if(!display.begin(SSD1306_I2C_ADDRESS, OLED_RESET)) {
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  display.display();
  delay(2000); // Pause for 2 seconds

  // Clear the buffer
  display.clearDisplay();

  // Display text
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.println(F("Hello, world!"));
  display.display();
}

void loop() {
  // Add your main code here, to run repeatedly
}

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Display Not Turning On

    • Solution: Check the power connections and ensure the correct voltage is supplied.
    • Solution: Verify the I2C/SPI connections and ensure they are properly connected.
  2. Garbled or Noisy Display

    • Solution: Ensure that the data and clock lines are properly connected and not loose.
    • Solution: Check for any loose connections or short circuits.
  3. Partial Display or Missing Pixels

    • Solution: Verify that the display initialization code is correct.
    • Solution: Ensure that the display buffer is being properly updated.

Tips for Troubleshooting

By following this documentation, users should be able to effectively integrate and utilize the OLED display module in their projects, whether they are beginners or experienced electronics enthusiasts.