The OLED 128x64 I2C Monochrome Display GND-VDD is a compact and versatile display module suitable for integrating with microcontrollers such as Arduino, ESP8266, and others. With its high resolution of 128x64 pixels, this display provides clear and sharp text, graphics, and images in monochrome. It utilizes the I2C communication protocol, which simplifies the wiring and connectivity to just four pins, including power (VDD) and ground (GND). Common applications include user interfaces, data monitoring displays, and small-scale information panels.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground, connected to system ground |
2 | VDD | Power supply, 3.3V to 5V |
3 | SCL | Serial Clock Line for I2C communication |
4 | SDA | Serial Data Line for I2C communication |
To use the display with an Arduino UNO, you will need to include libraries that support the SSD1306 driver and the I2C communication. The Adafruit SSD1306 and Adafruit GFX libraries are commonly used.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// OLED display TWI address
#define OLED_ADDR 0x3C
// Reset pin not used on 4-pin OLED module
#define OLED_RESET -1
Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET);
void setup() {
// Initialize with the I2C addr 0x3C (for the 128x64)
if(!display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
display.display();
delay(2000); // Pause for 2 seconds
display.clearDisplay();
}
void loop() {
// Your code to update the display goes here
}
After initializing the display, you can use the display
object to draw text, shapes, and images. Here's an example of displaying text:
void loop() {
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(WHITE); // Draw white text
display.setCursor(0,0); // Start at top-left corner
display.clearDisplay();
display.println(F("Hello, world!"));
display.display();
delay(2000);
}
i2c_scanner
sketch to confirm the I2C address of the display.Q: Can I use this display with a 5V microcontroller? A: Yes, the OLED display can typically handle a 5V power supply, but always check the datasheet of your specific module to confirm.
Q: How do I prevent OLED burn-in? A: To prevent burn-in, avoid displaying static content for long periods. Use screen savers or periodically clear the display and refresh the content.
Q: What libraries do I need for Arduino? A: You will need the Adafruit SSD1306 and Adafruit GFX libraries, which can be installed via the Arduino Library Manager.
Q: How can I display images on the OLED?
A: Convert your images to a bitmap array compatible with the display's resolution and use the drawBitmap
function provided by the library.
This documentation provides a comprehensive guide to using the OLED 128x64 I2C Monochrome Display with a microcontroller. For further assistance, consult the datasheet of the specific OLED module you have or reach out to the community forums for support.