I'm about to finish a vertical cab, in which I used a cheap 40 inch LCD TV, mounted vertically.
One problem I had, was that the TV would not turn on and off with the PC it is connected to.
The PC uses DVI so I could not use any HDMI CEC functionality.
What I came up with eventually, is an Arduino based IR transmitter that will send the right "remote control" command to the TV when the Windows starts and shuts down, as if I pressed the "Power" button on the remote.
The steps are roughly as follows:
1. Buy an
Arduino board (I used an UNO clone that I already had), an
IR transmitter and
receiver. I actually used 2 Arduino boards for testing. Given the price, you may want to do the same, but you can get away with just one.
2. Install the
Arduino IDE .
3. Install the
IRremote library.
4. Connect the receiver pins to the board. The data pin from the receiver to PIN 11 on the board, and 5v and ground to the corresponding pins.
5. Upload the IRrecvDump code from the examples in the IRremote library, to your board.
6. Open Serial Monitor.
7. Point the TV remote to the receiver and press the "Power" button. The monitor should print the data the it received. In my case it was "NEC, 4FB4AB5, 32 bits"
8. Use the above information to edit
this script. Change the line:
irsend.sendNEC(0x4FB4AB5, 32);
You can find the function name (sendNEC, for NEC...) in
this file under the IRsend class.
9. Remove the receiver and connect the IR LED (Transmitter) to the Arduino. Use PIN3 for the data, and 5v and ground to the corresponding pins.
10. Upload the edited script to the board.
Now the board is configured to send the IR code every time it gets anything on the serial input. The next thing to do is to connect the board to the PC via USB and send anything (I simply send the letter "A") on the correct serial (COM) port.
I did it with a simple powershell script.
11. Install the Arduino drivers (comes with the IDE) and connect the board to the arcade PC via USB.
12. Open Device Manager and find the COM port that the board uses.
13. Edit the COM number in the following script and save it somewhere as a .cmd file (for example "c:\scripts\ir_script.cmd"):
powershell $port=new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one;$port.open();$port.WriteLine(\"A\");$port.close()
(I'm using a cmd file to call powershell, to avoid messing with the execution policy restriction, and because windows startup\shutdown scripts does not run ps scripts.. or at least it didn't for me)
14. Point the IR LED to the TV, and run the script. Hopefully the TV will turn off
15. Enter the computer's group policy editor (gpedit.msc), and go to Computer Configuration -> Windows Setting -> Scripts (Startup/Shutdown)
16. Edit the properties for both scripts, and point it to the above script (c:\scripts\ir_script.cmd).
17. It seems that the script do not run on shutdown and starting from shutdown state (as opposed to restart) when Hibernation is enabled. To disable it run as administrator the command:
powercfg /h off
Note that windows update may turn hibernation back on.. so pay attention
Some extra information can be found here:
https://learn.sparkfun.com/tutorials/ir-communicationI couldn't find in the forums anyone that came up with the same solution as I did, so here it is
.