blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Turning off HDMI backlight

Fri May 27, 2016 4:29 pm

Im making a mini clamshell laptop thing and i want to turn off my HDMI screens backlight when i shut the two halves closed. Are there commands that turn the backlight of a screen on/off? I could always use a transistor connected to the screens powersupply and cut power from the screen using the pi gpio but it would be easier to do it with a command. Also, what mechanism do you suggest i use to detect if the device is closed or not? I was thinking magnets or a proximity sensor.
This signature intentionally left blank.

dgordon42
Posts: 760
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Turning off HDMI backlight

Fri May 27, 2016 4:37 pm

Code: Select all

tvservice -o
will power down the HDMI display.

For more, try:

Code: Select all

tvservice --help
Hope this helps,
Dave.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Fri May 27, 2016 5:23 pm

dgordon42 wrote:

Code: Select all

tvservice -o
will power down the HDMI display.

For more, try:

Code: Select all

tvservice --help
Hope this helps,
Dave.
Thanks, but apparantly tvservice -o does little to save power
This signature intentionally left blank.

PiGraham
Posts: 3577
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Turning off HDMI backlight

Fri May 27, 2016 5:41 pm

blaablaaguy wrote:
dgordon42 wrote:

Code: Select all

tvservice -o
will power down the HDMI display.

For more, try:

Code: Select all

tvservice --help
Hope this helps,
Dave.
Thanks, but apparently tvservice -o does little to save power
I guess that depends on the monitor. Most desktop monitors will go into a low power state ehn there is no input.
It won't make a difference to the Pi consumption, but you asked about the display backlight.

If you use a small magnet and a reed switch you could directly switch the display power (assuming low voltage DC) so that it's off when closed.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Fri May 27, 2016 6:09 pm

PiGraham wrote:
blaablaaguy wrote:
dgordon42 wrote:

Code: Select all

tvservice -o
will power down the HDMI display.

For more, try:

Code: Select all

tvservice --help
Hope this helps,
Dave.
Thanks, but apparently tvservice -o does little to save power
I guess that depends on the monitor. Most desktop monitors will go into a low power state ehn there is no input.
It won't make a difference to the Pi consumption, but you asked about the display backlight.

If you use a small magnet and a reed switch you could directly switch the display power (assuming low voltage DC) so that it's off when closed.
Oh, okay. I should have been more specific. About the reed switch/magnet thing, arent magnets bad for computers? Or am i stupid for asking?
This signature intentionally left blank.

User avatar
rpdom
Posts: 15004
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Turning off HDMI backlight

Fri May 27, 2016 6:12 pm

blaablaaguy wrote: About the reed switch/magnet thing, arent magnets bad for computers? Or am i stupid for asking?
Not any more.

They are very bad for floppy disks, but hardly anyone uses those now.

PiGraham
Posts: 3577
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Turning off HDMI backlight

Fri May 27, 2016 7:03 pm

rpdom wrote:
blaablaaguy wrote: About the reed switch/magnet thing, arent magnets bad for computers? Or am i stupid for asking?
Not any more.

They are very bad for floppy disks, but hardly anyone uses those now.
Except the US Defence Department ICBM command!

User avatar
rpdom
Posts: 15004
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Turning off HDMI backlight

Fri May 27, 2016 7:25 pm

PiGraham wrote:
rpdom wrote:They are very bad for floppy disks, but hardly anyone uses those now.
Except the US Defence Department ICBM command!
I've only seen 8" disks used once, but I've still got a stash of 5.25" and 3.5" floppies with my old work on.

evilkitty
Posts: 370
Joined: Tue Apr 15, 2014 11:39 pm

Re: Turning off HDMI backlight

Sat May 28, 2016 1:14 pm

unless the display powers off when there is no signal (tvservice -o) you will need to use a GPIO pin to turn the display on off at the power level, a transistor or gate should work
if your display has a IR input you could program lirc to flash a IR led to send the power on/off command
My Pi Server: http://imgur.com/a/6xIUI | Thermostat: http://imgur.com/a/4LVnT

darkbibble
Posts: 602
Joined: Mon Mar 09, 2015 5:20 pm
Location: corby, england

Re: Turning off HDMI backlight

Sat May 28, 2016 1:27 pm

for years laptops have used micro switches to turn the display off when the lid is closed,
Q; How many Windows users does it take to fix a Linux problem??
A; Whats a Linux problem

klricks
Posts: 6549
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Turning off HDMI backlight

Sat May 28, 2016 2:11 pm

dgordon42 wrote:

Code: Select all

tvservice -o
will power down the HDMI display.

For more, try:

Code: Select all

