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

How to Use Adafruit 128x64 OLED Bonnet: Examples, Pinouts, and Specs

Image of Adafruit 128x64 OLED Bonnet
Cirkit Designer LogoDesign with Adafruit 128x64 OLED Bonnet in Cirkit Designer

Introduction

The Adafruit 128x64 OLED Bonnet (Manufacturer Part ID: 3531) is a compact, high-resolution OLED display module designed for use in embedded electronics projects. With a resolution of 128x64 pixels, it is ideal for displaying crisp text, detailed graphics, and animations. This module supports both I2C and SPI communication protocols, making it versatile and easy to integrate with microcontrollers and single-board computers like the Raspberry Pi.

Explore Projects Built with Adafruit 128x64 OLED Bonnet

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO Based Pong Game with OLED Display and Pushbutton Controls
Image of Sim test OLED Display: A project utilizing Adafruit 128x64 OLED Bonnet in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Controlled OLED Display with 9V Battery and Step-Down Converter
Image of digik: A project utilizing Adafruit 128x64 OLED Bonnet in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino 101 OLED Display Animation Project
Image of wokwi animater test: A project utilizing Adafruit 128x64 OLED Bonnet in a practical application
This circuit consists of an Arduino 101 microcontroller connected to a 0.96" OLED display via I2C communication. The Arduino runs a program that initializes the OLED and continuously displays an animated sequence of frames on the screen.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO with I2C OLED Display Interface
Image of OLED_Display: A project utilizing Adafruit 128x64 OLED Bonnet in a practical application
This circuit connects an Arduino UNO to a 128x64 OLED display using I2C communication protocol. The Arduino provides power to the display and communicates with it via the SDA and SCL lines connected to the A4 and A5 pins, respectively. The embedded code initializes the display and prints 'Hello, World!' on it.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit 128x64 OLED Bonnet

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 Sim test OLED Display: A project utilizing Adafruit 128x64 OLED Bonnet 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of digik: A project utilizing Adafruit 128x64 OLED Bonnet 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of wokwi animater test: A project utilizing Adafruit 128x64 OLED Bonnet in a practical application
Arduino 101 OLED Display Animation Project
This circuit consists of an Arduino 101 microcontroller connected to a 0.96" OLED display via I2C communication. The Arduino runs a program that initializes the OLED and continuously displays an animated sequence of frames on the screen.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of OLED_Display: A project utilizing Adafruit 128x64 OLED Bonnet in a practical application
Arduino UNO with I2C OLED Display Interface
This circuit connects an Arduino UNO to a 128x64 OLED display using I2C communication protocol. The Arduino provides power to the display and communicates with it via the SDA and SCL lines connected to the A4 and A5 pins, respectively. The embedded code initializes the display and prints 'Hello, World!' on it.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Displaying system status or sensor data in IoT projects
  • Creating user interfaces for embedded systems
  • Visualizing data in portable devices
  • DIY electronics and prototyping
  • Educational projects and demonstrations

Technical Specifications

The following table outlines the key technical details of the Adafruit 128x64 OLED Bonnet:

Specification Details
Manufacturer Adafruit
Part ID 3531
Display Type OLED (Organic Light Emitting Diode)
Resolution 128x64 pixels
Communication Protocols I2C, SPI
Operating Voltage 3.3V to 5V
Current Consumption ~10mA (varies with brightness and usage)
Dimensions 2.4" x 1.3" x 0.2" (61mm x 33mm x 5mm)
Weight 8.5g

Pin Configuration and Descriptions

The Adafruit 128x64 OLED Bonnet features the following pin configuration:

I2C Pinout

Pin Name Description
VIN Power input (3.3V to 5V)
GND Ground
SCL I2C Clock Line
SDA I2C Data Line

SPI Pinout

Pin Name Description
VIN Power input (3.3V to 5V)
GND Ground
SCK SPI Clock Line
MOSI SPI Master Out, Slave In
DC Data/Command Select
CS Chip Select
RST Reset

Usage Instructions

How to Use the Component in a Circuit

  1. Power the Bonnet: Connect the VIN pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Choose Communication Protocol: Decide whether to use I2C or SPI. For I2C, connect the SCL and SDA pins to the corresponding pins on your microcontroller. For SPI, connect SCK, MOSI, DC, CS, and RST as required.
  3. Install Required Libraries: If using a Raspberry Pi or Arduino, install the Adafruit SSD1306 and Adafruit GFX libraries for easy control of the display.
  4. Write Code: Use the libraries to initialize the display, draw graphics, and display text.

Important Considerations and Best Practices

  • Voltage Compatibility: Ensure the power supply voltage matches the module's requirements (3.3V to 5V).
  • Pull-Up Resistors: For I2C communication, ensure pull-up resistors are present on the SCL and SDA lines.
  • Brightness Settings: Adjust the brightness to balance visibility and power consumption.
  • Avoid Static Damage: Handle the module carefully to prevent damage from electrostatic discharge (ESD).

Example Code for Arduino UNO (I2C)

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

// Define the OLED display dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

// Create an SSD1306 display object connected via I2C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);

  // Initialize the OLED 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();

  // Display a welcome message
  display.setTextSize(1); // Set text size
  display.setTextColor(SSD1306_WHITE); // Set text color
  display.setCursor(0, 0); // Set cursor position
  display.println(F("Hello, OLED!"));
  display.display(); // Render the text on the display
  delay(2000); // Pause for 2 seconds
}

void loop() {
  // Example: Draw a rectangle on the display
  display.clearDisplay(); // Clear the display buffer
  display.drawRect(10, 10, 50, 30, SSD1306_WHITE); // Draw a rectangle
  display.display(); // Render the rectangle on the display
  delay(1000); // Pause for 1 second
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Display Not Turning On:

    • Verify the power connections (VIN and GND).
    • Ensure the correct communication protocol (I2C or SPI) is selected and wired properly.
    • Check for loose or incorrect connections.
  2. No Output on the Display:

    • Confirm that the correct I2C address (default: 0x3C) is being used in the code.
    • Ensure the required libraries (Adafruit SSD1306 and Adafruit GFX) are installed and up to date.
    • Check for syntax errors or incorrect initialization in the code.
  3. Flickering or Unstable Display:

    • Verify that the power supply provides sufficient current.
    • Check for noise or interference on the communication lines.
  4. Partial or Distorted Graphics:

    • Ensure the display buffer is cleared (display.clearDisplay()) before drawing new content.
    • Verify that the display dimensions (128x64) are correctly defined in the code.

FAQs

Q: Can I use this module with a Raspberry Pi?
A: Yes, the Adafruit 128x64 OLED Bonnet is fully compatible with Raspberry Pi. Use the I2C or SPI interface and install the necessary Python libraries (e.g., Adafruit-SSD1306).

Q: What is the default I2C address of the module?
A: The default I2C address is 0x3C.

Q: Can I daisy-chain multiple OLED Bonnet modules?
A: No, the module does not support daisy-chaining. Each module requires a unique I2C address or separate SPI connections.

Q: How do I adjust the brightness?
A: Brightness can be adjusted programmatically using the ssd1306_command() function in the Adafruit SSD1306 library.

Q: Is the display sunlight-readable?
A: The OLED display is not optimized for direct sunlight and is best used indoors or in shaded environments.