Voice control your Panasonic projector with an esp8266 (Alexa compatible) and control sources on an 4x1 HDMI switch
My projector is on a high closet, which also houses the media stuff and HDMI cables. Since they're behind a door and I don't want to setup an expensive universal remote or leave the door open for IR to work, I wanted a reliable way of turning the projector on and off, and also switching video sources. Most crucially, searching for remotes is annoying in the dark. I decided I would find a way to voice control those functions for more convenience.
Thankfully I found out about fauxmoesp which emulates a wemo device with on/off control, requiring little setup/piping and no extra servers/accounts to get it to work. (unlike other solutions I have seen through IFTTT and such)
(Links are just examples for what I have ordered)
- Panasonic PT-AE3000U projector (might work on other Panasonic models if they use the same protocol) Projector manual
- Monoprice HDX-401TA 4x1 HDMI switch
- ESP8266: D1 mini wiki
- MAX232-based level shifter board
- IR led module: 5V powered, 3.3V data, built in transistor for high-power driving of the LED and a visible blue LED to see transmit activity. Handy.
- TSOP38238: 38kHz IR receiver, for learning codes. Not used in final project.
- wire, soldering iron, box, the usual
- platformIO core
- Arduino esp8266 framework (latest version)
- fauxmoesp
- IRremoteESP8266 (I used
IRrecvDumpV2
to get the IR codes)
Please ignore the pretty ugly for
loops for writing the bytes, it worked. I may revisit the source to clean it up a bit sometime.
You can probably use the Arduino IDE for building, assuming you git clone the libraries manually to your machine. platformio takes care of all of that for you.
STX
and ETX
, Ctrl+B and Ctrl+C respectively, are used to show message start and end, and the rest is ASCII uppercase chars. Pretty straightforward from the manual. I actually used "menu" keypresses to test stuff repeatedly without having to turn it on and off.
- ON :
char pon[] = {0x2, 'P', 'O', 'N', 0x3};
- OFF:
char poff[] = {0x2, 'P', 'O', 'F', 0x3};
I don't really bother checking the return bytes from the projector since I can hear it powering up or down.
They are all NEC 32 bytes codes, easy once you know the actual value to use. All the values are in the code as #define
if you need them. I originally tried to use my Intel NUC PC's IR receiver to get the raw codes but that didn't go anywhere so I ordered the TSOP chip.
- MAX232 board pictured in a little project board, next to the upside-down esp8266. The annoying part is that it that the MAX232 breakout was wired opposite to what I thought it should be which caused a lot of head scratching (projector control was working sending bytes straight from a PC but not from the ESP board) Once I swapped RX/TX wires it all worked. Always double check mystery breakfout boards!
- Setup I used to learn codes and make sure the LED module worked (the remote is the one I learned codes from)
- The IR led module is at the end of a ~60 cm long wire, to route it where it's needed. I was worried of signal integrity, but it's low-ish frequency (38kHz) and works very reliably inside the closed cabinet.
- IR emitter aimed at the HDMI switch. Blue tape is to dim the brighter-than-a-thousand-suns blue leds, and makes for clearer labelling.
- Full setup. Hardware is next to the NUC (powered by it and serial can be monitored/firware reflashed), switch is above it. All wiring goes behind the shelf, and through a hole in the top to the projector.
I used two "gadget boards" so I was short one ground pin and didn't want to make a perf board just for that. I just added an extra ground pin to the D1 mini with a 90 degree bend on it. Works like a charm.