yepher / vevor_tv_lift_control

A project to connect a Vevor TV Lift to Home Assistant for automation
5 stars 0 forks source link

Interfacing directly to wired controller button inputs #3

Open LeeDr opened 1 month ago

LeeDr commented 1 month ago

I also wanted to interface to the wired remote so I could use the memory settings 1 and 2. In my case, memory position 1 is all the way down and memory position 2 is as far up as I want it to go.

I used my multimeter to find the pins on the board corresponding to the 2 buttons and soldered wires to them.

PXL_20241015_200540764 MP

I'm using an Arduino Uno with an IR receiver to detect the TV power toggle signal. I'm using this Arduino library https://docs.arduino.cc/libraries/irremote/#Releases

I plan to power my Arduino from the Vevor 5V power at the wired controller.

The wired controller button inputs are normally high (about 3V) at the STC 8H1K16 micro-controller and pressing the buttons pull those inputs to ground.

I might switch to some other 3V microcontroller instead of the 5V Arduino so I can connect digital outputs from "my micro-controller" directly to the Vevor controller button inputs. Otherwise, I might use either relays or an opto-isolator between them.

The other problem is that when I turn the TV off, both the TV and my micro-controller will get the IR signal. But when the TV is in the down position it won't see the IR signal to turn on. So, I need to do one of these options:

  1. disassemble my TV and relocate the IR receiver from the bottom to the top (maybe 3D print a small bubble to mount it in) so that it gets the power-on signal when it's at the bottom position
  2. have my micro-controller use an IR LED down in front of the TV to turn it on when it's hidden from the regular TV remote
  3. hard-wire my controller to the TV power switch
  4. use an off-the-shelf IR extender
  5. use 2 mirrors like a periscope to bounce the IR signal behind the TV cabinet

I'll post an update with my final results.

LeeDr commented 1 month ago

I have finished an implementation that works well for my purposes. I still need to move it from the breadboard and do some packaging to make it neat, but I'll describe what I've done in case it might be useful to others.

I'm using an esp8266 board. Yes, it's a WiFi board but I'm not using any WiFi functionality. It was just a handy board I already had which had 3V digital outputs matching the Vevor wired controller. I'm powering the esp8266 from the Vevor wired controller's 5V pins. This gives my esp8266 the same ground reference and I interface the digital outputs directly to 2 of the wired controller's button pins.

One key change is that I added a ACS712 device to measure the current to my Roku TV. When the current goes below a threshold, I know the TV has been turned off and I can pull the pin for the button on the Vevor wired controller that goes to the down position down to ground. I actually pull it down, delay 200ms, back up, delay 200ms, back down, delay 200ms, and back up. This is because I think the wired controller needs to be woken-up, and I don't think it hurts to hit it twice even when it is already awake.

To raise the TV, I have an IR receiver connected to the esp8266 and whenint TV_State == 0 the program waits to receive the "Up" direction button signal from the Roku remote. This sets TV_State = 1.

When TV_State == 1 the program loops waiting for the AC current to be greater than the threshold (when the TV has been turned on with the TV remote power button). Then set TV_STate = 2. This is so that I don't keep trying to react to the IR signal for UP, and so that I don't try to lower the TV because the current is low.

So it's not quite the most desired result. The TV down is automatic when the TV power is turned off, but the Up/On process requires 2 button presses, the "Up", and then to "Power".

The code is basically an IR Receive example, and the AC current measuring example merged together.