Alexa Compatible IR Bridge Using an ESP8266

6,197

19

14

Introduction: Alexa Compatible IR Bridge Using an ESP8266

I wanted a way to control my smart TV via Alexa. Unfortunately my Hi-Sense 65" Smart TV does not have the ability to be controlled via WiFi. It would have been nice if it had some sort of API that I could use to interface with it.

So I created an IR bridge that will allow you to control it by means of a stationary IR bridge that is compatible with Alexa.

Supplies


3d printed enclosure - If you do not have access to a 3d printer you can always build this using something home made. Downloadable from here https://github.com/mailmartinviljoen/LittleNodes_IR_Bridge

NodeMCU ESP8266 micro controller.

2 IR Transmitter LEDs. These LEDs only have 2 legs and they are connected the same way you would connect an ordinary LED (Flat side is the negative)

1 IR receiver for learning remote commands from an existing TV remote. You have to use an IR receiver that has 3 legs, VCC,GND and data out.

1 RGB Led, this is optional, you don't need it and it will function without any modifications needed.

Other downloads
ESPFlasher Tool https://github.com/nodemcu/nodemcu-flasher

Step 1: Connecting Everything Together

Both of the IR transmitters LEDs are connected in Parallel. Flat sides to any GND pin on the NodeMCU and the other 2 legs joined together connected to GPIO Pin D2 on the NodeMCU. I'm not sure if they need to be connected via a resistor but I figured the ESP8266 output is only 3.3V so they should be safe. Also they are not used all the time. They only come on when it's sending a signal.

The IR Receiver As shown in the picture it has 3 legs. The data out pin has to be connected to GPIO D5 the GND to GND and offcoarse the VCC to a 3.3V pin on the Node MCU


RGB LED Has 4 legs, GND and then positive for Red Blue and Green. The RGB legs go to GPIO pins D6 D7 and D8. The order does not matter. It will just show different colors.

Once assembled you can simply flash it using the Binary that I created. see the next step.

Step 2:

Flashing the binary to the ESP8266 instead of directly from the Arduino sketch means you don't have to have all the libraries installed. You can use the Esp Flasher tool downloadable from here.

https://github.com/nodemcu/nodemcu-flasher

And both the sketch and binary can be downloaded from my GitHub page.

https://github.com/mailmartinviljoen/LittleNodes_IR_Bridge

Unfortunately this is not all you have to do. Once you flashed the image you need to also upload the HTML web interface that is making use of bootstrap to configure the NodeMCU. The tool used to upload these files is an external plugin that you need to install in the Arduino IDE. Instead of re-creating the tutorial, here's a great article that shows you how to do it.

https://randomnerdtutorials.com/install-esp8266-filesystem-uploader-arduino-ide/

Place the contents of the data.zip file in a folder called data in the same folder where the .INO files are in.

You have to open the .INO file in the Arduino IDE. If you installed the plugin correctly you will see under tools an option called ESP8266 Sketch Data upload. After uploading it the device will finally be programmed.

Note: If you don't upload the files, once you connect to the access point in setup mode the page will be blank because it cannot find any pages to load.

Step 3: Learn IR Codes and Save Them Onto the NodeMCU

Instead of explaining in text form how to set up your new IR device I created a video that demonstrates how it work and also explains how to program the device with IR codes.

Watch the video!

Some extra information.

Libraries uses (Not created by me)

https://github.com/esp8266/Basic/tree/master/libraries/IRremoteESP8266

Wemo Emulator


Possible problems.
My TV is making use of the NEC IR protocol, so there is a posibility that your TV will not work if it does not make use of the same type of IR codes. I.E My fan has a remote. The device will learn the codes but it doesn't work not sure why , you will have to fiddle with the IRsend and Receive libraries in order to figure out why.

The 3d printable STL is also on my github page.

