3 ms·
You could also use a photodetector placed over the TV's power light, and I bet you could even input that to a PC with very minimal hardware, over a serial port
by derobert 15y ago
You could also use a photodetector placed over the TV's power light, and I bet you could even input that to a PC with very minimal hardware, over a serial port or microphone jack.
Cost would be very low, even if you have to buy USB<->Serial adapters. And you can run many feet of serial over CAT5.
Also, you may want to check xrandr, that strikes me as the correct way to ask the X server what is connected.
- trafficlight 15y agoxrandr doesn't give any useful information. There is a "monitor connected" value, but it always reports Yes. The photodetector idea is interesting. Do you think the ambient room light would cause any problems?
- jrockway 15y agoThe best answer is "try it and see". You already managed to build a device that uses the Hall effect to measure the amount of current your TV is pulling, so hooking up a photoresistor to an ohm meter and taping it to your TV while you turn the lights on and off should not be too difficult :) Also, electrical tape is black and blocks light pretty well, so slather enough of that on there and you should be good :) I guess you won't know whether or not your TV is on, in that case, but you can always add another LED that mimics the status of the TV's LED. (According to Wikipedia, you can use an LED as a photodiode. So you may not even have to buy anything to try this idea out! http://en.wikipedia.org/wiki/LEDs_as_Photodiode_Light_Sensors#LED_as_light_sensor http://en.wikipedia.org/wiki/LEDs_as_Photodiode_Light_Sensor... ) (Also, a hacked VGA cable may help xrandr report the TV power status. By default, VGA cables supply +5V to the DDC chip in the TV, so it can detect its presence even when off. Since you don't want this to happen, perhaps clipping that pin off will prevent the DDC information from being queried until the TV is turned on.)
- derobert 15y agoxrandr gives useful information on some cards. You can also try "nvidia-settings -q all" on nVidia boards (or try setting DynamicTwinView to false, see the nVidia docs). As for the ambient lighting, I don't think it will once you use black electrical tape to attach the detector. TVs also usually aren't installed where subject to really bright light (e.g., direct sunlight) because then you can't see the screen.