Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use oled display: Examples, Pinouts, and Specs

Image of oled display
Cirkit Designer LogoDesign with oled display in Cirkit Designer

Introduction

An OLED (Organic Light Emitting Diode) display is a type of screen technology that uses organic compounds to emit light when an electric current is applied. Unlike traditional LCDs, OLED displays do not require a backlight, resulting in deeper blacks, higher contrast ratios, and improved energy efficiency. These displays are known for their vibrant colors, wide viewing angles, and thin form factor.

Common applications of OLED displays include:

  • Consumer electronics such as smartphones, tablets, and televisions.
  • Wearable devices like smartwatches and fitness trackers.
  • Embedded systems and microcontroller-based projects.
  • Industrial equipment for displaying data and status indicators.
  • DIY electronics projects and prototyping.

Explore Projects Built with oled display

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Smart Display with OLED, LED, and Buzzer
Image of EXP2: A project utilizing oled display in a practical application
This circuit features an ESP32 microcontroller that drives a 0.96" OLED display, a red LED, and a piezo buzzer. The ESP32 displays scrolling text and a bitmap on the OLED, controls the LED, and generates a tone on the buzzer, providing a simple interactive display and alert system.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 Devkit V1 and OLED Display Bitmap Viewer
Image of Esp32_monochromeimage: A project utilizing oled display in a practical application
This circuit consists of an ESP32 Devkit V1 microcontroller connected to a 1.3" OLED display via I2C communication. The ESP32 initializes the OLED display and renders a predefined bitmap image on it.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled RGB LED and OLED Display with ESP8266
Image of ESP thermometer reciever: A project utilizing oled display in a practical application
This circuit features an ESP8266 microcontroller interfaced with a 128x64 OLED display via I2C for visual output and an RGB LED controlled through current-limiting resistors. The ESP8266 provides power and control signals to both the display and the LED, enabling visual feedback and status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Leonardo Controlled OLED Display with Pushbutton Interaction
Image of game and gain: A project utilizing oled display in a practical application
This circuit features an Arduino Leonardo microcontroller connected to a 0.96" OLED display and a pushbutton with a pull-up resistor. The OLED display communicates with the Arduino via I2C (SDA and SCL lines), and the pushbutton, when pressed, changes the display content on the OLED screen. The microcontroller's code suggests the display alternates between showing an overview with speed and experience points and a player stats screen, likely for a game or interactive application.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with oled display

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of EXP2: A project utilizing oled display in a practical application
ESP32-Based Smart Display with OLED, LED, and Buzzer
This circuit features an ESP32 microcontroller that drives a 0.96" OLED display, a red LED, and a piezo buzzer. The ESP32 displays scrolling text and a bitmap on the OLED, controls the LED, and generates a tone on the buzzer, providing a simple interactive display and alert system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Esp32_monochromeimage: A project utilizing oled display in a practical application
ESP32 Devkit V1 and OLED Display Bitmap Viewer
This circuit consists of an ESP32 Devkit V1 microcontroller connected to a 1.3" OLED display via I2C communication. The ESP32 initializes the OLED display and renders a predefined bitmap image on it.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP thermometer reciever: A project utilizing oled display in a practical application
Wi-Fi Controlled RGB LED and OLED Display with ESP8266
This circuit features an ESP8266 microcontroller interfaced with a 128x64 OLED display via I2C for visual output and an RGB LED controlled through current-limiting resistors. The ESP8266 provides power and control signals to both the display and the LED, enabling visual feedback and status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of game and gain: A project utilizing oled display in a practical application
Arduino Leonardo Controlled OLED Display with Pushbutton Interaction
This circuit features an Arduino Leonardo microcontroller connected to a 0.96" OLED display and a pushbutton with a pull-up resistor. The OLED display communicates with the Arduino via I2C (SDA and SCL lines), and the pushbutton, when pressed, changes the display content on the OLED screen. The microcontroller's code suggests the display alternates between showing an overview with speed and experience points and a player stats screen, likely for a game or interactive application.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Below are the general technical specifications for a typical 0.96-inch I2C OLED display module:

Parameter Specification
Display Type OLED (Organic Light Emitting Diode)
Resolution 128 x 64 pixels
Interface I2C (Inter-Integrated Circuit)
Operating Voltage 3.3V - 5V DC
Current Consumption ~20mA (varies with brightness)
Viewing Angle >160°
Pixel Color Monochrome (White, Blue, or Yellow)
Dimensions ~27mm x 27mm x 4mm

