WiFi – IR Gateway a.k.a. Give your Dumb (Old) Devices the Smarts!

Some time ago I also completed this project that I never got around to publish. This project is a WiFi-Infrared gateway. I am aware that such commercial products exist, but at the time I needed one for my home the available options all suffered from one or more shortcomings, such as not being open source, not working with my own (very old) IR-capable devices, expensive (I wanted several pieces, one for each room in my house), etc. So I decided to build my own. this also had the added benefit of learning about IR communications, etc. Below is a recap how I went about it, what difficulties I have encountered and a detailed description of the project should one want to make one. The whole project is now open source.

Hardware

My WiFi-IR gateway is designed around the well known and documented ESP8266 based ESP-12F module. The circuit is rather simple, consisting of only a few parts apart from the ESP-12F module. These are the main groups of parts on the custom built PCB:

  • Power circuitry: Takes 5V DC via a USB Mini-B socket from any USB phone charger and delivers 3.3V to the rest of the circuit.
  • ESP-12F module with its “mandatory” company of Reset and Programming buttons etc.
  • IR receiver to “learn” new codes from (almost) any IR device.
  • IR transmitter circuitry including the IR LEDs and their driver, which in this simple case, is a simple transistor in switch mode.

That’s it, that simple!

What caused me a bit of grief is that, as I learnt the hard way with a lot of experimenting, not all IR LEDs are created equal: When preparing for this project, on the breadboard, I used an old IR LED that I had recovered from an old and thrown away TV remote control. Sending IR commands across the room, even without pointing directly at the receiver, worked perfectly. For the final item, though, I ordered some IR LEDs (of the same wavelength) from eBay. Unfortunately, these LEDs performed very poorly: First I thought they were completely broken, but then I realized that if I place the transmitter LEDs within a cm or so to the receiver, then my circuit worked. I got like a 100 such LEDs, so I tried a few more, but they all performed the same way. I was convinced that they were faulty, so I got another batch from another supplier. when they arrived, however, I was disappointed to see that this new batch was as bad as the first one. THEN I started to do a deeper research on the subject, and I found out that the wavelength (in my case 940nm) is not the only critical parameter. So I ended up buying a few TSAL6400 IR transmitter LEDs from Vishay. When I put just one of them in my circuit it already “illuminated” the whole living room, without having to pointed it to the target receiver. For extra robustness, I have place for 3 pieces of 5mm IR LEDs on my board, although so far haven’t needed more than one in any room for reliable operation.

Firmware

The firmware I created this WiFi-IR device is open source and is available in my GitHub repository. The code is a modified version of my open source ActoSenso Framework.

At the moment it supports only IR codes that I use around my house. If you want to use it, you will need to add your own IR commands that your IR devices understand, or download them from somewhere on the internet. I haven’t found IR codes for my devices, so I used the “learning” functionalities of this device: Once it detects an IR command, it decodes it and sends it on via MQTT to a server. Then I can either add it to the firmware or use it from my home automation server. It is not a fully automatic learning system, but it is sufficient as I don’t need to add new commands every day. I did it once, and never touched it again.

I haven’t tried it, but I see no reason why Tasmota (the IR version of it) wouldn’t run on my device.

Conclusion

After some minor hurdles with the IR LEDs I now have a perfectly working WiFi-IR gateway in each room with an IR device in it with the following major functions:

  • WiFi to IR gateway translates commands received over MQTT to infrared.
  • IR to WiFi gateway forwards received IR commands to MQTT server.
  • Manual learning of new IR codes
  • Can be used as an IR code sniffer or a TV-b-Gone!
  • Super bright IR LED

Your thoughts?

This site uses Akismet to reduce spam. Learn how your comment data is processed.