portfolio

Types of OLEDs

Course Content
Session 1: Introduction to ESP32
Objective: Get familiar with the ESP32 microcontroller and set up the development environment.
0/5
Session 2: Interfacing with Sensors and Displays
Learn how to connect a DHT22 sensor and an OLED display to the ESP32.
0/4
Session 4: Programming the OLED Display
Objective: Write code to display information on the OLED display.
0/4
Session 5: Integrating Sensor Data with OLED Display
Objective: Combine sensor readings with OLED display functionality.
0/1
Session 6: Setup WIFI Capability
0/1
Session 7: Adding a Webserver
0/1
Session 8: Wrap-up
0/1
ESP32 Basics
About Lesson

When working with an ESP32 microcontroller, several types of OLED displays are commonly used for displaying information like text, graphics, or sensor data. OLED displays come in various sizes, resolutions, and communication protocols. Here’s a breakdown of the different types:

1. Based on Communication Protocol:

I2C OLED Displays:

  • Description: I2C OLED displays use a 2-wire communication protocol (SDA for data and SCL for clock) and are popular due to their simplicity and minimal pin usage.

  • Common Resolutions:

    • 128×64: The most widely used size, offering enough space for displaying text, graphics, and sensor data.
    • 128×32: A smaller version, typically used for compact applications.
  • Pin Configuration: Usually, you need 4 pins: VCC, GND, SDA (data), and SCL (clock).

  • Example Models:

    • SSD1306 (128×64 or 128×32 resolution)
    • SH1106 (similar to SSD1306, with slightly different commands)
  • Pros:

    • Low power consumption.
    • Simple wiring (only 2 data lines).
  • Cons:

    • Slower data transmission compared to SPI.
    • Suitable for basic graphical interfaces or simple text.

SPI OLED Displays:

  • Description: SPI OLED displays use a 4- or 5-wire communication protocol (MOSI, SCK, CS, DC, and sometimes RESET). They offer faster communication than I2C, making them suitable for more complex displays.

  • Common Resolutions:

    • 128×64: The most common size for SPI-based OLEDs.
    • 96×96 or 128×128: Less common, but sometimes used for circular or square designs.
  • Pin Configuration: Requires more pins compared to I2C: VCC, GND, MOSI, SCK, CS (Chip Select), DC (Data/Command), and sometimes RESET.

  • Example Models:

    • SSD1306 (128×64 or 128×32, SPI variant)
    • SSD1331 (supports color, typically 96×64 resolution)
    • SSD1327 (128×128 resolution, grayscale)
  • Pros:

    • Faster than I2C.
    • Suitable for complex and faster-changing graphics.
  • Cons:

    • Uses more GPIO pins on the ESP32.

2. Based on Color Type:

Monochrome OLED Displays:

  • Description: These are the most common type of OLED displays. They only show black and white (on/off) pixels.
  • Common Sizes:
    • 128×64 (popular size for most projects).
    • 128×32 (more compact version).
  • Typical Controllers:
    • SSD1306 (I2C or SPI)
    • SH1106
  • Pros:
    • Lower power consumption.
    • Great for simple applications (text and basic graphics).
  • Cons:
    • Limited to monochrome (no color).

Grayscale OLED Displays:

  • Description: These displays support multiple shades of gray, typically 16 or 256 shades. They provide better detail than monochrome displays.

  • Common Sizes:

    • 128×128 or 128×96.
  • Typical Controllers:

    • SSD1327 (128×128 resolution, 4-bit grayscale).
  • Pros:

    • Offers richer detail than monochrome.
  • Cons:

    • Higher power consumption compared to monochrome displays.

Color OLED Displays:

  • Description: These OLED displays can display full RGB colors and are useful for advanced graphical interfaces.
  • Common Sizes:
    • 96×64 (popular size for compact color OLEDs).
    • 128×128.
  • Typical Controllers:
    • SSD1331 (96×64 resolution, RGB color).
  • Pros:
    • Full-color support, ideal for advanced interfaces and visuals.
  • Cons:
    • Higher power consumption.
    • More complex to program and manage.

3. Based on Size and Resolution:

128×64 OLED Displays:

  • Description: One of the most common OLED display sizes, providing a decent amount of space for text and simple graphics.
  • Common Uses: Displaying sensor data, system status, or text-based interfaces.
  • Example Controllers: SSD1306, SH1106.

128×32 OLED Displays:

  • Description: Smaller and more compact than the 128×64 displays, suitable for projects where space is limited.
  • Common Uses: Projects where minimal data or information needs to be displayed.
  • Example Controllers: SSD1306 (128×32 version).

96×64 or 96×32 OLED Displays:

  • Description: Less common but compact and efficient for smaller displays. Often used in SPI-based displays.
  • Example Controllers: SSD1331 (for color displays).

4. Based on Voltage and Power Requirements:

  • 3.3V OLED Displays: These are compatible directly with the ESP32, which operates at 3.3V logic.
  • 5V OLED Displays: Some displays are 5V-tolerant, but since ESP32 uses 3.3V logic, you may need level shifters or to ensure the display accepts 3.3V logic.

Popular OLED Display Modules for ESP32:

  1. SSD1306 (128×64 or 128×32, I2C or SPI):

    • Monochrome.
    • Most popular for basic ESP32 projects.
    • Available in 0.96-inch and 1.3-inch screen sizes.
  2. SH1106 (128×64, I2C or SPI):

    • Monochrome.
    • Similar to SSD1306 but with a different memory layout.
  3. SSD1331 (96×64, SPI):

    • RGB color.
    • Used for more advanced graphical interfaces and color displays.
  4. SSD1327 (128×128, SPI):

    • Grayscale.
    • Supports 16 grayscale levels.

Choosing the Right OLED for ESP32:

  • Monochrome (SSD1306): Ideal for low-power, simple projects where you need to display text or simple graphics.
  • Color (SSD1331): Useful for projects where visuals matter, and you want to display colorful graphics or images.
  • Grayscale (SSD1327): If you need more detailed visuals than monochrome but don’t require full color.
  • Communication Protocol: I2C for simpler wiring and fewer GPIO pins, SPI for faster performance at the cost of more pins.

By choosing the right OLED display type based on your project requirements, you can achieve an effective balance between functionality, power consumption, and ease of integration with the ESP32.

For this guide we will be using a SSD1306 128×84 I2C