tvservice --help
Hope this helps,
Dave.
So how do you turn the display back on?
I tried (blind typed) tvservice -p and the backlight is turned on and the TV wakes up and recognizes an active input, however the screen remains black and I have to SSH into the RPi to issue reboot command to recover.
Also after issuing tvservice -o ........ If then someone mouse clicks the terminal window out of focus then you can't type anything.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

klricks
Posts: 6549
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Turning off HDMI backlight

Sat May 28, 2016 2:25 pm

rpdom wrote:
PiGraham wrote:
rpdom wrote:They are very bad for floppy disks, but hardly anyone uses those now.
Except the US Defence Department ICBM command!
I've only seen 8" disks used once, but I've still got a stash of 5.25" and 3.5" floppies with my old work on.
In the late 80's I used to have to load OS onto an Amdahl mainframe using 8" floppy disks. I don't remember how many disks but it took over 8 hours to load them all.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Sat May 28, 2016 4:48 pm

Its just a really basic waveshare lcd, so no IR. I think ill use a transistor since it only needs a 5v powersupply. Should i connect the transistor in series between the posutive wire of the screens power supply, connect the base to a gpio input, and then connect ground from th pi to the power supplys ground?

EDIT: And does the orientation of the transistor depend on whether its pnp/npn?
This signature intentionally left blank.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Turning off HDMI backlight

Sat May 28, 2016 5:13 pm

blaablaaguy wrote:Its just a really basic waveshare lcd, so no IR. I think ill use a transistor since it only needs a 5v powersupply. Should i connect the transistor in series between the posutive wire of the screens power supply, connect the base to a gpio input, and then connect ground from th pi to the power supplys ground?
Should you? No.

1. What transistor?
2. What are you trying to do? If it's shut off the screen, that's something you should use the software commands to do.
3. If this is something about shutting down the pi or the pi/lcd, the pi has to be properly shutdown before it can have its power removed.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Sat May 28, 2016 5:30 pm

stderr wrote:
blaablaaguy wrote:Its just a really basic waveshare lcd, so no IR. I think ill use a transistor since it only needs a 5v powersupply. Should i connect the transistor in series between the posutive wire of the screens power supply, connect the base to a gpio input, and then connect ground from th pi to the power supplys ground?
Should you? No.

1. What transistor?
2. What are you trying to do? If it's shut off the screen, that's something you should use the software commands to do.
3. If this is something about shutting down the pi or the pi/lcd, the pi has to be properly shutdown before it can have its power removed.
I dont want to turn off the pi, just the lcd. Basically i want the pi to be able to cut off/turn on the screens powersupply. Dont know which transistor yet, but it should be something that can handle 3A since thats the max current of my powersupply. I cant use tvservice -o since my screen doesnt auto turn off when it stops detecting a HDMI input so i wont save any power that way. Can someone suggest a transistor to use? I dont really know much about them.
This signature intentionally left blank.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Sun May 29, 2016 5:04 pm

Bump
This signature intentionally left blank.

wolfchild
Posts: 5
Joined: Wed May 11, 2016 11:16 am
Location: Malta

Re: Turning off HDMI backlight

Mon May 30, 2016 11:06 am

The simplest solution is to shunt that LCD's backlight on/off switch with a reed switch.

Solder the reed switch across the switch terminals and put the backlight switch in the OFF position. The switch has six pins, but if you look closely you'll see that only two have actual PCB tracks connected to them. Solder your reed switch across those two, leaving the switch in place. You can find nicely packaged reed switches and magnets as they are often used for home alarm systems.

I wouldn't recommend using a transistor to carry the LCD's supply as you will need to implement a high side switch. This would complicate the circuit unnecessarily. If you really wish to use a transistor, it's probably better to hook into the LCD's backlight controller IC as it has a remote shutdown feature that is simple to drive (though difficult to solder).

Ed

User avatar
Gerd
Posts: 66
Joined: Wed Mar 16, 2016 10:48 am
Location: Europe

Re: Turning off HDMI backlight

Mon May 30, 2016 12:49 pm

klricks wrote:
dgordon42 wrote:

Code: Select all

tvservice -o
will power down the HDMI display.

For more, try:

Code: Select all

tvservice --help
Hope this helps,
Dave.
So how do you turn the display back on?
I tried (blind typed) tvservice -p and the backlight is turned on and the TV wakes up and recognizes an active input, however the screen remains black and I have to SSH into the RPi to issue reboot command to recover.
Also after issuing tvservice -o ........ If then someone mouse clicks the terminal window out of focus then you can't type anything.
After reenabling tvservice with tvservice -p you should not forget to resurrect your framebuffer with something like