Be the First to Share

    Recommendations

    • Fandom Contest

      Fandom Contest
    • Stone, Concrete, Cement Challenge

      Stone, Concrete, Cement Challenge
    • Backyard Contest

      Backyard Contest

    14 Comments

    0
    tripleaarnold23
    tripleaarnold23

    2 months ago

    Pls guys if you have successfully gotten the webpage to show, help me am stocked

    0
    skdemont
    skdemont

    Question 1 year ago

    i have gotten everything flashed and uploaded but when i try to connect to the setup in the access point the 192.168.4.2 is refusing connection

    Starting Operational Mode
    Reading Configuration from filesystem...
    Reading:fSSID.conf
    /fSSID.conf File not found.
    Reading:fPassword.conf
    /fPassword.conf File not found.
    Reading:fSensorName1.conf
    /fSensorName1.conf File not found.
    Reading:fSensorName2.conf
    /fSensorName2.conf File not found.
    Reading:fSensorName3.conf
    /fSensorName3.conf File not found.
    Reading:fSensorName4.conf
    /fSensorName4.conf File not found.
    Reading:fSensorIR1.conf
    /fSensorIR1.conf File not found.
    Reading:fSensorIR2.conf
    /fSensorIR2.conf File not found.
    Reading:fSensorIR3.conf
    /fSensorIR3.conf File not found.
    Reading:fSensorIR4.conf
    /fSensorIR4.conf File not found.
    Local Wifi SSID:
    Local Wifi PASS:
    SensorName1::
    SensorName2::
    SensorName3::
    SensorName4::
    Setting Up Wifi
    Connecting to
    WiFi connected - IP address: 192.168.0.22
    Adding Wemo Virtual Devices ...
    Begin multicast ..
    Udp multicast server started at 239.255.255.250:1900
    WebServer started on port:
    80
    Adding switch : index : 0
    Adding:
    WebServer started on port:
    81
    Adding switch : index : 1
    Adding:
    WebServer started on port:
    82
    Adding switch : index : 2
    Adding:
    WebServer started on port:
    83
    Adding switch : index : 3
    Adding:
    Starting the Infrared routines...
    Now running in operational mode...
    Flashing LED slowly to indicate that this node is now online

    0
    Uliblack12
    Uliblack12

    Answer 1 year ago

    Man help me please

    0
    alarm_guy1
    alarm_guy1

    Reply 1 year ago

    you need to go to 192.168.4.1 not 2

    0
    tripleaarnold23
    tripleaarnold23

    Reply 2 months ago

    Mine shows blank page help me pls

    0
    warrenjb
    warrenjb

    5 months ago

    You have two binaries in your github page. Which one should be flashed? the ino.bin or the spiffs.bin? Thanks

    0
    tripleaarnold23
    tripleaarnold23

    Reply 2 months ago

    Pls how were u able to make the webpage come up. Really need help

    0
    warrenjb
    warrenjb

    Reply 5 months ago

    Forget above. Re-uploaded and can see esp html now. Only problem is Alexa won't discover devices. Do I need a skill enabled?

    0
    instuctorconstructor
    instuctorconstructor

    Question 6 months ago

    i installed all correct and i added on the web-interface all of the configurations it also connects to my wifi but alexa wont find my device what do i have to do else?

    0
    newbee90
    newbee90

    7 months ago on Step 3

    Has anyone programmed this scetch to a universal wifi remote with tuya TYWE3S chip?

    IR-Fernbedienung-Smart-wifi-Universal-Infrarot-Tuya.jpg
    0
    Jugaad it yourself
    Jugaad it yourself

    1 year ago

    For two weeks Im struggling to do this project please help me, have done everything what you have told in the intructables they only thing Im stuck right now is that my web interface is coming blank can you please help me

    0
    Jugaad it yourself
    Jugaad it yourself

    Question 1 year ago

    hey buddy can you help in this I have done all the steps correct but im unable to see the web interface i mean the setup page

    0
    ostaaz
    ostaaz

    1 year ago on Introduction

    Would you please send the direct link of the stl file?
    I can’t find it in your github.

    0
    Jugaad it yourself

    Hi there
    "You have to open the .INO file in the Arduino IDE. If you installed the
    plugin correctly you will see under tools an option called ESP8266
    Sketch Data upload"
    can't see this option I m unable to add the plugin please help