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.
DIY electronics and prototyping with Arduino boards
Explore Projects Built with oled display
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit features an ESP32 microcontroller that drives a 0.96" OLED display, a red LED, and a piezo buzzer. The ESP32 displays scrolling text and a bitmap on the OLED, controls the LED, and generates a tone on the buzzer, providing a simple interactive display and alert system.
This circuit consists of an ESP32 Devkit V1 microcontroller connected to a 1.3" OLED display via I2C communication. The ESP32 initializes the OLED display and renders a predefined bitmap image on it.
This circuit features an ESP8266 microcontroller interfaced with a 128x64 OLED display via I2C for visual output and an RGB LED controlled through current-limiting resistors. The ESP8266 provides power and control signals to both the display and the LED, enabling visual feedback and status indication.
This circuit features an Arduino Leonardo microcontroller connected to a 0.96" OLED display and a pushbutton with a pull-up resistor. The OLED display communicates with the Arduino via I2C (SDA and SCL lines), and the pushbutton, when pressed, changes the display content on the OLED screen. The microcontroller's code suggests the display alternates between showing an overview with speed and experience points and a player stats screen, likely for a game or interactive application.
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)
Pin Configuration
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)
Usage Instructions
Connecting the OLED Display to Arduino UNO
Wiring the OLED Display:
Connect the GND pin of the OLED display to the GND pin on the Arduino UNO.
Connect the VCC pin of the OLED display to the 5V pin on the Arduino UNO.
Connect the SCL pin of the OLED display to the A5 pin on the Arduino UNO.
Connect the SDA pin of the OLED display to the A4 pin on the Arduino UNO.
Installing Required Libraries:
Open the Arduino IDE.
Go to Sketch > Include Library > Manage Libraries....
Search for and install the following libraries:
Adafruit GFX Library
Adafruit SSD1306
Uploading 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
}
Important Considerations and Best Practices
Ensure the OLED display is powered within its operating voltage range (3.3V - 5V).
Use pull-up resistors on the I2C lines (SCL and SDA) if not already integrated into the display module.
Avoid exposing the OLED display to static electricity or excessive heat.
Use the display.clearDisplay() function to clear the screen before updating the content to avoid overlapping graphics.
Troubleshooting and FAQs
Common Issues
The OLED display does not turn on:
Verify the wiring connections, especially GND and VCC.
Ensure the power supply voltage is within the specified range (3.3V - 5V).
Check if the I2C address (default: 0x3C) matches the one in the code.
Nothing is displayed on the screen:
Confirm that the required libraries (Adafruit GFX and Adafruit SSD1306) are installed.
Ensure the correct I2C pins (A4 for SDA and A5 for SCL) are used.
Check for loose or faulty connections.
Flickering or distorted display:
Verify that the power supply is stable and sufficient.
Check for interference or noise on the I2C lines.
Reduce the I2C communication speed if necessary.
FAQs
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.