TV on/off monitor using TV USB port
I'm trying to figure out what the best way is to create a sensor that determines if the TV is in stand-by mode, or is ON. I'm planning on using:
arduino pro mini 3.3V
RFM69HW radio at 433MHz (probably disabling the H mode, test show I don't need it over the required distance)
An pretty old Samsung (dumb) TV (LE32B530)
There's a few options that I'm looking at, but in my mind the ideal situation would be to use the USB service port (which is used for firmware updates only), to power the arduino, which has a very simple sketch to ping ever X seconds to the gateway. Once the TV is set to stand-by it automatically stops pinging, and using a timer in Openhab, I can determine if has been switched off. This way I don't have to use an external power source.
Now this is based on a few assumptions:
- the USB port will deliver enough power for the Arduino (using a step down converter)
- the USB port does not remain powered during stand-by
- the Openhab timer method is not to stressful in terms of performance
I can test 2 relatively easily I think with a old USB cable, with the ends stripped of to test the voltage between GND an +5V.
I'm struggling with 1 however. I don't know how to test if the USB port delivers enough amps for the arduino to function and to power the radio. Can I test or find out about the max. current the USB port can safely supply?
I have seen that an idling usb stick takes up about 34 mA, and that writing to a usb stick can take up to about 100mA. But I'm not sure the port is even set to be able to write, so that doesn't make me much wiser. I've been able to find the service manual for the TV, and there's this schematic:
It doesn't make any sense to me, but maybe someone can deduce anything from it?
Welcome to the forum @tomvanderputte
The TPS2051BDVR can deliver 500mA according to https://www.digikey.com/product-detail/en/texas-instruments/TPS2051BDBVR/296-21265-1-ND/1219985 so powering the Arduino and radio should be fine.
@mfalkvidd awesome thanks! So would it make sense to take this active approach? Or a more passive approach with external power, and to map the +5v fro the usb port to one of the gpio to sense the on/off status? That way it could send the actual status to the gateway.
@tomvanderputte both approaches probably work.
An alternative could be to clip a current sensor around the power supply for the TV. Doing that would probably make it possible to sense whether the tv is on, in standby or completely off. something like https://www.sparkfun.com/products/11005
If the tv has a led showing its status, you could use a LDR to measure it.
@tomvanderputte - some service port announces events on the data lines. You could use this to (if they are present) to determine if the tv is on or off and send a binary sensor. The issue with the ping approach is the amount of traffic, in balance with some lag in the update on your sensor. I guess you dont want to ping the tv every second and therefore it might be some time before your controller sense your power goes off - and this might cause issue if you want to use the sensor in any automation.
Thanks everyone for the suggestions, I'll consider my options!
I don‘t like the idea of shutting off the node once USB power turns off... but you could use the Expire-Binding in OH for finding out.
I‘d rather mount a photo cell to the front LED (if it turns off once powerded on) or on a scart interface, you could sense power once turned on. Or of course the USB if it turns on/off.
@parachutesj is from a design perspective that you don't like it? Or because it can actually damage the node?
I like the expire binding, thanks for the tip. The ldr is usable, but for estethic reasons I'll see if I can find a different solution, thanks.
Just brainstorming: a Door/Window sensor with 2xAA batteries may last ~2 years, if you remove the led and regulator. You just need to connect the USB - to GND and USB + to D3 via a diode.
Another option is to replace the 2xAA by a small lithium battery, with one of these cheap TP4056 charger boards, so the USB from TV will keep the battery charged. You just need to connect +VCC (from the USB connector side) to D3 via a diode.
@tomvanderputte I don‘t think it will harm the hardware if it powers down. I just don‘t like „to be out of control“. You don‘t know if it powered down or just dropped a heartbeat. Also I do some things in the evening once the TV powers down. This will obvious be delayed if you just kill the node and for traffic pollution you should not send updates to often.
@rvendrame battery powered should work. Always sleep and only wake on change. My door/window sensors run ‚since forever‘ on the first battery.
Jeremyyyy last edited by
Sometimes though, you may experience problems if your monitor or TV screen is set to disable USB power during standby. Monitors and TVs can often switch to standby very quickly if they don’t find an active source of content, and devices can often not turn on without power, causing a bit of a chicken and egg scenario. Add to this the fact that your device may be at the back of your monitor or TV in a spot that is hard to reach and you may find yourself in quite a frustrating scenario quite quickly.