daleos
Posts: 1
Joined: Mon Jul 08, 2019 11:23 am

Turn Raspberry Pi on/off with TV

Mon Jul 08, 2019 11:33 am

My Chromecast turns on and off with my TV. It uses USB power from the TV for this to work.

I would like something similar from my Raspberry Pi 4 but as the power requirements of the Pi 4 are more than my TV's USB port can provide, is there another way I can do this? Is there a "wake on USB" function or some sort of project/board I could make/buy that could switch the Pi on and off whenever the TV is on/off?

Like I mentioned, the Chromecast does this by being connected to the USB port on the TV so I imagine I could use a USB port on the TV to signal the Pi (or some other device powering the Pi) to switch on.

drgeoff
Posts: 9803
Joined: Wed Jan 25, 2012 6:39 pm

Re: Turn Raspberry Pi on/off with TV

Mon Jul 08, 2019 7:02 pm

There is rather more to it than just removing power from the RPi. The OS should be shut down first.

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Turn Raspberry Pi on/off with TV

Mon Jul 08, 2019 9:20 pm

If the USB ports on the TV have power cut when the TV is turned of you may be able to cable the power from the USB via a level sifter to a Pi GPIO and when that changes you issue the power down command.
Need Pi spray - these things are breeding in my house...

DarkElvenAngel
Posts: 162
Joined: Tue Mar 20, 2018 9:53 pm

Re: Turn Raspberry Pi on/off with TV

Thu Aug 01, 2019 3:22 am

Andyroo wrote: If the USB ports on the TV have power cut when the TV is turned of you may be able to cable the power from the USB via a level sifter to a Pi GPIO and when that changes you issue the power down command.
That could work but if you want to turn the pi back on again you need to have some logic. There is an overlay for a power button you could use put

Code: Select all

dtoverlay=gpio-shutdown
In you config.txt file in the boot directory

The following is from the overlay README

Code: Select all

    This overlay only handles shutdown. After shutdown, the system
    can be powered up again by driving GPIO3 low. The default
    configuration uses GPIO3 with a pullup, so if you connect a
    button between GPIO3 and GND (pin 5 and 6 on the 40-pin header),
    you get a shutdown and power-up button.
The key is you only need to drive the pin low momentarily and it only needs to drive low thus you don't need to level shifter just a transistor should do the trick. All this depends on getting a clear power status from the TV.

The USB port isn't the only output that could switch, the 5V pin on the HDMI could also switch.

Hopefully this gives you some idea where to go next.

Good luck.

Return to “Media centres”