Recording and replaying Infrared signals from remote controls

Sdílet
Vložit
  • čas přidán 3. 08. 2024
  • #infrared #arduino #remote
    We will record raw infrared codes from a remote-control and replay it back with the Arduino firmware library IRLib2! This method is super useful for any kind of infrared protocol without the need to decode it as we are simply recording and replaying the signals.
    ⏰ TIMESTAMPS
    0:00 Intro
    1:48 Infrared receive raw codes hutscape.com/tutorials/ir-raw...
    5:20 Test infrared receive with remote control
    7:51 Infrared emit raw codes hutscape.com/tutorials/ir-raw...
    11:34 Test infrared emit with remote control
    ‣ Some links below are affiliate. I receive a small commission at no extra cost to you.
    📻 PRODUCTS MENTIONED
    Arduino UNO R3 amzn.to/3xbq53W
    🔗 LINKS SHOWN
    Arduino firmware IRLib2 github.com/cyborg5/IRLib2
    Adafruit tutorial on IRLib2 learn.adafruit.com/using-an-i...
    Based on AnalysIR github.com/cyborg5/IRLib2/blo...
    3 Function parameters for sending IR raw code github.com/cyborg5/IRLib2/blo...
    AnalysIR www.analysir.com/blog/
    AppleTV 4th Gen teardown www.ifixit.com/Teardown/Apple...
    🔌 TOOLS USED
    hutscape.com/tools
  • Věda a technologie

