The Adafruit OLED Monochrome 0.91in I2C display is a compact and versatile display module suitable for adding a small, high-contrast visual interface to your electronics projects. With a resolution of 128x32 pixels, it provides sufficient space for simple graphics, text, and symbols. This display uses the I2C communication protocol, making it easy to interface with microcontrollers and development boards like the Arduino UNO. The inclusion of STEMMA QT connectors allows for quick and solderless connections, making it ideal for prototyping and educational purposes.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (3.3V - 5V) |
3 | SCL | I2C clock line |
4 | SDA | I2C data line |
5 | RST | Reset pin (optional use) |
Connecting the Display:
Library Installation:
Programming the Display:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// Initialize with the I2C addr 0x3C (for the 128x32)
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Clear the buffer
display.clearDisplay();
// Draw a single pixel in white
display.drawPixel(10, 10, SSD1306_WHITE);
// Display the drawing
display.display();
}
void loop() {
// Code to update the display continuously
}
i2cdetect
tool or similar to confirm the I2C address of the display.Q: Can I use this display with a 5V Arduino? A: Yes, but ensure that the I2C lines are level-shifted to protect the display's 3.3V logic.
Q: How do I prevent OLED burn-in? A: Use the display's built-in scrolling functions and avoid displaying static content for long periods.
Q: What libraries do I need for this display? A: You will need the Adafruit SSD1306 and Adafruit GFX libraries.
Q: Can I use this display with other microcontrollers? A: Yes, as long as they support I2C communication and you can provide the correct logic levels.
For further assistance, consult the Adafruit forums or the detailed product guide available on the Adafruit website.