Universal Remote Using ESP8266(Wifi Controlled)

About: Nothing just a tech enthusiast and by degree an Electrical Engineer

Intro: Universal Remote Using ESP8266(Wifi Controlled)

This project is to replace the conventional remote control for all the home appliances like AC, TV, DVD players, music system, SMART appliances !!! Making a whole junk of remote littering around, making us puzzle!!!

This project will save us from the junk to remotes by replacing all by ONE REMOTE!

2 part of this project:

  • DECODING ANY REMOTE
  • ENCODING ESP8266 NODEMCU 1.0(ESP-12E module) or any esp8266 version with a ttl connection

IMPORTANT : PLEASE READ THE WHOLE PROJECT THOROUGHLY IT WILL TAKE 3MINS BUT DON'T HALF-READ AND DAMAGE YOUR PARTS.... I WILL NOT BE RESPONSIBLE!!

Step 1: Configuring Nodemcu With Arduino IDE

  • First of all connect the Nodemcu (my one is lolin v3, amica and other clones will work too) with computer or laptop.
  • Now install the driver of nodemcu(google search will help).
  • After this open the Arduino IDE (Ofcourse you need to download it and install it)
  • Click on "Tools" on Arduino toolbar
  • Click on "Board"
  • Select "Board Manager" and search for esp8266 install it (will take some time to finish)
  • Now, select "Sketch" from arduino toolbar
  • Select "Include Library" from there select "Manage libraries"
  • Search for "IRremoteESP8266" and install it

Now the configuration is done only from "Tools" we need to go to "Boards" Select "NodeMcu 1.0(ESP 12-E)" or something else version of ESP8266.

Step 2: DECODING a Remote |CIRCUIT | Code

So, to make a universal remote we need to decode the other remotes i.e. to get IR hexadecimal codes emitted by each button of remotes. Just like to speak universally we need to know every language!!! OR learn English! Though I love my mother tongue Bengali the sweetest language!! REALLY it is, search it...

So components needed to decode a remote:

  • Nodemcu board
  • TSOP1738 IR reciever or some other IR recievers
  • jumpers

Now, follow the above circuit but after uploading the sketch to the nodemcu through Arduino.

  • Open Arduino and connect the nodemcu to laptop or computer
  • From "Files" select example go down and from IRremoteESP8266 select the IRrecvDump
  • Upload to nodemcu

Connect the TSOP1738 to Nodemcu as the circuit and open the "serial monitor" from Arduino to see the decoded hex-code of any remote as pictures given above. Still uploading the code

Step 3: Encoding Nodemcu | CIRCUIT

After decoding the remotes now it's turn to upload the hex-codes to Nodemcu so that it can give IR led commands to emit those hex-code signals.

  • NOTE: can't connect IR led directly to Nodemcu cause it can't deliver enough current.
  • So need transistor moderated IR LED i.e. signal from Nodemcu goes to transistor then IR LED.
  • Transistor like 2N222, 2N3904,BC547 works but

Transistor 2N222,2N3904 collector current : 600mA

Transistor BC547 collector current : 100mA

both works...

CAUTION SEE THE COLLECTOR, EMITTER, BASE TERMINALS as BC547 and 2N222 have different convention. I have used BC547 as it is easily available and works fine.

Code is taken from "IRremoteESP8266" examples "IRserver" modified accordingly as shown in picture.

circuit as shown. Please NOTE I have used BC547 transistor and NO resistance between base and D2 pin.

THE COLLECTOR, EMITTER, BASE ARE INDICATED IN PICTURE. DON'T DO THE SAME FOR OTHER TRANSISTORS.

EDITS: Credits "3615JMD"

IMPROVENTS:

May I suggest 2 improvements:
1) if one replaces : uint32_t code = strtoul(server.arg(i).c_str(), NULL, 10); by this uint32_t code = strtoul(server.arg(i).c_str(), NULL, 16); The web page accepts HEX codes directly. No need to convert manually to decimal !

2) I have improved the handler to be able to work with multiple IR formats. Nice when we want to control several devices from different brands: (more formats can be added with a switch/case)

void handleIr()