Komentáře • 94

  • @wallyharwood3532
    @wallyharwood3532 Před 3 lety

    Well prepared, excellent delivery . You are a super lecturer.

  • @HellGoodDoogz
    @HellGoodDoogz Před 3 lety +6

    What a fantastic video! Very informative and a pleasure to listen to! :D
    Thanks for taking the time!

  • @hycron1234
    @hycron1234 Před 2 lety

    Pretty useful being able to automate some of these appliances. I can already think of a few applications for this. Thanks! 🙂

  • @idlebot_deluxe
    @idlebot_deluxe Před 2 lety

    finally, what i was looking for, a video of the raw ir signals. thx

  • @ASHOKKUMAR-hc8ye
    @ASHOKKUMAR-hc8ye Před 3 lety +1

    I have been watching so many videos on youtube as I am a new learner trying to learn all about Arduino must say one of the best on IR Remote with good information. Thanks and keep it up

  • @sharmilaborah
    @sharmilaborah Před 4 lety +2

    I have been trying this from several hours , but finally found your video, you really explained everything so beautifully and I learned my mistake and now it is resolved
    THANK YOU ALOT....

  • @joseantoniomoramoreno261

    Congratulations! You are an excelent teacher!

  • @mikrohouse4064
    @mikrohouse4064 Před 3 lety

    great tutorial.very enlightening .keep up the good work

  • @MegaTechno
    @MegaTechno Před rokem

    I have been trying this from several days, You helped me .thanks

  • @BlueSayamanHey
    @BlueSayamanHey Před měsícem

    Thanks you it means a lot to me now i wanna try it with all my diveces

  • @santosharakere
    @santosharakere Před 3 lety

    Excellent demo, thank you.

  • @jacobmyers5204
    @jacobmyers5204 Před rokem

    Very informative, thank you!

  • @zaharianicolae9828
    @zaharianicolae9828 Před 4 lety +2

    Great job. It was the exact example i was looking for around on youtube, but never actually found one. Thank you

    • @tristanhouston7140
      @tristanhouston7140 Před 3 lety

      Pro tip: watch movies at flixzone. Me and my gf have been using them for watching a lot of movies during the lockdown.

    • @jerrybenjamin6168
      @jerrybenjamin6168 Před 3 lety

      @Tristan Houston definitely, I have been using Flixzone for since november myself :D

  • @itamartech
    @itamartech Před 2 lety +1

    Thank you!! great video!

  • @emregeylani
    @emregeylani Před 5 měsíci

    congratz, great project and presentation

  • @abobobo943
    @abobobo943 Před 3 lety

    Awsome. Very interesting.thank you for sharing.

  • @jacktorres5871
    @jacktorres5871 Před rokem

    great video, learned a lot :)

  • @drcanalli
    @drcanalli Před 3 lety

    Absolutely Kind.
    Thanks for the detailed explanation that will be very useful to my studies and knowledge.
    Att; Dino Canalli
    Curitiba
    Brasil

  • @andyandy4306
    @andyandy4306 Před rokem

    Lots of examples these days doing this…yours is well done. I wish someone would integrate the send portion of what you taught into SmartThings for example

  • @bevishal54
    @bevishal54 Před 4 lety +1

    Thanks so much
    🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @rakeshmourya6102
    @rakeshmourya6102 Před rokem

    It works for me. Thankyou

  • @userkhankhan6739
    @userkhankhan6739 Před 2 lety

    Very Nice Tutorial and Very informative can u tell which complier did u used and if we wan to generate the code by pressing button then what will be line that I need to add into your code..?

  • @sonnyilham309
    @sonnyilham309 Před 4 lety +6

    can we just use pin 3 with PWM without transistor?

  • @user-oj4tn4vw3v
    @user-oj4tn4vw3v Před 2 lety

    Thank you !! can you explain same method for raspberry I been straggling to much thank you again

  • @kasunjayakodi8146
    @kasunjayakodi8146 Před rokem

    Hi …. I am glad if u Could make a video about 433hz door bell prank tutorial specially code explanation !!

  • @andreisales8245
    @andreisales8245 Před 3 měsíci

    I made this project and it works only if the Arduino is plugged in my PC , but the thing is whenever I use an external power supply it doesn't do anything.

  • @Sj-yf2jg
    @Sj-yf2jg Před 9 měsíci

    What software are you using on laptop to decode? and how to install the code into UNO?

  • @francodiaz8439
    @francodiaz8439 Před 4 lety

    how I can download the library im new at this but thanks a lot for share

  • @zullakai9274
    @zullakai9274 Před rokem

    Good video. I can understand and follow every step in your video. And it's work. My television, light and radio. All of them can be controlled. But my ceiling fan doesn't seem to work. How can I fix this. Do I need to decode or something? And one more can I use esp8266 for this project?

    • @sayanee
      @sayanee  Před rokem

      I have never used ESP8266, but try this library: github.com/crankyoldgit/IRremoteESP8266
      Is the ceiling fan using IR as well? Mine is using RF, so that might be the reason.

  • @ek19751
    @ek19751 Před 2 lety

    I want to write a macro for a TV so it can execute a series of commands from an Android phone. Do I just put a delay after each command or is there more to it? I couldn't find an example. Would you be able to point me in the right direction, please?

  • @Pola.Botros
    @Pola.Botros Před rokem

    Hi it is worked with me for carrier AC but with GREE AC it is not
    can you help

  • @markchristophergemzon1052

    Hi, I tried doing this on an arduino mega. Receiveng the IR signals was no problem but when I was trying to send the recorded IR signals, there was no output coming from the PIN 3 of the arduino mega. Any reason why it is not sending? Thank you.

  • @ArunG273
    @ArunG273 Před 2 lety

    Can I use any ir receiver or should I use only tsop4838?

  • @irfansensoy5901
    @irfansensoy5901 Před 7 měsíci

    Hello.
    I want to copy the remote control of a GREE air conditioner, but the data I obtain with the receiver code is always different. For example; The two shutdown codes in the (close-on-close) command I receive from the remote control are different. Is it possible that the code is encrypted? How can I go about it? Thanks.

  • @CodeMonkey66
    @CodeMonkey66 Před rokem

    Hey Sayanee, great video, I really like that you're using an updated IRRemote library. I'm curious, with one of the controllers, you were only able to get the on/off and volume button IR data but couldn't get the IR data from some of the other buttons. Do you know what that is? I've tried a difference library and every TV controller in my house works, except for one where I have the same problem...on/off button, mute, volume buttons work like the other controllers, but the other buttons don't work.
    Perhaps you or someone else here has solved this issue?

    • @sayanee
      @sayanee  Před rokem

      Uh! I think it was the Apple TV remote. The rest of the button in this case was simply Bluetooth I believe that was communicating with the Apple TV. Only the volume up and down was IR.
      Different remotes, different technologies, I guess!

  • @sachinsasi1459
    @sachinsasi1459 Před rokem

    How to buy that transmitter and receiver plz provide their name an link

  • @androidemulation5952
    @androidemulation5952 Před 3 lety

    Great video, thank you so much. I have a small question though. instead of saving the obtained data in a file, is it possible to store it on the EEPROM in realtime? I want to store and send the signal without using my PC but also not lose my data if the power is cut.

    • @sayanee
      @sayanee  Před 3 lety +1

      Absolutely! In fact, storing the data in the EEFROM / flash is my next goal.
      I did not show this in my video because I didn't want to complicate the code and the example with EEPROM/storage stuff.

    • @androidemulation5952
      @androidemulation5952 Před 3 lety

      @@sayanee I see, thanks a lot. this will help me greatly in my project. best of luck with yours

  • @marin6341
    @marin6341 Před rokem

    Hey I want to try it ! Is it work in 2022 ?

  • @i_am_gaming_gamer_game

    What could be the reason for the code not working even though i set up the correct pin, i get the light on the receiver when i send a ir signal but when i try the code it just doesnt detect anything? receiver is ky-022

  • @Lisas4us
    @Lisas4us Před rokem

    Hi Sayanee, thanks very much for the movie, that was actually exactly what I was looking for. Now I can connect some sensors and adjust the ac accordingly, I am thinking. Anyway, I am wondering, you said output pin for the Led is Pin3. How do you know this, also in your script is no output Pin defined. Could you please enlighten me.

    • @sayanee
      @sayanee  Před rokem

      It's been almost 4 years since this video 😅 So many the implementation based on the original library has changed.
      Please check the original library's latest similar example: github.com/cyborg5/IRLib2/blob/master/IRLib2/examples/rawSend/rawSend.ino
      I am guessing as long as you chose another analog pin marked with a tilde (~) that should be fine.

  • @juanriofrio6872
    @juanriofrio6872 Před rokem

    Hello,... Just wanted to let you know that I really enjoy watching your video, very clear to understand. I was looking to download the code used in your video but is not available... I'm not experienced in programming mcu's, I am actually just a hobbits, so to see the code and learn from it is helpful. Anyway, just wanted to say hello and thank you for your videos.... Just a thought if I may, I few weeks ago I come to know the development of the RISC-V mcu's and I was intrigued about it's power and so affordable that is, but no idea how to start getting to know it. Will be great to see a video about them and to know tools and support it has in order to get some knowledge in how to use them.... Have a wonderful day 😊

    • @sayanee
      @sayanee  Před rokem

      Do these links help? I have listed them in the video description. They have the code to download:
      hutscape.com/tutorials/ir-raw-receive
      hutscape.com/tutorials/ir-raw-emit
      It's been almost 4 years since this video 😅 So I am not sure if the code and the prerequisite library will work again today.

    • @juanriofrio6872
      @juanriofrio6872 Před rokem

      @@sayanee Hello, thank you for the links... You're probably correct about the code. My findings has been that the code available with the videos hasn't worked for me, different reasons, I assume libraries, parts, some peace of info missing or misunderstood. So, now just I take them as example in how or a way a specific project could be done.... Thank you again for your reply ☺️

  • @pradipselectrolab2994
    @pradipselectrolab2994 Před 2 lety

    I have been trying for a tutorial on IRRemote and found this video. Well explained. But I want to use this library with Atmel Studio 7 for project on ATmega32. I have knowledge in C but a little knowledge in C++ and moreover I am a beginner in microcontroller programming. Can you please suggest how I can use this or like one library in Atmel Studio?

    • @sayanee
      @sayanee  Před 2 lety

      I'm so sorry, I have never used Atmel Studio. But thankfully, I do see many tutorials on CZcams.
      One is by Microchip themselves: czcams.com/users/results?search_query=atmel+studio+7+tutorial. Hope this can help you!

    • @pradipselectrolab2994
      @pradipselectrolab2994 Před 2 lety

      @@sayanee Yes, there are many topics, but these does not clear the things. Any how, I myself will do the needful.
      Thanks any way.

  • @fatih.cal1734
    @fatih.cal1734 Před 3 lety

    I get "mySender was not declared in this scope" error

  • @tatavenugopal3082
    @tatavenugopal3082 Před 3 lety

    Good explanation Madam ... Thank you
    I have small remote, it works for one celling fan & two lights, I want to incorporate this remote frequency into having IR option mobile ... can you guide me plz ... Thanks in advance

    • @sayanee
      @sayanee  Před 3 lety

      If you mean Android, IR option mobile, sorry I have never done before.
      I also suspect it will depend on the model of your mobile because it will need to have the IR receiver/transmitter.
      I just Googled and found this link: www.androidauthority.com/phones-with-ir-blaster-858845/.
      Hope this helps!

  • @idabagusmadedhimasprayogab2137

    Hai Sayanee, what a great video !, but i have one problem about the "./data.h" that telling me no such file or directory, do you have any idea what i have to do ?

    • @Lisas4us
      @Lisas4us Před rokem +1

      I had the same problem, do not use < > but use " " for the define.
      It seems Sayanee is not answering anymore.

    • @idabagusmadedhimasprayogab2137
      @idabagusmadedhimasprayogab2137 Před rokem

      @@Lisas4us ahh i see, thank you for your information, have a great day !

  • @antoniomoraes7655
    @antoniomoraes7655 Před 3 lety

    Hello Sayanee,
    Why you save for the last array element always a fixed value 1000 instead of doing the same and getting the last and actual value inside the loop (i== recvGlobal.recvLength)?
    Thank you

    • @sayanee
      @sayanee  Před 3 lety +1

      Hi Antonio, 1000 means a trailing space that indicates we have received the complete data. It is defined in the IR library I used.
      The code I implemented is directly from the example of the IR Library "IRLib2" I used which also has the last fixed value as 1000: github.com/cyborg5/IRLib2/blob/master/IRLib2/examples/rawRecv/rawRecv.ino#L32
      This code inherits #include and if we read the "/IRLibRecvPCI.cpp" implementation file, the comment explains that "If it notices a SPACE is especially long then it calls IRLib_IRrecvComplete which sets the proper flags to say that we had received data and implements auto resume if enabled." Here's the complete link to the comment: github.com/cyborg5/IRLib2/blob/master/IRLibRecvPCI/IRLibRecvPCI.cpp#L97-L100
      I hope that explains what you want to know about the fixed value of 1000.

    • @antoniomoraes7655
      @antoniomoraes7655 Před 3 lety

      @@sayanee thank you

  • @tjsaarni
    @tjsaarni Před 4 lety

    Thanks for the video (and all the previous ones)! My project was for a set-top box that sits behind cabinet door that blocked the IR signal github.com/tsaarni/ir-remote-control-repeater. I found out that it is possible to make pure repeater without decoding the signal. I'm sure running this on microcontroller was overkill but that's besides the point of this kind of projects ;-)

    • @sayanee
      @sayanee  Před 4 lety +1

      Wow! I didn't know using a repeater is another way to replay the IR signals. Thanks for sharing your project link so that I can dig in later 😃

  • @DimitriPappas
    @DimitriPappas Před 3 lety

    howcome we don't need to know/define the carrier frequency (38 in this case) when recording ? also is there any way to determine what the carrier frequency is for a particular remote if it is not 38 (not known)?

    • @sayanee
      @sayanee  Před 3 lety

      We probably need to look deep into the dependency code (github.com/cyborg5/IRLib2) to know the carrier frequency used.
      I was not able to do an in-depth analysis, but a quick search shows that the default is 38kHz (github.com/cyborg5/IRLib2/blob/master/IRLibProtocols/IRLib_HashRaw.h#L37).
      I'm not sure how else to measure the carrier frequency of the remote control by measurement. The harder way will be to locate the component manufacturer part number and find the datasheet, I guess.

  • @ToanNguyen-mo5qr
    @ToanNguyen-mo5qr Před rokem

    Help me
    i don't want to use pin 3 to connect to ir led, where can i change it in the library

    • @sayanee
      @sayanee  Před rokem

      It's been almost 4 years since this video 😅 So many the implementation based on the original library has changed.
      Please check the original library's latest similar example: github.com/cyborg5/IRLib2/blob/master/IRLib2/examples/rawSend/rawSend.ino
      I am guessing as long as you chose another analog pin marked with a tilde (~) that should be fine. And you don't need to define it in the code.

  • @gaurav3746
    @gaurav3746 Před 3 lety

    How can we compile it for a microcontroller like wimos d1 mini?

    • @sayanee
      @sayanee  Před 3 lety +1

      Sorry, I have not used it on WeMos D1 Mini yet.
      But, my version-2 plan is to indeed build it for a wifi-based MCU, ESP32!

  • @ZoomtronicBlogspot
    @ZoomtronicBlogspot Před 2 lety +1

    nope, not working on both of my air conditioners, tried similar code few years ago also no results

  • @drcanalli
    @drcanalli Před 3 lety

    Hello Sayanee.
    Once again congratulations on your explanations.
    I did the assembly and all the tests.
    But I am facing a problem. The pulse train recording is smaller than the original pulse train.
    My interest is in replicating the commands of a Hitachi Air Conditioner Remote Control, and the pulse train duration is around 230ms in total.
    I will greatly appreciate your opinion on this case.
    Thank you.
    Dino Canalli

    • @sayanee
      @sayanee  Před 3 lety

      Where and how did you measure the 230ms? And how did you figure out that the pulse train recording is smaller than the original pulse train?

    • @drcanalli
      @drcanalli Před 3 lety

      @@sayanee Hi Sayanee.
      I recorded a video with details of the experience.
      I am happy with your help and attention.
      Att;
      Dino Canalli.
      czcams.com/video/VVEYTrCDuHE/video.html
      PS: I am probably facing the same problem described on the AnalysIR page.
      www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/

    • @sayanee
      @sayanee  Před 3 lety

      Thanks for sharing Dino Canalli!
      As I suspected, you did use more tools and instruments such as the oscilloscope and the AnalysIR. That's great. I saw your video very briefly. Please give me some time to look through it again.

    • @sayanee
      @sayanee  Před 3 lety

      @@drcanalli Hi Dino, I'm really sorry that I took so long to reply.
      Thanks for doing the video, but it will be still very difficult to debug remotely. Regardless of what the array of code was captured and the oscilloscope waveform duration, were you able to emit the IR signals captured with the circuit and control the aircon? You seem to have 2 variants of the receiver TSOP, did one of them work?
      I am not sure if you tried to emit back the recorded signals (array of numbers captured) to the aircon successfully. Maybe give that a try with your Arduino UNO circuit? hutscape.com/tutorials/ir-raw-emit
      Also, I think it is completely fine for the captured signal to be different from the emitted signal due to sampling and other ways the signals get truncated. But if the aircon cannot be controlled, then maybe we need to look at it in another way.

    • @drcanalli
      @drcanalli Před 3 lety

      @@sayanee God bless you Sayanee! The problem was solved and the device i create is in use today. Your help was very important! good new year!

  • @Melvinsch
    @Melvinsch Před rokem

    does anyone has a video of this same project but without using arduino?

  • @anokhautomation4453
    @anokhautomation4453 Před 2 lety

    You can use it remote hex code instead of a raw code.

  • @mohammedalhinai5699
    @mohammedalhinai5699 Před 3 lety

    Can we also decode the car key remote ?

  • @usmanabdullah5321
    @usmanabdullah5321 Před 4 lety

    Why it only start receiving when you press volume up and down button

    • @toysareforboys1
      @toysareforboys1 Před 3 lety +1

      Volume up and down go out over I.R. (to control volume in your TV for example), all the buttons that control the apple device run over bluetooth.

  • @tarekas522
    @tarekas522 Před rokem

    I can't find a library (data.h ) Where do I download it from?

    • @sayanee
      @sayanee  Před rokem +1

      5:20 You have to make your own data.h with the raw codes you receive with your remote control with this Arduino program hutscape.com/tutorials/ir-raw-receive
      7:51 You can copy and paste the raw codes received into your own data.h file hutscape.com/tutorials/ir-raw-emit
      Hope this helps.

  • @AlaaDuino
    @AlaaDuino Před 4 lety +2

    NICE JOOB

  • @MPElectronique
    @MPElectronique Před 2 lety

    The code is always different. What should i do ?

    • @sayanee
      @sayanee  Před 2 lety

      Yes, it will be slightly different. I think that's because of slight variations when converting analog IR signals into digital.
      So, just copy the one that works and use it. It should work.

  • @antoniomoraes7655
    @antoniomoraes7655 Před 3 lety

    I still haven't understood how is possible capturing the signal as a serial at 9600 bps while the carrier is 38KHz. If someone could bring some light in it I really would appreciate.

    • @sayanee
      @sayanee  Před 3 lety

      We are actually capturing the IR signal received as and when it comes and immediately as it is received as shown in this line of code with the function "myReceiver.getResults()". If you see the loop() it has only one if-case. So the capturing of the signal happens immediately. github.com/hutscape/hutscape.github.io/blob/master/_tutorials/ir-raw-receive/ir-raw-receive.ino#L14
      We are printing the raw data, each buffer by buffer at 9600 baud rate and that is done after the signal is captured. github.com/hutscape/hutscape.github.io/blob/master/_tutorials/ir-raw-receive/ir-raw-receive.ino#L23
      I hope I understood your question correctly.

    • @antoniomoraes7655
      @antoniomoraes7655 Před 3 lety

      @@sayanee Thank you. I watched again your video and got it - is there. The receiver TSOP4838 also performs demodulation, etc, and for 38KHz signals. Means that, during capturing Arduino is indeed receiving from TSOP4838 a clean envelop of the modulated signal just the bits at 9600 bps, as it is before being modulated at 38KHz and cleaned from any other lighting environment noise. For more pdf1.alldatasheet.com/datasheet-pdf/view/252287/VISHAY/TSOP4838.html

  • @tarekas522
    @tarekas522 Před rokem

    You didn't sit pin 3