Backlight control for ST7567 display

I recently brought a couple of ST7567 displays for use with ESPHome, however I discovered that there is no control over the backlight, it is just on when power is applied. (Unless I missed something which is totally possible!!)

A little bit of prodding later with a multimeter and I have added a BC547 transistor to allow the ESP to control the backlight!

To secure it I have used some hot glue. Not my favorite way but it is quick and this is not much more than a test to make sure it all work.

If anyone else wants to copy this (possibly daft) way of doing it, then here are my steps:

  1. Desolder R5
  2. Solder a 330ohm resistor to the Base pin of the BC547
  3. Solder the Collector pin to the top pads of C9/C11
  4. Solder a current limiting resistor to the Emitter pin (what value depends on the max brightness you want. The original used a 10ohm resistor (R5) from the 3V3 LDO regulator (U1) and was running around 80mA on my unit)
    I chose 47ohm as I wanted it quite dim at full anyway.
    Also: this will be running at the supply voltage so adjust your value if you are running from 5V or 3V3!
  5. Solder the Emitter resistor to the right-most pin on the FPC connector
  6. Solder a single pin header to the free side of the 330ohm resistor
  7. Hotglue (or what ever method you want to secure)

Finally just connect the header pin to a PWM pin on the ESP and set as a light. Here is my code:

light:
  - platform: monochromatic
    name: "Backlight"
    output: output_component1
    restore_mode: RESTORE_AND_ON

output:
  - platform: esp8266_pwm
    id: output_component1
    pin: D3

Hope this helps or is even slightly interesting LOL

1 Like

Great job!

I took it to another level… :grinning:
instead of transistor i use N-Channel MOSFET that controlling the negative voltage to the backlight, that was a bit challenging task since the only way to cut the negative is on the flex cable by disconnection the negative soldering and running new wire (brown in the picture) to the MOSFET drain (D).
the MOSFET Source (S) is connected directly to GNG.
the MOSFET gate (G) is connected through pull-down 5.6K resistor to GND and through 1k resistor to ESP32 GPIO.
the MOSFET is controlled by ESPHome ledc device so it possible to control the backlight brightness.
if using ESP8266 use esp8266_pwm device instead of ledc

output:
  - platform: ledc
    pin: GPIOxx
    id: pwm

light:
  - platform: monochromatic
    output: pwm
    id: display_backlight
    name: "Display Backlight"

The MOSFET:
AO3414 A0LA X0RB SOT-23 N-Channel SMD mosfet
https://www.aliexpress.com/item/33004300161.html