Universal Remote Using ESP8266(Wifi Controlled)

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

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!!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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!!!

Lazy Life Challenge

Participated in the
Lazy Life Challenge

GIFs Challenge 2017

Participated in the
GIFs Challenge 2017

2 People Made This Project!

Recommendations

  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

52 Discussions

None
demorgansucks

Question 3 days ago on Introduction

Hi! The decoding was working a couple months, but then it stopped working recently... Does anyone else have the same issue?

None
my310toyuma

6 weeks ago on Step 6

IRRemoteESP8266 Version 2 library works even better and gives detailed decoding information...! Use IRrcvdumpV2 from the IRremoteesp8266 example library in Arduino IDE

None
bitcoinsharjah

Question 2 months ago

My Air condition remote is transmitting long data and different codes every time I press OnnOff button.Any Clue how to solve this.

1 answer
None
queserasera701bitcoinsharjah

Answer 6 weeks ago

hi do u resolve this issue?? im working with the project now, can u help me out please?

None
MrReivax2

Question 6 weeks ago on Step 1

translated with google translator

Hi
because use the bc547 and not the bc337 ??
because sending the IR signal that bounces with some wall varies the coding
work with esp32 ?

None
queserasera701

7 weeks ago

hi sir, i came across your project , i already decode and encode. I had some problem related to controlling part, when i click send , the controlling won't work at all. Im using transistor bc547 , and IR led and already did follow your connection showed. Is there any limited distance between the IR and AC unit??? supposedly if i click send in web browser, it should be function isn't? I really need your help for this development. Thank you in advance sir

2 replies

for Bc547 the current rating is much less so the IR led glows with less intensity so keep the IR led curcuit close to appliance. To cross check whether your circuit is working or not use a camera mobile to see the IR led glow when you are pressing the send button. to get more distance use 2N222 transistor accordingly

hi sir, may i ask again? the circuit is working now , but why every time i decode on and off button it will give me different hex code? increasing button also does not giving me fix hex. when i click send through the browser of an on button, the transmitter is transmit(it does blink) , but the ac unit does not respond. when i try to decode again for on button, it give different value of hex. do u have any idea? im almost at the end of the project. thank you in advance sir

None
dheeraj_c

5 months ago

Somebody plz guide me.

None
VishalA24

5 months ago

Hello sir
You have said that you r not using any resistance between d2 and base pin of bc547. Will it not burn up ir led?
Secondly I have made the circuit but the problem is that the range is very less i.e. thw led should be exactly in direction of the reciever or it wont work, so how to increase the signal strength, may be by using 2n222 , if yes than what resistance to be used between base pin and d2

Please help
Regards
Vishal Ahuja

None
dheeraj_c

5 months ago

Great work sir. Really awesome. Please clear my doubt. We have designed transmitter and receiver using esp8266. So if i have a remote with transmitter and i am on 1st or second floor of my home and set top box is installed on the ground floor. So as per my understanding we will attach receiver using esp8266 to set top box. Now we will have to make transmitter section as a server which is on say 2nd floor which will send hex codes of buttons pressed over the internet to receiver section attached to the set top box. Now we will have to upload the send server command sketch to the transmitter section and receive server command sketch in the receiver section which will make it as a client. Am I right. Please guide me on this.

None
bitcoinsharjah

6 months ago

when I select nodemcu board and compile I get error
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
only working if i select Arduino board why

2 replies
None
Abhrodeep Chandabitcoinsharjah

Reply 5 months ago

please check the baudrate if it matches your module or if you are using esp32 that is something else. please check and do let me know

None
n4mwd

Question 8 months ago

Will this work with the ESP-01S? How much RAM and Flash does it need? The ESP-01S has 1MB Flash.

None
Abhrodeep ChandaDechathonW

Answer 8 months ago

Can you please ashow me the whole code? By seeing this I can tell the error message is correct as 'kRawTick' hasnt been initialized in the loop or as a global variable

None
Abhrodeep ChandaDechathonW

Reply 8 months ago

first thing is both the errors are same as only the variable names got changed, I want you to check if the IRrecv library i.e. folder is present in both your sketch folder and library folder if so delete it from sketch folder(normally documents/arduino) as it may cause duplication problem. Second thing if you have upgraded esp8266 board from board manager then downgrade it to 2.4.1 version. Let me know after this