Controlling PiTFT Plus 3.5" 480x320 backlight

edited December 2018 in Tips & Tricks

I'm using PiTFT Plus 3.5" 480x320 TFT Touch (ADA2441) display which has TFT backlight pin connected to the raspberry pi.
When using a screensaver and after display goes blank, it still has the backlight on and it glows.
I have my printer in bedroom and raspberry is always on, so this glowing TFT is not good.

It can be fixed. I have following scripts and services installed that will monitor display screensaver state.
When the display is turned off it's will also turn off the backlight and opposite.

First, you have to install the display as Adafruit recommends.
Backlight control should be available in

Then you need 5 files
  • screen-monitor.service
  • screen-off.service

download files wget <gist_raw_file_link>

copy files,,
to /usr/local/bin/

give execution permission flag for these files
chmod +x
chmod +x
chmod +x

copy files 
screen-monitor.service, screen-off.service
to /lib/systemd/system

give needed permissions
sudo chmod 644 screen-monitor.service
sudo chmod 644 screen-off.service

then execute
sudo systemctl daemon-reload
sudo systemctl enable screen-off.service
sudo systemctl enable screen-monitor.service
sudo systemctl start screen-off.service
sudo systemctl start screen-monitor.service

How it works.
    This script will periodically check display status.
    If the screensaver is ON then after 10s it'll turn OFF the backlight.
    When the backlight is OFF then it will check display state on each second.
    If you touch display and screensaver goes OFF it will turn backlight ON again.
  • screen-monitor.service
    It will run the previous script as service.
  • screen-off.service
    This service will turn backlight OFF when you shut down your raspberry pi.
    By default, the backlight is always ON when booting raspberry pi.
    The script that will turn OFF backlight
    The script that will turn ON backlight


Sign In or Register to comment.