Using an ESP8266 As a WiFi Enabled Universal Remote


Introduction: Using an ESP8266 As a WiFi Enabled Universal Remote

About: Hey everyone! My name is Brian and thanks for checking my Instructables. I'm a software developer by trade but I've recently gotten into Arduino development after discovering the esp8266 chip, a WiFi enab...

Hey Everyone!

In this instructable I'm going to show you how to make a WiFi enabled universal remote that you can control with your phone or computer.

I think it's a cool project that can be easily adapted or extended to whatever suits your needs.

Check out the video for a demo and quick run through what's involved in the project.

The code, hardware and circuit diagram are available on github.

Step 1: Hardware for the Project

The hardware for the project is pretty straight forward, you will need the following parts:

  • Wemos D1 Mini
  • IR LED
  • 2N3904 (Although a 2N2222 might be a better choice)
  • 330 Ohm resistor
  • IR Receiver (TL1838) - Needed for reading codes.
  • A breadboard (everything fits on a mini breadboard)

Rather than connecting the IR LED directly to the pins of the ESP8266, we need to use a transistor as a switch. This is so the IR LED can get enough current.

The rest of the circuitry is pretty straight forward.

Step 2: Software

The library I'm using for handling the IR sending and receiving is IRremoteESP8266 by MarksZazbo

First thing we need to do is flash the IrRecvDumpV2 example from the library to read the codes, just make sure to update the receive pin to the pin you are using for the IR receiver.

Open the serial console and press the button on the remote that you want to emulate. I recommend pressing the button a few times to ensure you have the right code. Take down the encoding and data for each button press.

Once you have all the codes for the buttons you want to emulate, download the sketch from ESP8266 IR Remote Example github.

The sketch hosts a web server, where the main webpage has various buttons representing the commands for the different remotes. Each button when clicked makes an Ajax call to unique end point that contains the actions behind each button.

Most of the buttons just send single commands, but commands can also be combined together to perform macros. In the example sketch the Chromecast button changes the channel on the TV and changes the sound input my receiver.

Hopefully this project proves useful if you are interested in making a similar project. It still needs some more work, as although my TV and Receiver work very well, commands to my Satellite box only work from short range. I will come back to this project again as I think there is a lot of cool things you could do with something like this.

If you have any questions please let me know.

Thanks a lot,




    • Clocks Contest

      Clocks Contest
    • Oil Contest

      Oil Contest
    • Woodworking Contest

      Woodworking Contest

    We have a be nice policy.
    Please be positive and constructive.




    Good afternoon.

    I have mounted his circuit and worked well only with a samsung TV with another 3 tv but it did not work being the same code that is captured.

    The original command sends 2 equal codes.

    to add the code of a fujitsu AC command that line must be taken?

    thank you very much for your help and the great job

    Good instructable :) easy to build.
    I had a few problems, but all were because I couldn't get exact same components.

    I used a BC547 instead of the 2N3904
    and my IR receiver was a 382403A from Jaycar
    I finally figured out that the IR receiver needed 5v, and couldn't run the emitter at the same time.
    Anyway it works! and now my phone can turn on my AC and TV :)
    Thank you very much.

    ps. sorry Mamvcivm, I have no idea about your problem.

    Hi there, I'm really struggling with this - I keep getting an error when compiling this on a Windows 10 laptop - I get the following error:-

    BasicWebRemote:22: error: 'D2' was not declared in this scope

    #define IR_SEND_PIN D2


    C:\Users\mamvcivm\Documents\Arduino\BasicWebRemote\BasicWebRemote.ino:26:15: note: in expansion of macro 'IR_SEND_PIN'

    IRsend irsend(IR_SEND_PIN);


    exit status 1

    'D2' was not declared in this scope

    I thought I'd try installing Arduino on a Raspberry Pi and install the library via GIT, however the command cd ~/Arduino/libraries
    git clone fails as the folder doesn't exist - if I create it and then import the library and then try to compile BasicWebRemote I get the error: BasiWwebRemote.ino:1:25: fatal error: ESP8266WiFi.h: No such file or directory

    compilation terminated.

    Can you please help?