Skip to content

Waveshare 3.5" LCD hack for backlight control

Piotr Skowronek edited this page Jun 14, 2020 · 6 revisions

Abstract

This LCD is pretty common all around. It is relatively cheap and of decent quality. However it doesn't support brightness (backlight) control. Below you will find how I hacked my way to retrofit this functionality into my LCD. Mind that this LCD internally can differ a lot between batches, model years or weather this LCD is counterfeited or not.

Before I started doing it my way I dug thru "internets" and found that the following instructions were helpful, but my LCD model was different:

The schematic of my LCD - at least I think it is pretty close to what I have.

So, please think twice or more before you decide to make any changes that will void your warranty (if you have one :) or even kill the display. Make sure your version looks the same as mine, if not check above links - maybe they will be more relevant.

Things required

  • soldering iron
  • sharp cutting knife
  • some wires
  • a multimeter might be helpful

Instructions

  • compare the photos below with the LCD you have
  • identify the right traces to cut - we simply cut off 3.3V supply for LEDs (and for decoding circuits, but keep calm and read on)
  • remove bits of blue film to have good soldering points
  • first, you have to solder a bridge wire for decoding circuits as they used the same 3.3V as for LEDs
  • solder two wires as illustrated below - will use them to control (via PWM) the brightness of backlight
  • don't short circuit these two wires (!) as it will directly supply 5V to LEDs - this won't be healthy for them. If you want to test before going further, either use multimeter or close them thru a resistor (you need to drop at least 1.5V @ 70-100mA so calculate its resistency).

Prepare brightness module

  • see schematic here
  • the list of electronic elements:
    • optocoupler, like 2N24
    • NPN transistor, for example 2N2222
    • resistors: 10ohm, 100ohm, 220ohm
  • you can use this Prototype board for RPi Zero to solder this module together. As you can see this proto board has enough space to do that:

This simple module controls the base of NPN transistor through Optocoupler which in turn is controlled by GPIO 12 (or any other that is PWM capable).

If you succeeded, then in the console you can run:

  • gpio -g mode 12 pwm
  • gpio -g pwm 12 value (value between 0-1023)
  • gpio pwm-ms - it seems this mode of PWM works better here - I think either opto or NPN is not quick enough in balanced mode (a default mode). In balanced mode the value as low as 400 makes the backlight to shine 100%.

Auto-adjust to ambient light

To automatically dim the LCD in function of ambient light I used I2C module TSL2561 and this script to nicely control the backlight (with theater dimming effect): brightness.sh. The script can also be signaled with HUP to temporarily increase brightness instantaneously (it will return to automatic mode after ~60seconds or when CONT is sent) - useful for the voice assistant when invocation word is heard.

Clone this wiki locally