Pin Configuration

The OLED display module typically has 4 pins for I2C communication. The pinout is as follows:

Pin Name Description
1 GND Ground connection
2 VCC Power supply (3.3V or 5V)
3 SCL Serial Clock Line for I2C communication
4 SDA Serial Data Line for I2C communication

Usage Instructions

Connecting the OLED Display to an Arduino UNO

To use the OLED display with an Arduino UNO, follow these steps:

  1. Connect the GND pin of the OLED display to the GND pin on the Arduino.
  2. Connect the VCC pin of the OLED display to the 5V pin on the Arduino.
  3. Connect the SCL pin of the OLED display to the A5 pin on the Arduino (I2C clock line).
  4. Connect the SDA pin of the OLED display to the A4 pin on the Arduino (I2C data line).

Installing Required Libraries

To control the OLED display, you need to install the following libraries in the Arduino IDE:

  • Adafruit_GFX: A graphics library for drawing shapes, text, and images.
  • Adafruit_SSD1306: A library specifically for SSD1306-based OLED displays.
  1. Open the Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries.
  3. Search for "Adafruit GFX" and "Adafruit SSD1306" in the Library Manager.
  4. Install both libraries.

Example Code

The following example code demonstrates how to display text on the OLED screen:

#include <Adafruit_GFX.h>       // Graphics library for OLED
#include <Adafruit_SSD1306.h>   // Library for SSD1306 OLED

#define SCREEN_WIDTH 128        // OLED display width, in pixels
#define SCREEN_HEIGHT 64        // OLED display height, in pixels

// Declaration for an SSD1306 display connected via I2C
#define OLED_RESET -1           // Reset pin (not used with I2C)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup() {
  // Initialize the display
  if (!display.begin(SSD1306_I2C_ADDRESS, 0x3C)) { 
    // Address 0x3C for most 128x64 OLEDs
    Serial.println(F("SSD1306 allocation failed"));
    for (;;); // Don't proceed, loop forever
  }

  display.clearDisplay();        // Clear the buffer
  display.setTextSize(1);        // Set text size (1 = small, 2 = medium, etc.)
  display.setTextColor(SSD1306_WHITE); // Set text color to white
  display.setCursor(0, 0);       // Set cursor position (x, y)
  display.println(F("Hello, OLED!")); // Print text to the buffer
  display.display();             // Display the buffer on the screen
}

void loop() {
  // Nothing to do here
}

Important Considerations

  • Ensure the OLED display's operating voltage matches your microcontroller's power supply (3.3V or 5V).
  • Double-check the I2C address of your OLED module. The default is usually 0x3C, but some modules use 0x3D.
  • Avoid excessive brightness settings to prolong the lifespan of the OLED display.

Troubleshooting and FAQs

Common Issues

  1. The display does not turn on.

    • Verify the power connections (GND and VCC).
    • Ensure the I2C pins (SCL and SDA) are correctly connected to the Arduino.
  2. The display shows random or no data.

    • Check the I2C address of the OLED module. Use an I2C scanner sketch to detect the address.
    • Ensure the required libraries are installed and included in your code.
  3. The text or graphics appear distorted.

    • Call display.clearDisplay() before updating the screen to avoid overlapping data.
    • Verify that the resolution in your code matches the display's resolution (e.g., 128x64).
  4. The display flickers or dims.

    • Check the power supply voltage and current. Insufficient power can cause flickering.
    • Reduce the brightness in your code to lower power consumption.

FAQs

Q: Can I use the OLED display with a 3.3V microcontroller?
A: Yes, most OLED modules are compatible with both 3.3V and 5V systems. Check the module's datasheet to confirm.

Q: How do I display custom graphics or images?
A: You can use tools like the Adafruit ImageConverter (online) to convert images into a bitmap array for use with the Adafruit_GFX library.

Q: Can I use the OLED display with other microcontrollers?
A: Yes, the OLED display can be used with other microcontrollers like ESP32, ESP8266, and Raspberry Pi. Ensure the appropriate libraries and connections are used.

Q: What is the lifespan of an OLED display?
A: The lifespan depends on usage and brightness settings. Typical OLED displays last around 10,000 to 50,000 hours. Lowering brightness can extend the lifespan.