I have seen some questions on turning HDMI screens off but my question concerns GPIO attached touchscreens. When I run sudo halt -h on my b+, the OS(hacked version of Raspbian to work with touchscreen) shuts down.

However, the back-light stays on giving me a bright white screen. I assume this is because the 5v pin is still supplying 5 volts to the screen.

To fix this I know I could wire a switch in series with the power supply or just pull out the cord but I would like to avoid the extra step. Is there a software solution for this to turn the screen off?

  • "I assume this is because the 5v pin is still supplying 5 volts to the screen." Makes sense. I would guess this then depends on whether the screen itself has a "turn off backlight" feature. I do not think you can disable the 5V power on the pi.
    – goldilocks
    Jun 3, 2015 at 14:17
  • I was hoping that wasn't true! :-( Do you know how I would check to see if my screen has a "turn off back-light feature"? It certainly does not have any buttons on it, are you suggesting a feature in the software?
    – NULL
    Jun 3, 2015 at 14:24
  • It would be a hardware feature just not necessarily a button. The screen obviously has control lines in addition to the 5V power. The adafruit screen evidently uses gpio 508 for this, which is a bit baffling. You have a kernel driver for it, so you could look in /sys/ (particularly /sys/devices) and see if there's anything there; LED monitor drivers sometimes have a /sys/class/backlight control.
    – goldilocks
    Jun 3, 2015 at 14:35
  • Supposing there was...I can't look right now...where would I put that so it turns off after shutdown? Would I have to recompile the shutdown script and add that line?
    – NULL
    Jun 3, 2015 at 14:39
  • Scripts refers to code that's interpreted at runtime, not compiled, although some scripting languages (e.g. python) allow for pre-compiling to bytecode. Anyway, if there is a driver interface in /sys it would just be a matter of writing a value to the appropriate node; I can echo N > /sys/class/backlight/acpi_video0/brightness where N is an integer between 0 and the value in /sys/class/backlight/acpi_video0/max_brightness. Those aren't real files, they're conduits to/from the kernel. Some of them are read-only, some of them can be modified by writing to them.
    – goldilocks
    Jun 3, 2015 at 14:46

1 Answer 1


Thanks to @goldilocks, I understand that it depends on the screen having a backlight feature such as adafruit's touchscreen which can be turned off using this tutorial. Most of the time if it does support a toggle-able backlight feature it will be found in the /sys/ folder and most likely in /sys/devices. See comments above for full dialog.

  • If it doesn't, you could probably add an FET controlled by another GPIO to enable the backlight supply. Most backlight driver circuits will have an enable, so careful examination of the board might yield a control signal, even if it is presently hardwired to a default (hopefully through a resistor). Nov 30, 2015 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.