Recording and replaying Infrared signals from remote controls

Поделиться
HTML-код
  • Опубликовано: 22 июл 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
  • НаукаНаука

Комментарии • 94

  • @HellGoodDoogz
    @HellGoodDoogz 3 года назад +6

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

  • @sharmilaborah
    @sharmilaborah 4 года назад +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....

  • @ASHOKKUMAR-hc8ye
    @ASHOKKUMAR-hc8ye 3 года назад +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

  • @hycron1234
    @hycron1234 2 года назад

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

  • @wallyharwood3532
    @wallyharwood3532 3 года назад

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

  • @zaharianicolae9828
    @zaharianicolae9828 4 года назад +2

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

    • @tristanhouston7140
      @tristanhouston7140 3 года назад

      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 3 года назад

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

  • @idlebot_deluxe
    @idlebot_deluxe 2 года назад

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

  • @MegaTechno
    @MegaTechno Год назад

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

  • @mikrohouse4064
    @mikrohouse4064 3 года назад

    great tutorial.very enlightening .keep up the good work

  • @joseantoniomoramoreno261
    @joseantoniomoramoreno261 2 года назад

    Congratulations! You are an excelent teacher!

  • @santosharakere
    @santosharakere 3 года назад

    Excellent demo, thank you.

  • @jacobmyers5204
    @jacobmyers5204 Год назад

    Very informative, thank you!

  • @itamartech
    @itamartech 2 года назад +1

    Thank you!! great video!

  • @emregeylani
    @emregeylani 5 месяцев назад

    congratz, great project and presentation

  • @abobobo943
    @abobobo943 3 года назад

    Awsome. Very interesting.thank you for sharing.

  • @andyandy4306
    @andyandy4306 Год назад

    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

  • @BlueSayamanHey
    @BlueSayamanHey Месяц назад

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

  • @jacktorres5871
    @jacktorres5871 Год назад

    great video, learned a lot :)

  • @drcanalli
    @drcanalli 3 года назад

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

  • @rakeshmourya6102
    @rakeshmourya6102 11 месяцев назад

    It works for me. Thankyou

  • @bevishal54
    @bevishal54 4 года назад +1

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

  • @userkhankhan6739
    @userkhankhan6739 2 года назад

    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..?

  • @user-oj4tn4vw3v
    @user-oj4tn4vw3v 2 года назад

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

  • @sonnyilham309
    @sonnyilham309 4 года назад +6

    can we just use pin 3 with PWM without transistor?

  • @markchristophergemzon1052
    @markchristophergemzon1052 3 года назад

    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.

  • @Pola.Botros
    @Pola.Botros 11 месяцев назад

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

  • @ek19751
    @ek19751 2 года назад

    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?

  • @irfansensoy5901
    @irfansensoy5901 6 месяцев назад

    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.

  • @sachinsasi1459
    @sachinsasi1459 Год назад

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

  • @francodiaz8439
    @francodiaz8439 4 года назад

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

  • @Sj-yf2jg
    @Sj-yf2jg 8 месяцев назад

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

  • @ArunG273
    @ArunG273 2 года назад

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

  • @fatih.cal1734
    @fatih.cal1734 3 года назад

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

  • @zullakai9274
    @zullakai9274 Год назад

    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  Год назад

      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.

  • @i_am_gaming_gamer_game
    @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

  • @marin6341
    @marin6341 Год назад

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

  • @Lisas4us
    @Lisas4us Год назад

    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  Год назад

      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.

  • @DimitriPappas
    @DimitriPappas 3 года назад

    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  3 года назад

      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.

  • @antoniomoraes7655
    @antoniomoraes7655 3 года назад

    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  3 года назад +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 3 года назад

      @@sayanee thank you

  • @CodeMonkey66
    @CodeMonkey66 Год назад

    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  Год назад

      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!

  • @pradipselectrolab2994
    @pradipselectrolab2994 2 года назад

    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  2 года назад

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

    • @pradipselectrolab2994
      @pradipselectrolab2994 2 года назад

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

  • @androidemulation5952
    @androidemulation5952 3 года назад

    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  3 года назад +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 3 года назад

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

  • @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 Год назад +1

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

    • @idabagusmadedhimasprayogab2137
      @idabagusmadedhimasprayogab2137 Год назад

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

  • @kasunjayakodi8146
    @kasunjayakodi8146 Год назад

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

  • @ToanNguyen-mo5qr
    @ToanNguyen-mo5qr Год назад

    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  Год назад

      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 3 года назад

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

    • @sayanee
      @sayanee  3 года назад +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!

  • @andreisales8245
    @andreisales8245 2 месяца назад

    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.

  • @Melvinsch
    @Melvinsch Год назад

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

  • @tarekas522
    @tarekas522 Год назад

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

    • @sayanee
      @sayanee  Год назад +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.

  • @tatavenugopal3082
    @tatavenugopal3082 3 года назад

    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  3 года назад

      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!

  • @usmanabdullah5321
    @usmanabdullah5321 4 года назад

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

    • @toysareforboys1
      @toysareforboys1 3 года назад +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.

  • @ZoomtronicBlogspot
    @ZoomtronicBlogspot 2 года назад +1

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

  • @mohammedalhinai5699
    @mohammedalhinai5699 3 года назад

    Can we also decode the car key remote ?

  • @drcanalli
    @drcanalli 3 года назад

    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  3 года назад

      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 3 года назад

      @@sayanee Hi Sayanee.
      I recorded a video with details of the experience.
      I am happy with your help and attention.
      Att;
      Dino Canalli.
      ruclips.net/video/VVEYTrCDuHE/видео.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  3 года назад

      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  3 года назад

      @@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 3 года назад

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

  • @juanriofrio6872
    @juanriofrio6872 Год назад

    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  Год назад

      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 Год назад

      @@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 ☺️

  • @MPElectronique
    @MPElectronique 2 года назад

    The code is always different. What should i do ?

    • @sayanee
      @sayanee  2 года назад

      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.

  • @tjsaarni
    @tjsaarni 4 года назад

    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  4 года назад +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 😃

  • @antoniomoraes7655
    @antoniomoraes7655 3 года назад

    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  3 года назад

      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 3 года назад

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

  • @anokhautomation4453
    @anokhautomation4453 2 года назад

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

  • @AlaaDuino
    @AlaaDuino 4 года назад +2

    NICE JOOB

  • @tarekas522
    @tarekas522 Год назад

    You didn't sit pin 3