

The OLED 128x32 is a small, low-power organic light-emitting diode (OLED) display with a resolution of 128x32 pixels. It is widely used in embedded systems for displaying text, graphics, and simple animations. This display is known for its high contrast, wide viewing angles, and low power consumption, making it ideal for battery-powered devices and compact projects.








The OLED 128x32 display is typically driven by an SSD1306 controller, which communicates via I2C or SPI protocols. Below are the key technical details:
| Parameter | Value |
|---|---|
| Display Type | OLED |
| Resolution | 128x32 pixels |
| Communication Protocol | I2C (default) or SPI |
| Operating Voltage | 3.3V to 5V |
| Current Consumption | ~20mA (varies with usage) |
| Pixel Color | Monochrome (usually white) |
| Viewing Angle | >160° |
| Dimensions | ~38mm x 12mm x 4mm |
| Pin Name | Description |
|---|---|
| VCC | Power supply (3.3V or 5V) |
| GND | Ground |
| SCL | I2C clock line |
| SDA | I2C data line |
| Pin Name | Description |
|---|---|
| VCC | Power supply (3.3V or 5V) |
| GND | Ground |
| SCK | SPI clock line |
| MOSI | SPI data line |
| CS | Chip select |
| DC | Data/Command control |
| RES | Reset |
Wiring: Connect the OLED display to the Arduino UNO as follows:
Install Required Libraries:
Adafruit_GFX and Adafruit_SSD1306 libraries from the Arduino Library Manager.Example Code: Below is a simple example to display "Hello, World!" on the OLED:
// Include necessary libraries
#include <Adafruit_GFX.h> // Graphics library for OLED
#include <Adafruit_SSD1306.h> // SSD1306 driver library
// Define OLED display dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 32
// Create an SSD1306 display object (I2C address 0x3C is common)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
// Initialize the 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();
// Set text size and color
display.setTextSize(1); // Text size multiplier
display.setTextColor(SSD1306_WHITE); // White text
// Display "Hello, World!" on the screen
display.setCursor(0, 0); // Set cursor to top-left corner
display.println(F("Hello, World!"));
// Update the display with the buffer content
display.display();
}
void loop() {
// Nothing to do here
}
0x3C. If the display does not respond, check the address or use an I2C scanner sketch to detect it.Display Not Turning On:
Flickering or Artifacts on the Screen:
Library Errors During Compilation:
Adafruit_GFX and Adafruit_SSD1306 libraries are installed and up to date.Q: Can I use the OLED 128x32 with a 3.3V microcontroller?
A: Yes, the display is compatible with both 3.3V and 5V logic levels.
Q: How do I switch between I2C and SPI modes?
A: Most OLED modules have solder jumpers on the back to select the communication mode. Refer to the module's datasheet for instructions.
Q: Can I display images on the OLED?
A: Yes, you can display monochrome bitmaps using the drawBitmap() function in the Adafruit_GFX library.
Q: What is the maximum refresh rate of the display?
A: The refresh rate depends on the communication protocol and microcontroller speed. Typically, it is sufficient for smooth animations and text updates.
By following this documentation, you should be able to successfully integrate and use the OLED 128x32 display in your projects!