

The 128x64 0.96 inch SPI Monochrome OLED display is a compact and versatile display module with a resolution of 128x64 pixels. It uses SPI (Serial Peripheral Interface) for communication, ensuring fast and efficient data transfer. This display is known for its high contrast, low power consumption, and wide viewing angles, making it an excellent choice for embedded systems, portable devices, and DIY electronics projects.








| Parameter | Value |
|---|---|
| Display Type | Monochrome OLED |
| Resolution | 128x64 pixels |
| Communication Interface | SPI (Serial Peripheral Interface) |
| Operating Voltage | 3.3V - 5V |
| Power Consumption | ~0.04W (typical) |
| Display Size | 0.96 inch (diagonal) |
| Viewing Angle | >160° |
| Driver IC | SSD1306 |
| Operating Temperature | -40°C to +85°C |
| Pin Name | Pin Number | Description |
|---|---|---|
| GND | 1 | Ground pin. Connect to the ground of the power supply. |
| VCC | 2 | Power supply pin. Connect to 3.3V or 5V. |
| D0 (SCK) | 3 | SPI clock pin. Connect to the SCK pin of the microcontroller. |
| D1 (MOSI) | 4 | SPI data pin. Connect to the MOSI pin of the microcontroller. |
| RES | 5 | Reset pin. Used to reset the display. |
| DC | 6 | Data/Command pin. Determines whether data or commands are sent. |
| CS | 7 | Chip Select pin. Enables communication with the display. |
VCC pin to a 3.3V or 5V power source and the GND pin to the ground.D0 (SCK) and D1 (MOSI) pins to the corresponding SPI pins on your microcontroller.RES pin to a GPIO pin on the microcontroller for resetting the display.DC pin to a GPIO pin to toggle between data and command modes.CS pin to a GPIO pin to enable or disable communication with the display.Adafruit SSD1306 and Adafruit GFX libraries for easy control of the display.#include <Adafruit_GFX.h> // Graphics library for OLED
#include <Adafruit_SSD1306.h> // Library for SSD1306 OLED driver
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for SPI OLED display
#define OLED_RESET 4 // Reset pin (can be any GPIO pin)
#define OLED_DC 5 // Data/Command pin
#define OLED_CS 10 // Chip Select pin
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, OLED_DC, OLED_RESET, OLED_CS);
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
// Initialize the OLED display
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x64
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Loop forever if initialization fails
}
display.clearDisplay(); // Clear the buffer
display.setTextSize(1); // Set text size to 1
display.setTextColor(SSD1306_WHITE); // Set text color to white
display.setCursor(0, 0); // Set cursor to top-left corner
display.println(F("Hello, OLED!")); // Print text to the buffer
display.display(); // Display the buffer on the screen
}
void loop() {
// Nothing to do here
}
Display Not Turning On:
VCC and GND pins are properly connected.No Output on the Display:
D0, D1, CS, DC, RES) for proper wiring.0x3C or 0x3D) is used in the code.Flickering or Unstable Display:
Library Errors During Compilation:
Adafruit SSD1306 and Adafruit GFX libraries are installed and up to date.Q: Can this display be used with 3.3V microcontrollers like ESP32?
A: Yes, the display is compatible with both 3.3V and 5V logic levels, making it suitable for microcontrollers like ESP32, Arduino, and others.
Q: How do I display custom graphics?
A: You can use the Adafruit GFX library to draw shapes, bitmaps, and custom graphics. Refer to the library documentation for detailed instructions.
Q: Can I use this display with I2C instead of SPI?
A: This specific model is designed for SPI communication. However, there are similar OLED displays available that support I2C.
Q: What is the maximum SPI clock speed supported?
A: The SSD1306 driver typically supports SPI clock speeds up to 10 MHz. Check your microcontroller's capabilities for compatibility.