This project was about allowing me to turn the bedroom tv on and off via voice control. I already had an Amazon Echo Dot in the bedroom, so I had a way to capture intent. What I needed was a way to turn that intent into an infrared signal that the tv would receive as a power on/off command.
ESP8266/NodeMCU proves to be useful yet again as a cheap, low-power wifi module that can interface to analog devices, such as LED receiver and emitter.
I found this absolutely fantastic project on Github called ESP8266-HTTP-IR-Blaster which provides a ton of useful functionality, such as sending and receiving infrared signals, as well as a handy web interface for viewing codes and showing system info.
Since the software sketch was so full featured, this project would really be more of an exercise with getting the hardware working, and finished into a reasonably durable device.
The first step was to acquire the electronics, and get them working in a breadboard.
This came together pretty easily, so I flashed the sketch on to the NodeMCU, and was then able to use some pretty useful debugging info via the Arduino serial monitor. The web interface was also available – here is an example showing several codes being sent:
After proving that the hardware and software were working as desired, I next soldered the components to a PCB. For the NodeMCU, I soldered a couple of header rows so that it could be removed or replaced later.
When all the local Radio Shacks were going out of business, I grabbed up a lot of stuff on deep discount–one of things I got was a small black project box with a screw on back. The PCB with all the components fit perfectly.
A little hot glue held the LED emitter in place.
I used a Dremel to cut a little slot for the USB power cable.
I mounted the box to the underside of the tv pointed at the LED receiver: