OLED Display

Square Displays

"Square" displays are better fit for displaying QR Codes than more common "Rectangular" displays, here we focus on 1.5" 128x128 versions with IIC or SPI interfaces.

1.5in_display

Above image shows a display with SH1107 controller and I2C bus.

Some suitable controllers:

  1. White - SH1107
  2. Grey - SSD1327
  3. Colour - SSD1351

1. Waveshare

Waveshare has two 1.5" OLED offering based on different controllers SSD1327 and SH1107.

1.1. SSD1327

1.2. SH1107

2. QR Code

Displaying QR Code on 128x128 SH1107

2.1. EspHome

substitutions: #substitute your own values in this section
  untappd : sensor.tap_1_untappd #entity from Home Assistant

text_sensor:
  - platform: homeassistant
    id: beer_untappd
    entity_id: $untappd
    internal: true

qr_code:
  - id: untappd_qr
    value: beer_untappd

display:
    platform: ssd1306_spi
    model: "SH1107 128X128"
    spi_id: bus_a
    cs_pin: GPIO0
    dc_pin: GPIO2
    reset_pin: GPIO4
    lambda: |-
      // Print QR code for Untappd
      untappd_qr->set_value(id(beer_untappd).state.c_str()); // <-- this line fills the value from the text sensor 
      it.qr_code(20, 150, id(untappd_qr), Color(255,255,255), 4);

Note

2.2 u8g2

3. Purchase