Per discussion here, if you have a v1.1 version of the Raspberry Pi 7″ touchscreen, you can vary the brightness by setting a value of 1 to 255 into the file /sys/class/backlight/rpi-backlight/brightness
Use sudo to echo values to a file, do:
sudo sh -c "echo 80 > /sys/class/backlight/rpi_backlight/brightness"
Works like a champ, thnx !!
Confirmed to work on Version 1.2 of the official 7″ touchscreen, too. Thanks!
Thanks so much…looked everywhere for this
Very good, when i reboot the pi it will change the brightness to default. Is there anyway to save the config?
When you write a value to that brightness file and then reboot, what value is in the file after the reboot? Does it default back to some other value?
There’s more to this than meets the eye. (I know, bad pun, sue me!)
If you copied and pasted the line as-is, (with a value of 80), you will notice that the brightness of the screen dropped to about half.
Interesting factoid: 99.9999999% of all these LCD/back-lit displays change brightness by changing the duty-cycle of the pulse-width driving the display. 100% = full brightness and 0% = completely dark. Now if you do the math, (255=100% then 80=about 31%), you will notice that you’ve reduced the duty-cycle to about 30-or-so percent.
The big takeaway here is that, not only are you making things easier on your eyes, but *you have just reduced the display’s power consumption by a whopping 70%* due to something called “gamma correction”. Loosely translated it means that to get something that *LOOKS* half as bright, you don’t use half the light, you use about one third.
This is especially important if your device needs to be both self-powered *AND* have a lit display.
BTW, this is true for *ANY* display: Your smartphone, your TV, that smart-watch you have. You can keep most of the brightness and cut the power drastically by setting the brightness level to “50%” Try it.
Here are a couple of interesting Adafruit articles that talk about it in the context of NeoPixels, but it’s really applicable to just about everything.
https://learn.adafruit.com/sipping-power-with-neopixels/insights
https://learn.adafruit.com/led-tricks-gamma-correction
Many thanks for the help with the LCD!
I was really dissapointed when i used the 7″ LCD in the evening, it was more like a light spot hurting my eyes 😉
Now i can super control the brightness thanks to your tip!
Chris
Hi all, I have tried this getting an error
sudo sh -c “echo 80 > /sys/class/backlight/rpi_backlight/brightness”
sh: 1: cannot create /sys/class/backlight/rpi_backlight/brightness: Directory nonexistent
The backlight directory does not exist in /sys/class/
Is there something I am missing??
Thanks in advance
Taz
Taz – Go into the backlight directory and see what directory is in there. I had one directory in there called 10-0045. The brightness file was in that subdirectory.
So, my command looked like this:
sudo sh -c “echo 80 > /sys/class/backlight/100-0045/brightness”
Yours may be slightly different…