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

How to Use Oled 128x32: Examples, Pinouts, and Specs

Image of Oled 128x32Design with Oled 128x32 in Cirkit Designer

Introduction

The OLED 128x32 is a small, low-power organic light-emitting diode (OLED) display with a resolution of 128x32 pixels. It is widely used in embedded systems for displaying text, graphics, and simple animations. This display is known for its high contrast, wide viewing angles, and low power consumption, making it ideal for battery-powered devices and compact projects.

Explore Projects Built with Oled 128x32

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 Arduino UNO Based Pong Game with OLED Display and Pushbutton Controls: A project utilizing Oled 128x32 in a practical application
Arduino UNO Based Pong Game with OLED Display and Pushbutton Controls

This circuit features an Arduino UNO microcontroller connected to an OLED 128x64 I2C Monochrome Display for visual output and two pushbuttons for user input. The Arduino runs a Pong game, with the display showing the game and the pushbuttons used to control the paddle movement. The display is interfaced via I2C (SCL and SDA), and the pushbuttons are connected to digital pins D2 and D3 for input detection.

Open Project in Cirkit Designer
Image of Arduino UNO Controlled OLED Display with 9V Battery and Step-Down Converter: A project utilizing Oled 128x32 in a practical application
Arduino UNO Controlled OLED Display with 9V Battery and Step-Down Converter

This circuit features an Arduino UNO connected to a 128x64 OLED display via I2C communication lines (SDA and SCL), with the Arduino providing control signals to the display. A 9V battery powers the circuit through a 12v to 5v step-down power converter, which supplies a regulated 5V to both the Arduino and the OLED display. The embedded code on the Arduino is configured to blink an onboard LED with a 1-second interval.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The OLED 128x32 display is typically driven by an SSD1306 controller, which communicates via I2C or SPI protocols. Below are the key technical details:

Key Specifications

Parameter Value
Display Type OLED
Resolution 128x32 pixels
Communication Protocol I2C (default) or SPI
Operating Voltage 3.3V to 5V
Current Consumption ~20mA (varies with usage)
Pixel Color Monochrome (usually white)
Viewing Angle >160°
Dimensions ~38mm x 12mm x 4mm

Pin Configuration (I2C Mode)

Pin Name Description
VCC Power supply (3.3V or 5V)
GND Ground
SCL I2C clock line
SDA I2C data line

Pin Configuration (SPI Mode)

Pin Name Description
VCC Power supply (3.3V or 5V)
GND Ground
SCK SPI clock line
MOSI SPI data line
CS Chip select
DC Data/Command control
RES Reset

Usage Instructions

Connecting the OLED 128x32 to an Arduino UNO (I2C Mode)

  1. Wiring: Connect the OLED display to the Arduino UNO as follows:

    • VCC → 5V
    • GND → GND
    • SCL → A5 (I2C clock line on Arduino UNO)
    • SDA → A4 (I2C data line on Arduino UNO)
  2. Install Required Libraries:

    • Install the Adafruit_GFX and Adafruit_SSD1306 libraries from the Arduino Library Manager.
  3. Example Code: Below is a simple example to display "Hello, World!" on the OLED:

    // Include necessary libraries
    #include <Adafruit_GFX.h>       // Graphics library for OLED
    #include <Adafruit_SSD1306.h>  // SSD1306 driver library
    
    // Define OLED display dimensions
    #define SCREEN_WIDTH 128
    #define SCREEN_HEIGHT 32
    
    // Create an SSD1306 display object (I2C address 0x3C is common)
    Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
    
    void setup() {
      // Initialize the display
      if (!display.begin(SSD1306_I2C_ADDRESS, 0x3C)) {
        Serial.println(F("SSD1306 allocation failed"));
        for (;;); // Halt execution if initialization fails
      }
    
      // Clear the display buffer
      display.clearDisplay();
    
      // Set text size and color
      display.setTextSize(1);      // Text size multiplier
      display.setTextColor(SSD1306_WHITE); // White text
    
      // Display "Hello, World!" on the screen
      display.setCursor(0, 0);     // Set cursor to top-left corner
      display.println(F("Hello, World!"));
    
      // Update the display with the buffer content
      display.display();
    }
    
    void loop() {
      // Nothing to do here
    }
    

Important Considerations

Troubleshooting and FAQs

Common Issues

  1. Display Not Turning On:

    • Verify the wiring connections.
    • Ensure the correct I2C address is used in the code.
    • Check the power supply voltage.
  2. Flickering or Artifacts on the Screen:

    • Ensure proper grounding between the display and the microcontroller.
    • Use shorter wires to reduce noise in the I2C or SPI lines.
  3. Library Errors During Compilation:

    • Ensure the Adafruit_GFX and Adafruit_SSD1306 libraries are installed and up to date.
    • Verify that the correct display dimensions (128x32) are defined in the code.

FAQs

Q: Can I use the OLED 128x32 with a 3.3V microcontroller?
A: Yes, the display is compatible with both 3.3V and 5V logic levels.

Q: How do I switch between I2C and SPI modes?
A: Most OLED modules have solder jumpers on the back to select the communication mode. Refer to the module's datasheet for instructions.

Q: Can I display images on the OLED?
A: Yes, you can display monochrome bitmaps using the drawBitmap() function in the Adafruit_GFX library.

Q: What is the maximum refresh rate of the display?
A: The refresh rate depends on the communication protocol and microcontroller speed. Typically, it is sufficient for smooth animations and text updates.

By following this documentation, you should be able to successfully integrate and use the OLED 128x32 display in your projects!