ST7735 Display RGB Drivers Not Accurate

I am building a weather display using ESPhome, a Wemos D1 Mini, and an ST7735 display. The issue I am having is it seems the drivers are not creating accurate RGB colors. Reds look more magenta, Yellows look white, Blues seem to be the only one that look correct. I came across this error when trying to display this image for a partly cloudy sky and the sun looked white.
partlycloudy

I have tried everything I could think of from using different pins, swapped out the display as I have two, messed with the percentages under “color” to see if I could get yellow text. Turned on and off the eight_bit_color option.

Here is the code I am using, note the board I have is Red board the display only seems to work when I select one of the black tab options. Any help would be greatly appreciated, thanks.

# Example configuration entry for ESP8266
i2c:

spi:
  clk_pin: D5
  mosi_pin: D7
  
color:
  - id: color_blue
    red: 0%
    green: 0%
    blue: 100%
    white: 0%
  - id: color_yellow
    red: 100%
    green: 100%
    blue: 0%
    white: 0%
  - id: color_red
    red: 100%
    green: 0%
    blue: 0%
    white: 0%

image:
  - file: "weather-icons/cloudy.png"
    id: cloudy
    type: RGB24
  - file: "weather-icons/partlycloudy.png"
    id: partlycloudy
    type: RGB24

display:
  - platform: st7735
    model: "INITR_18BLACKTAB"
    reset_pin: D3
    cs_pin: D8
    dc_pin: D4
    rotation: 90
    device_width: 128
    device_height: 160
    col_start: 0
    row_start: 0
    eight_bit_color: true
    update_interval: 5s
    lambda: |-
      // Draw the image my_image at position [x=0,y=0]
      if (id(weather_condition).state == "cloudy") {
      it.image(0, 0, id(cloudy));
      }
      if (id(weather_condition).state == "partlycloudy") {
      it.image(0, 0, id(partlycloudy));
      }

So I tinkered around with this last night and found a solution to the yellow. By dropping the red to 80% I was able to produce yellow text.

  - id: color_yellow
    red: 80%
    green: 100%
    blue: 0%
    white: 0%

Clearly this won’t help with an image that includes yellow. So what I did for my example in the original post was to change the sun in Photoshop to look like the following. Since Photoshop uses a 255 point scale instead of % for its RGB colors I adjusted accordingly.

Red: 204
Green: 255
Blue: 0

partlycloudy2

My thought is there is something wrong with the red calibration in the ST7735 driver for ESPHome. I still cannot get a true red as it is a primary color and the only adjustment is to the lower the %. If anyone has further suggestions on how to correct for this let me know, thanks.

1 Like

Post an issue on the esphome github.