{ for (uint8_t i = 0; i < server.args(); i++) { if (server.argName(i) == "rcmm") { // format pour la freebox uint32_t code = strtoul(server.arg(i).c_str(), NULL, 16); irsend.sendRCMM(code, 32); Serial.println(code); } else if (server.argName(i) == "rc6") { // format pour la TV phillips uint32_t code = strtoul(server.arg(i).c_str(), NULL, 16); irsend.sendRC6(code, 20); Serial.println(code); } } handleRoot(); } The HTTP links must be modified accordingly of course : .... href=\"ir?rcmm=2400260C....... .... href=\"ir?rc6=0000C ....

Step 4: Encoding Code

I have taken the code from examples of "IRremoteESP8266", "IRserver".

But there are some changes to be done your wifi credentials - Wifi ssid, Wifi password

The Web server based codes(yellow highlighted) - This codes are the decimal form of the hexadecimal IR codes. This decimal values are passed to ESP8266 as arguments converted to hex-code and transmitted to IR LED.

IMPORTANT : AFTER DECODING A REMOTE BUTTON CONVERT THE HEXADECIMAL CODE TO DECIMAL AND REPLACE IT IN THE Arduino program. Its not very hard to convert hex to decimal, search google for online hexadecimal to decimal converter.

images are self-explanatory!!!

Step 5: CONTROLLING

We can control it through the web server links... the IP of ESP8266 module on our router can be known by opening the serial monitor just after uploading the code. As in picture mine is 192.168.0.1

On opening this IP in any browser of mobile or laptop we can see the page as shown in picture.

OR ELSE FOR CONVENIENCE and simplicity we can use a android app...

"HTTP REQUEST SHORTCUT" app and do write the address to easily execute the code. As in picture, we can add widget on home screen to easily access the virtual buttons and get the necessary remote buttons.

Pictures are self explanatory.

SO WITHOUT WRITING IN THE PROGRAM WE CAN PASS THE ARGUMENT "CODE" WITH DECIMAL OF THE HEXADECIMAL CODE EXTRACTED FROM DECODING REMOTES DIRECTLY IN THE WIDGET.

IMPORTANT : PLEASE READ THE WHOLE PROJECT THOROUGHLY IT WILL TAKE 3MINS BUT DON'T HALF-READ AND DAMAGE YOUR PARTS.... I WILL NOT BE RESPONSIBLE!!

Step 6: Project Packed GIF!!!

If you like this make this project your favorite and encourage to do next project like internet controlled home automation... or something better!!!

Thanks a lot enjoy a remote-free life!!!

Share

    Recommendations

    • Plastics Contest

      Plastics Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Optics Contest

      Optics Contest

    22 Discussions

    0
    None
    AtuxA

    Question 1 hour ago

    i cannot find anywhere in the market the sending IR LED device you are using. which one is it?

    1 more answer
    0
    None
    Abhrodeep ChandaAtuxA

    Answer 8 minutes ago

    You can easily get it on amazon/ebay online. I actually purchased it from a shop offline as they keep all types of electronic components.

    0
    None
    AtuxA

    Question 1 day ago on Step 6

    Dear Sir, i came across your project and it exactly what i was looking for. I am trying to collect the components and i have issue with TSOP1738. I would like to ask if i could connect a different one (Infrared IR Receiver Sensor Module KY-022). Unless you have to propose something else. Since i do not have experience with electronics, it has to be as identical to current and all the components needed for this job.

    1 more answer
    0
    None
    Abhrodeep ChandaAtuxA

    Answer 22 hours ago

    Both are just identical as both operate in 38KHz, just check pinout for signal, 5V and GND pins. Difference between this two are - Angle of reception (TSOP1738-90degree , KY-022 - 45degrees) , Operating current range (0.4mA to 1.5mA - ky-022, 0.4mA to 1mA - TSOP1738). No other major differences.

    0
    None
    ROUGEXIII

    1 day ago

    Hi,
    Can you explain why you don't need resistor for your emitter led?
    How do you set the current limit to not damage the led?

    1 reply
    0
    None
    Abhrodeep ChandaROUGEXIII

    Reply 1 day ago

    I have used a transistor i.e. BC547 that has a collector current of 100mA for which ai don't need a ressistor to limit the current. If I would have used 2N222 transistor definitely there will be a resistor to limit the collector current of 600mA. Thanks for asking but I mentioned it in the article about the collector current of the different transistor. For BC547 the range also gets short as the led is not emitting at its peak.

    0
    None
    PatM149

    Question 2 months ago

    Will this work with non NEC decoded remotes? Is it possible to use the captured rawData for this project? Thanks!

    ssss.PNG
    3 more answers
    0
    None
    Abhrodeep ChandaPatM149

    Answer 2 months ago

    There is a 175bits Hexcode you can use it, it will work. AC is having some problem but it should work fine to my knowledge as I tried afterwards. just need to be correct with code and number.

    0
    None
    PatM149Abhrodeep Chanda

    Reply 8 weeks ago

    Thank you for your reply! I changed this line of code :

    uint32_t code = strtoul(server.arg(i).c_str(), NULL, 10);

    irsend.sendNEC(code, 32);

    to :

    uint16_t code = strtoul(server.arg(i).c_str(), NULL, 10);

    irsend.sendNEC(code, 175);

    and I converted C71AE5F4 to hex but still it doesn't work. Please help me thank you!!

    0
    None
    Abhrodeep ChandaPatM149

    Reply 8 weeks ago

    " I converted C71AE5F4 to hex"? but this is itself a hex code. I dont understand. unit32_code was alright. we cant put irsend. sendNEC(code, 175) to represent 175bit sending signal just put that hexcode you got in the picture 34B8AC66

    0
    None
    CristiI5

    2 months ago

    Hi, I'm using HX1838 ( https://www.optimusdigital.ro/ro/componente-electr... )

    receiver and I got a lot of "ghost readings", so if I'm not seding signals from remote in the serial console I get random readings (3, 8 10 bits). And when I press the remote button, I got "UNKNOWN" status almost time. From 20-30 readings of same button, just once is detected correctly. I tried to hide the sensor, I tough reads something from the computer screen or from light bulbs, but not.

    Do you have any idea why this happens or how can I solve it?

    Thank you.

    3 replies
    0
    None
    Abhrodeep ChandaCristiI5

    Reply 2 months ago

    I dont have any idea about HX1838 but please check the circuit. If you are using BC547 then change it to 2N222 and use a pull up resistance. And read the circuit portion carefully. loose connection can be the luckiest solution though.

    0
    None
    CristiI5Abhrodeep Chanda

    Reply 2 months ago

    It is about the receiver. As I understand the transistor is needed for the sending led. I put same receiver on a arduino nano and that reads correctly. On nodemcu v3 only errorer readings and fake teadings.

    0
    None
    Abhrodeep ChandaCristiI5

    Reply 2 months ago

    Sorry but your perception about transistor is wrong as it here acts as a current amplifier and boosts the signal received from the IR led. So if the current is not up to the mark the signal will give errorneous results. And arduino is of 5V logic but nodemcu is of 3.3V logic so transistor matters for nodemcu

    0
    None
    vivekd36

    Question 2 months ago on Step 5

    Hey i liked your project, but i want to make a remote clicker to remotely control my presentations specifically on prezi using nodemcu. Technically it is possible. Can you help me with that or would you like to work together. I have present next week and i would really appreciate it if you can help me with this. Please feel free to contact me if you want to.
    My email id is:- monu5vivek@gmail.com

    2 more answers
    0
    None
    Abhrodeep Chandavivekd36

    Answer 2 months ago

    If you will be presenting in windows system presentation can be controlled using nodemcu or Arduino itself just need to use some python code/ Arduino IDE itself and use IR as trigger, onClick method but I need sime time to think about the code. The system you will be running the presentation on should have arduino or nodemcu connected to it. Sorry I can make it but in this week I dont have time. I will make it and post it though. Sorry I apologize cause I have some work or else if you had time I would have definitely helped.

    0
    None
    vivekd36Abhrodeep Chanda

    Reply 2 months ago

    It's okk and I would still appreciate if you can post it whenever you have time. Another thing which i would like is to connect NodeMCU with the Windows system using Wifi Module rather then IR as it would be more practical. And the last thing is that the code has to be specifically designed for different presentation softwares like PPT or Prezi so that can be a challenge. I would also work on this and post it here if i get any success regarding that.

    1
    None
    chuongle

    4 months ago

    My air conditioner is Hitachi. When I hit the ON key on remote control for encoding phase, the IRrecv said it is Panasonic or Unknown:

    =======================

    80080002FDFFDecoded PANASONIC - Address: 8008 Value: 80080002FDFF (48 bits)
    Raw (100): 3350 -1700 432 -1246 432 -406 432 -404 432 -406 432 -404 434 -404 432 -404 432 -410 432 -402 432 -404 432 -404 434 -404 432 -1244 432 -404 432 -406 432 -408 432 -402 432 -406 432 -406 432 -404 432 -406 432 -406 432 -404 432 -408 432 -402 432 -406 432 -404 432 -404 432 -404 432 -404 432 -1244 432 -408 432 -1240 432 -1242 434 -1242 434 -1242 432 -1242 434 -1242 432 -404 434 -1246 434 -1240 432 -1242 432 -1244 432 -1242 434 -1242 432 -1244 432 -1242 432 -1246 434
    FB9D369CUnknown encoding: FB9D369C (50 bits)
    Raw (100): 406 -432 404 -434 1242 -432 406 -432 404 -432 410 -432 402 -432 406 -434 1242 -432 1242 -432 408 -432 1242 -432 1244 -432 1246 -432 402 -432 404 -432 406 -432 1244 -432 1242 -432 1242 -432 1244 -430 410 -432 1240 -432 1244 -430 1244 -434 404 -432 406 -434 404 -432 406 -430 1248 -434 400 -432 404 -432 404 -432 406 -432 406 -432 406 -432 404 -432 408 -432 1240 -432 1242 -432 1244 -432 1244 -432 1242 -432 1244 -432 1244 -432 1246 -432 402 -432 406 -432 406 -434 402
    2A612420Unknown encoding: 2A612420 (50 bits)
    Raw (100): 402 -432 406 -430 406 -432 406 -432 406 -430 406 -432 404 -432 410 -432 1240 -432 1244 -432 1242 -432 1242 -434 1244 -432 1246 -432 1242 -434 1246 -432 402 -430 406 -432 406 -432 404 -432 406 -432 406 -432 406 -432 408 -432 1240 -434 1242 -432 1244 -432 1244 -430 1244 -434 1242 -432 1244 -432 1246 -432 1240 -432 1242 -432 406 -432 406 -432 406 -434 1244 -432 404 -434 408 -432 402 -432 404 -432 1244 -434 1242 -432 1242 -434 404 -432 1242 -432 1248 -432 1238 -432 406
    AB0D33BDUnknown encoding: AB0D33BD (17 bits)
    Raw (34): 434 -400 432 -404 434 -404 430 -406 432 -404 432 -406 430 -408 430 -408 432 -1242 430 -1244 430 -1246 430 -1244 432 -1244 430 -1246 430 -1246 408 -1270 456

    =======================

    Your encoding phase (for NEC TV maybe) output only one 32bit hex number for a key, correct? But mine output 4 numbers 48bits, 50bits, 50bits, and 17bits for the ON key. Which value should be used for that ON key (so confused)? I think the IRrecv library cannot encode/dump the Hitachi air conditioner infrared remote controller codes?

    0
    None
    3615JMD

    8 months ago

    Nice project because very easy to understand and easy to upgrade with extra functions. Thanks for sharing !

    May I suggest 2 improvements:

    1) if one replaces :

    uint32_t code = strtoul(server.arg(i).c_str(), NULL, 10);

    by this

    uint32_t code = strtoul(server.arg(i).c_str(), NULL, 16);

    The web page accepts HEX codes directly. No need to convert manually to decimal !

    2) I have improved the handler to be able to work with multiple IR formats. Nice when we want to control several devices from different brands: (more formats can be added with a switch/case)

    void handleIr() {

    for (uint8_t i = 0; i < server.args(); i++) {

    if (server.argName(i) == "rcmm") { // format pour la freebox

    uint32_t code = strtoul(server.arg(i).c_str(), NULL, 16);

    irsend.sendRCMM(code, 32);

    Serial.println(code);

    } else if (server.argName(i) == "rc6") { // format pour la TV phillips

    uint32_t code = strtoul(server.arg(i).c_str(), NULL, 16);

    irsend.sendRC6(code, 20);

    Serial.println(code);

    }

    }

    handleRoot();

    }

    The HTTP links must be modified accordingly of course :

    .... href=\"ir?rcmm=2400260C.......

    .... href=\"ir?rc6=0000C ....

    1 reply
    0
    None
    Abhrodeep Chanda3615JMD

    Reply 8 months ago

    Awesome! Thanks a lot I was searching for this. Your comment serves a vital part to improve this project. Again thanks a lot.