

An OLED (Organic Light Emitting Diode) display is a 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 vibrant colors. These displays are lightweight, energy-efficient, and offer wide viewing angles, making them suitable for a variety of applications.
Common applications of OLED displays include:








Below are the key technical details for the OLED display compatible with the Arduino UNO:
| Specification | Details |
|---|---|
| Manufacturer | Arduino |
| Manufacturer Part ID | UNO |
| Display Type | OLED (Organic Light Emitting Diode) |
| Resolution | 128 x 64 pixels |
| Interface | I2C (Inter-Integrated Circuit) |
| Operating Voltage | 3.3V - 5V |
| Current Consumption | ~20mA (typical) |
| Viewing Angle | >160° |
| Dimensions | 0.96 inches (diagonal) |
| Color | Monochrome (white or blue) |
The OLED display typically has a 4-pin interface for I2C communication. Below is the pin configuration:
| Pin | Name | Description |
|---|---|---|
| 1 | GND | Ground (connect to Arduino GND) |
| 2 | VCC | Power supply (3.3V or 5V from Arduino) |
| 3 | SCL | Serial Clock Line (connect to Arduino A5) |
| 4 | SDA | Serial Data Line (connect to Arduino A4) |
Wiring the OLED Display:
GND pin of the OLED display to the GND pin on the Arduino UNO.VCC pin of the OLED display to the 5V pin on the Arduino UNO.SCL pin of the OLED display to the A5 pin on the Arduino UNO.SDA pin of the OLED display to the A4 pin on the Arduino UNO.Installing Required Libraries:
Sketch > Include Library > Manage Libraries....Adafruit GFX LibraryAdafruit SSD1306Uploading Example Code: Use the following example code to display text on the OLED screen:
// Include necessary libraries
#include <Adafruit_GFX.h> // Graphics library for OLED
#include <Adafruit_SSD1306.h> // OLED driver library
// Define OLED display dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
// Create an instance of the display object
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
// Initialize the display
if (!display.begin(SSD1306_I2C_ADDRESS, 0x3C)) {
// If initialization fails, halt the program
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
// Clear the display buffer
display.clearDisplay();
// Set text size and color
display.setTextSize(1); // Text size multiplier
display.setTextColor(SSD1306_WHITE);
// Display a message
display.setCursor(0, 0); // Set cursor position
display.println(F("Hello, OLED!"));
display.display(); // Render the text on the screen
}
void loop() {
// No actions in the loop for this example
}
display.clearDisplay() function to clear the screen before updating the content to avoid overlapping graphics.The OLED display does not turn on:
GND and VCC.0x3C) matches the one in the code.Nothing is displayed on the screen:
Adafruit GFX and Adafruit SSD1306) are installed.A4 for SDA and A5 for SCL) are used.Flickering or distorted display:
Q: Can I use the OLED display with other microcontrollers?
A: Yes, the OLED display can be used with other microcontrollers (e.g., ESP32, Raspberry Pi) as long as they support I2C communication.
Q: How do I change the I2C address of the OLED display?
A: Some OLED modules have solder pads or jumpers to modify the I2C address. Refer to the module's datasheet for instructions.
Q: Can the OLED display show graphics?
A: Yes, the Adafruit GFX library supports drawing shapes, images, and animations on the OLED display.
By following this documentation, you can successfully integrate and use an OLED display with your Arduino UNO for various projects.