
Jan 28, 2025
What laziness does to a man
I have a problem. I have a lamp behind my TV that serves as a backlight. Every time when I need to turn that on, I need to swing over the TV and flip a switch. I also need to repeat that and turn it off when I go to bed at night (I need darkness to sleep).
So, I wanted to automate the process. I had a few ideas:
Install a timer switch
Simple & Easy, easily customizable
Can't sync with TV
Expensive
Wastes (outlet) plug space
Install a smart plug (control over WiFi)
Also simple & easy
Expensive
Can't sync with TV
Wastes plug space
I wanted the light to turn on when the TV was on, and turn off with the TV. I remembered that the TV has a USB port that only has power when the TV has power.
I thought, install a relay!
Install a relay
Simple (not easy, requires modification of lamp)
Cheap (I have all the parts!)
Can sync with TV power
Does not take additional plug space
Most unsafe
A relay is basically, monkey on a switch. You give it thumbs up, and monkey presses the switch. Take away the thumbs up, monkey lets go of the switch.
I initially thought I'd have Arduino input the high/low state into the relay's signal pin, but I figured I can use the same +5V input for both relay power and signal!
Consequently, the relay loses power when the TV is off, but that was what I'm looking for because the switch would get turned off at the same time.
After a quick test, I had to cut my perfectly normal lamp's power cable. One wire goes directly to lamp, and the other wire "stops by" the relay to complete the circuit.
So here is the weird setup:

Does it work? Yes! Is it stupid? I hope not.