Code: Select all

fbset -depth 8; fbset -depth 16; xrefresh
Edit: typo

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Mon May 30, 2016 2:20 pm

wolfchild wrote:The simplest solution is to shunt that LCD's backlight on/off switch with a reed switch.

Solder the reed switch across the switch terminals and put the backlight switch in the OFF position. The switch has six pins, but if you look closely you'll see that only two have actual PCB tracks connected to them. Solder your reed switch across those two, leaving the switch in place. You can find nicely packaged reed switches and magnets as they are often used for home alarm systems.

I wouldn't recommend using a transistor to carry the LCD's supply as you will need to implement a high side switch. This would complicate the circuit unnecessarily. If you really wish to use a transistor, it's probably better to hook into the LCD's backlight controller IC as it has a remote shutdown feature that is simple to drive (though difficult to solder).

Ed
Im rubbish at soldering so using the backlight IC isnt really an option. Id like to do it with a transistor so ill be able to do other things with the screen as well, like making it turn off automatically at certain and stuff. How should i wire up the transistor? Should i use a relay instead? How should i wire it up? Sorry, im pretty much a n00b at electronics
This signature intentionally left blank.

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Wed Jun 01, 2016 3:51 pm

This signature intentionally left blank.

wolfchild
Posts: 5
Joined: Wed May 11, 2016 11:16 am
Location: Malta

Re: Turning off HDMI backlight

Wed Jun 01, 2016 6:17 pm

blaablaaguy wrote:Will this transistor do?
http://www.alldatasheet.com/datasheet-p ... /B772.html
Yes, but it's probably oversized as the backlight current is only about 85mA. A correctly driven BC807 would work wonders http://www.nxp.com/documents/data_sheet ... _BC327.pdf

A couple of days ago I spent an entertaining hour designing a switching circuit, but refrained from posting it. At the end of the exercise it turned out to be a flawed concept. The backlight turned ON when a GPIO pin was set HIGH. If the GPIO is LOW all the time until a program is executed, it means that the backlight will be off for the whole duration of the boot-up sequence, which may not be what you need! Changing the circuit to work with inverted logic resulted in a design unworthy of public view.

So, why not define a specification of how the backlight will work? Points to consider would be:
1. Will there be a switch to forcibly turn off the backlight? (Lid closed)
2. Will there be a switch to forcibly turn on the backlight? (Fallback plan for when GPIO control program terminates or malfunctions)
3. Is there even a remote possibility of turning off the LCD controller chip to save power?

Regards,
Ed

[Edit: Attached circuit designed a couple days ago]
Attachments
LCD backlight high-side switch.png
Positive logic high-side switch
LCD backlight high-side switch.png (10.17 KiB) Viewed 4102 times

blaablaaguy
Posts: 623
Joined: Sun Sep 27, 2015 3:26 pm

Re: Turning off HDMI backlight

Wed Jun 01, 2016 6:37 pm

wolfchild wrote:
blaablaaguy wrote:Will this transistor do?
http://www.alldatasheet.com/datasheet-p ... /B772.html
Yes, but it's probably oversized as the backlight current is only about 85mA. A correctly driven BC807 would work wonders http://www.nxp.com/documents/data_sheet ... _BC327.pdf

A couple of days ago I spent an entertaining hour designing a switching circuit, but refrained from posting it. At the end of the exercise it turned out to be a flawed concept. The backlight turned ON when a GPIO pin was set HIGH. If the GPIO is LOW all the time until a program is executed, it means that the backlight will be off for the whole duration of the boot-up sequence, which may not be what you need! Changing the circuit to work with inverted logic resulted in a design unworthy of public view.

So, why not define a specification of how the backlight will work? Points to consider would be:
1. Will there be a switch to forcibly turn off the backlight? (Lid closed)
2. Will there be a switch to forcibly turn on the backlight? (Fallback plan for when GPIO control program terminates or malfunctions)
3. Is there even a remote possibility of turning off the LCD controller chip to save power?

Regards,
Ed

[Edit: Attached circuit designed a couple days ago]
Im planning on switching the screens power supply, not just the backlight- i could save more power that way and wont have to solder to the screen (Im hopeless at soldering.). I suppose i could use one of the pins that is high on bootup so that the lcd would stay on until the script starts. Can you get "normally closed" transistors?

EDIT: just realized how PNP transistors worked :roll:. Would the transistor i linked to work to switch 3amp 5v? Or even 2amp 5v? Im a bit set on using this one coz i have it right on me right now. Found it in an an old remote.
This signature intentionally left blank.

Return to “General discussion”