Arduino Home Automation: Control Your TV, Air Conditioner, Fan, etc. with an Infrared Transmitter

Поділитися
Вставка
  • Опубліковано 10 вер 2024
  • In this video I show an easy and low-cost way to do some home automation. I setup an Arduino with an infrared receiver and transmitter, then use it to control my television and a tower fan. This setup can be used to control pretty much anything that has an infrared remote, even air conditioners.
    I start by showing three different ways to wire up the circuit: breadboarding with a decoder and low-power LED, breadboarding with a decoder and high-power LED, and finally soldering together an Arduino shield for more permanent use.
    Then I show how to code the Arduino sketch and test it out. After ensuring things are working correctly, I show how to keep the Arduino from resetting when you connect to its serial port, and then cover how to make batch files that send infrared commands to the microcontroller.
    Finally I show how to use AutoHotKey to have your computer send those commands whenever you press a certain key on your keyboard.
    The source code for the Arduino sketch is available here:
    farrellf.com/ar...
    This is the infrared LED and receiver that I used in the first part:
    amzn.to/2lZ7pTy
    For a higher-power LED:
    amzn.to/2lZ6oLk
    I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for me to earn fees by linking to Amazon.com and affiliated sites.

КОМЕНТАРІ • 90

  • @solderingiron86
    @solderingiron86 2 роки тому +1

    I haven't watched it all yet, but this is exactly what I'm looking for! Thank you, thank you, thank you! 🤗

    • @upgrdman
      @upgrdman  2 роки тому

      Thanks for the kind feedback! Good luck with your projects. I still use this hardware almost every day :)

  • @EdgarFroes
    @EdgarFroes 5 років тому +2

    You are the Bob Ross of Arduino.

  • @dennismillican4164
    @dennismillican4164 6 років тому +1

    Great tutorial. Worked just right. One note, if using a Mega 2560 the LED should be connected to digital pin 9.

  • @Ali-io9lw
    @Ali-io9lw 4 роки тому +1

    Hey , your channel is amazing. This is the third video I've watched today. Gem quality material on UA-cam. Love your work.

    • @upgrdman
      @upgrdman  4 роки тому

      Thanks for the kind feedback.

  • @robdevenney
    @robdevenney 7 років тому +3

    Nice shorts.... excellent video and everything was very well explained which is much appreciated as most UA-cam tutorials leave out half of the steps.

  • @ammar.imrann
    @ammar.imrann 7 років тому +4

    Amazing presentation, wish you all success. it really helped me on my work. seriusly no one has done such a big tutorial on electronic over youtube. thank alot man!

  • @shinevisionsv
    @shinevisionsv 7 років тому

    One of the best tutorials on IR. Thanks A Lot!

  • @lazydave137
    @lazydave137 7 років тому +1

    Cool video!
    Btw, you don't need to buy the stuff from China or Ebay, you can pick up the IR diode, resistor and receiver in any local electronics store, and it's probably even cheaper!

  • @wilkes0007
    @wilkes0007 5 років тому +1

    Best video for arduino i hve ever seen or i will watch.

  • @azucar151
    @azucar151 7 років тому +4

    Outstanding tutorial ! .... thank you for taking the time and sharing ..... SUBSCRIBED !

  • @ASHOKKUMAR-hc8ye
    @ASHOKKUMAR-hc8ye 3 роки тому

    I am a new learner for Arduino projects this is an excellent explanation as I have been watching so many youtube videos for four months. Need a small help on a project if you can give, please.

  • @ruisku100
    @ruisku100 6 років тому +1

    Thanx man. Now I can do my home automation easy way !

  • @kyoko703
    @kyoko703 6 років тому +2

    VERY well done video. I just sat through the whole thing. DAMN. :D You've earned yourself a new sub.

  • @sukmaraharja7446
    @sukmaraharja7446 6 років тому +1

    this is well produced video, thanks man

  • @dparson
    @dparson 7 років тому +3

    Awesome project, thanks so much for sharing!

  • @nisstw
    @nisstw Рік тому

    添加一個任意數字在RAW碼前端,造成遙控成功與失敗的區別,原因在於RAW碼是IR LED點亮與熄滅的間隔時間序列。
    抓RAW檔的 library沒有刪除剛啟動LED的元素,造成點亮與熄滅的時機完全相反,所以,只要添加任一小數字在前方,即可修正。
    甚至,可以去掉第一個元素,很可能也能工作

  • @nikumamit
    @nikumamit 6 років тому +1

    Awesome job. Thanks for sharing your work. Appreciate it

  • @prakhartibrewal9886
    @prakhartibrewal9886 7 років тому +6

    Very well explained video.

  • @shorty606
    @shorty606 7 років тому

    You can get much better range with standard IR LEDs by connecting them straight to a 5v rail and using a transistor on the arduino control pin to control the pulses. I do it this way and don't have to aim the device at all.

    • @jeofjp
      @jeofjp 4 роки тому

      which transistor did you use?

  • @ajaysiswal7913
    @ajaysiswal7913 6 років тому +1

    i have 1 questions , where u define sender pin i.e in your video u marked pin 3 , but in coding i am unable to find that !!

  • @billweis4112
    @billweis4112 7 років тому +1

    Excellent presentation!!!!

  • @jonalama892
    @jonalama892 5 років тому

    Hello. I have applied the first scheme (with a normal IR-LED), but it is not working and the HEX number is longer than in the video. Could you please help me to fix it? Thanks

  • @birkhansonkan4236
    @birkhansonkan4236 7 років тому +1

    nice project, thanks

  • @JustMarioBros
    @JustMarioBros 7 років тому

    Need help please. I am building an arcade machine and would like to configure a few buttons to control the tv volume and on/off. I will be using an Ultimarc Ultimate I/O, having said that, how can I use the Arduino in my setup? Thanks

  • @francodiaz8439
    @francodiaz8439 4 роки тому

    I have the atmega2560 and I didnt see anything blinking with my camera so I don't know what is wrong it works normally but I connect this to the pin 3 and didnt work can someone help me please

  • @cuisjericho
    @cuisjericho 6 років тому

    Hi again! I have a question, do you used a hardware pwm built in of the arduino or you used a software modulation for pwm? Can i migrate your sketch to a wemos d1 mini pro using the arduino ide? Because the wemos board doesn't have a hardware to manage the pwm signal, only thought software management thanks !

  • @dsongwriter9784
    @dsongwriter9784 6 років тому

    I'm looking to program an arduino to send a signal to Nvidia Shield tv to also control a mouse cursor. Have you tried this or seen it done anywhere? I'm not finding any results in my searches. I would prog. to receive from a tivo remote, then transmit signal same as my wireless keyboard with touchpad. Wondering how the mouse control would work.. can you hold the button for continuous movement? Would the touchpad send need different programming?

  • @geniman1263
    @geniman1263 5 років тому +1

    thanks a lot sir , u explained it very well

  • @cuisjericho
    @cuisjericho 6 років тому

    Thanks so much, i already make a project like that but i can't use a high power ir led 3w. Do you give me a extra tips? I make all like you say and use a mosfet HF4N60 wich Vgs(th) is min 2v and max 4v. I use a external power source 5v 1.5A. But instead of a arduino i use a wemos d1 mini pro that output logical is 3.3 v instead 5v there can be the problem?? Can you recomend me another mosfet that can work with 3.3v?? Thanks so much!!!

  • @antoniogargiulo9491
    @antoniogargiulo9491 4 роки тому +1

    Good Job!

  • @largerification
    @largerification 7 років тому +2

    Man, I admire your skills!
    Found your channel because of the telemetry an I can't stop watching your videos/tutorials... Keep up the good work, you are my new UA-cam hero :)
    Some advises... can you make a future video on how to make this code run on esp8266-01 and have the commands sent wirelessly?
    Can an USB capable arduino be connected to a keyboard and have each button mapped to a certain script?.. or maybe store them on an SD card... those w5100 SD/Lan shields...
    Is there a way to embed a map (OpenStreetMap, or any other open source format) and have GPS coordinates visualized?

    • @upgrdman
      @upgrdman  7 років тому +2

      Thanks! I'm actually working on a short series of ESP8266 videos. I hope to have them done within a week or two. I plan to cover how to access a web page, how to host a web page, and how to use an ESP8266 to send telemetry wirelessly. That will be part of the next update for TelemetryViewer.
      As for USB, I have not tried anything like that, so I don't know.
      As for maps, I assume you want to do that with TelemetryViewer? I had not planned that, but it's a good idea. I'll look into it, but it may be a while before I have time to implement it.

    • @largerification
      @largerification 7 років тому

      Thank you for the heads up... hm... "heads up"... real time OBD car heads up.... just thinking.. :) :D
      Looking forward for the new videos.

  • @daksh1950
    @daksh1950 5 років тому

    Hey man been wondering if it was possible to give commands through Alexa, I'm new to this whole Microcontroller thingie and I've trying to set up some form of Home automation for my parents before I go to college, please advise

  • @jonalama892
    @jonalama892 5 років тому

    Hello. Im trying to control my SAMSUNG AC with my Android via MIT App Inventor 2. Im using Arduino Uno, Bluetooth HC-05 and an IR Transmitter TSOP1136. Could you please help me with a code to decode my ac remote buttons?

  • @jesterod
    @jesterod 4 роки тому

    Can i use a leonardo ver? Ive never played with Arduinos but i cant find anything to to send ir from my pc i ask because i was given a couple of mini leonardo style Arduino clones

    • @jesterod
      @jesterod 4 роки тому

      So i have this setup and it receives the codes( much longer than yours my tv has 67 long) and when i try to send it just locks up my board

  • @rz1359
    @rz1359 7 років тому +2

    Like it , thanks

  • @ivanjanka2910
    @ivanjanka2910 6 років тому

    Can i controll the devices via a wifi shield and a mobile device? If so please make a video about it or explain it in the comments. THANKS!

  • @Haithamr
    @Haithamr 7 років тому +1

    amazing
    keep it up!!!

  • @kahuna20001
    @kahuna20001 6 років тому

    I've been having a problem where after reboots, the arduino usually doesn't work until I remove and then reinsert the USB cable. Sometimes I have to do this a couple times after a reboot. Running the mode command doesn't resolve it and I've cut the reset land as indicated. In Win10 under Devices and Printers and Device Manager it will say it's working properly and assigned to COM4, but it doesn't respond until I reseat the USB cable. I've tried assigning different ports, like COM3 & COM7, etc in Device Mgr and can get it to work but I still have this problem after most reboots. Otherwise it's working great. Any ideas on this problem related to reboots?

    • @upgrdman
      @upgrdman  6 років тому

      Weird. I've never had that problem and I'm not sure what would cause it.

    • @kahuna20001
      @kahuna20001 6 років тому

      I finally figured out the cause of my problem. I had a script in the windows startup folder "AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" that was sending a command to the Arduino. I guess it didn't like the timing of it or something. Anyway, problem solved by getting rid of the script and approaching what I was trying to do differently.

  • @gujarisantamanyugmai
    @gujarisantamanyugmai 7 років тому

    WHAT IS THE MAXIMUM DISTANCE, IT CAN WORK?

  • @reyyash3465
    @reyyash3465 5 років тому

    SIR THIS IS working for an window ac but incase of split acs it is not
    can you help in this case

  • @tofetome
    @tofetome 6 років тому

    Very good video with explanations. I am able to receive and send the codes to my Sony Tv ( same as in video). But for my AC it is only receiving codes. I can not send them back to the AC. Could you please help with that?

    • @anwaral-gacemy212
      @anwaral-gacemy212 5 років тому

      please did you manege to solve the AC problem ,, please help me

  • @ashishpardhi8131
    @ashishpardhi8131 6 років тому

    how to control MY AC plz give me any link or code in detail

  • @IronSherlock
    @IronSherlock 7 років тому

    great tutorial, thanks.
    can you make one but using sms gateway please.
    thanks a lot.

  • @JoshKaufmanstuff
    @JoshKaufmanstuff 7 років тому

    Awesome Project!
    Where do I write the IR Data into the code to let the Arduino control things?
    I just want to let my arduino turn on a TV (when a condition is reached, or a button on the Arduino is pressed)
    I'm getting errors when I compile:
    exit status 1
    'IRsend' does not name a type
    PC_To_IR:33: error: 'sender' was not declared in this scope
    sender.sendRaw(durations, count, 40);
    Any clues?

    • @gamersteam2900
      @gamersteam2900 7 років тому

      hey please share your whole code as i getting alot of errors. i will be very thankfull to you

    • @EvilSapphireR
      @EvilSapphireR 5 років тому

      Did you include the irremote.h header file?

  • @Leothi
    @Leothi 6 років тому

    do you still answer comments? i have a question for you

  • @parvezhussain7180
    @parvezhussain7180 6 років тому

    Hello, If usb port is disabled for mass storage devices will Adrunio work when connected with usb power ? and why after some time Adrunio goes offline when powered with usb. how to keep Adrunio online 24/7 from usb.

    • @upgrdman
      @upgrdman  6 років тому

      The Arduino Uno is just a USB UART, it does not use the Mass Storage protocol (as far as I know.) Not sure why your Arduino goes offline, mine does not do that.

  • @naveenravichandran4084
    @naveenravichandran4084 7 років тому +1

    please provide source code ..thank u

  • @zbigniewloboda3393
    @zbigniewloboda3393 4 роки тому +1

    5:52
    ...you know, you know...
    Are you an engineer or ... man.

  • @benskikchannel9508
    @benskikchannel9508 3 роки тому

    how i disable reset button on arduino uno?

    • @benskikchannel9508
      @benskikchannel9508 3 роки тому

      its turn on the tv but doesnt turn off the tv, anyone know how?

  • @davidoenjoyo6671
    @davidoenjoyo6671 7 років тому

    this is awsome man.. but i use same methode that you're in to, to my midea Air Conditioner But it not work can you explain a litlle bit? i've already tried everything but it not work at all. can you help me?

    • @upgrdman
      @upgrdman  7 років тому

      If it's not working I would try two things: 1. Check if the IR LED is emitting anything. A camera can see the IR, just aim your camera at it and try to send the command. 2. If the IR LED is emitting, use an oscilloscope on the real remote control, and on your IR LED, and see how the waveforms differ.

    • @davidoenjoyo6671
      @davidoenjoyo6671 7 років тому

      i've try the same IR LED to my TV, it works but not on my Air Conditioner. I has 100 count in raw code. and doesn't word. my tv remote only 63 and it work. does it matter?

    • @davidoenjoyo6671
      @davidoenjoyo6671 7 років тому

      i use ordinary IR LED

    • @davidoenjoyo6671
      @davidoenjoyo6671 7 років тому

      yess the waveform is different. how to fix it bro?

    • @davidoenjoyo6671
      @davidoenjoyo6671 7 років тому

      i tought the algorithm for the program is to sent exacly the same raw code as the remote sent

  • @naveenravichandran4084
    @naveenravichandran4084 7 років тому

    source code ...i was downloaded ..but it is empty

    • @byt3w4rri0r
      @byt3w4rri0r 7 років тому

      Same here :( … but anyhow great tutorials! well made!

  • @MuhammadUmer-cs4dh
    @MuhammadUmer-cs4dh 6 років тому

    which Transistor i can use ?

    • @upgrdman
      @upgrdman  6 років тому +1

      Most n-channel MOSFETs that can handle a drain current of at least 1 Amp should be fine.

    • @MuhammadUmer-cs4dh
      @MuhammadUmer-cs4dh 6 років тому

      Thanks

  • @francodiaz8439
    @francodiaz8439 4 роки тому

    I don´t know why dont work :(

  • @MP3Martin
    @MP3Martin 5 років тому

    Wow

  • @prathamganapathy1734
    @prathamganapathy1734 7 років тому

    Is 120 ohm resistor ok or not?

  • @ASHOKKUMAR-hc8ye
    @ASHOKKUMAR-hc8ye 3 роки тому

    If I can contact you

  • @IronSherlock
    @IronSherlock 7 років тому

    btw, the source code is empty.
    re-upload it please.

  • @gamersteam2900
    @gamersteam2900 7 років тому +1

    hey your code is note working see the error below and fix this..
    Arduino: 1.8.3 (Windows Store 1.8.6.0) (Windows 10), Board: "Arduino/Genuino Uno"
    C:\Users\sood\Documents\Arduino\sketch_jul10a\sketch_jul10a.ino: In function 'void loop()':
    sketch_jul10a:24: error: invalid types 'unsigned int[int]' for array subscript
    durations[i] = Serial.parseInt();
    ^
    C:\Users\sood\Documents\Arduino\sketch_jul10a\sketch_jul10a.ino:27:42: warning: invalid conversion from 'unsigned int' to 'const unsigned int*' [-fpermissive]
    sender.sendRaw(durations, count, 40);
    ^
    In file included from C:\Users\sood\Documents\Arduino\sketch_jul10a\sketch_jul10a.ino:1:0:
    C:\Users\sood\Documents\Arduino\libraries\IRremote/IRremote.h:260:9: note: initializing argument 1 of 'void IRsend::sendRaw(const unsigned int*, unsigned int, unsigned int)'
    void sendRaw (const unsigned int buf[], unsigned int len, unsigned int hz) ;
    ^
    sketch_jul10a:35: error: expected unqualified-id before '=' token
    for (int = 1; i < results.rawlen; i++) {
    ^
    sketch_jul10a:35: error: expected ';' before '=' token
    sketch_jul10a:35: error: expected primary-expression before '=' token
    sketch_jul10a:35: error: 'i' was not declared in this scope
    for (int = 1; i < results.rawlen; i++) {
    ^
    sketch_jul10a:35: error: expected ')' before ';' token
    for (int = 1; i < results.rawlen; i++) {
    ^
    sketch_jul10a:35: error: 'i' was not declared in this scope
    for (int = 1; i < results.rawlen; i++) {
    ^
    Multiple libraries were found for "IRremote.h"
    Used: C:\Users\sood\Documents\Arduino\libraries\IRremote
    Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.6.0_x64__mdqgnx93n4wtt\libraries\RobotIRremote
    exit status 1
    invalid types 'unsigned int[int]' for array subscript
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    AND WHOLE CODE IS :----------
    #include
    IRrecv receiver(2);
    IRsend sender;
    decode_results results;
    long repetitions;
    long count;
    unsigned int durations(100);
    void (*reset)(void) = 0;
    void setup()
    {
    Serial.begin(9600);
    receiver.enableIRIn(); // Start the receiver
    }
    void loop() {
    if (Serial.available()) {
    repetitions = Serial.parseInt();
    count = Serial.parseInt();
    for (int i = 0; i < count; i++)
    durations[i] = Serial.parseInt();
    for (int i = 0; i < repetitions; i++) {
    sender.sendRaw(durations, count, 40);
    delay(50);
    }
    reset();
    }
    if(receiver.decode(&results)) {
    Serial.println(results.value, HEX);
    Serial.print(results.rawlen - 1);
    for (int = 1; i < results.rawlen; i++) {
    unsigned int number = results.rawbuf[i] * USECPERTICK;
    Serial.print(",");
    Serial.print(number);
    }
    Serial.print("");
    receiver.resume();
    }
    }
    FIX THIS FRIEND AND LET ME KNOW.
    THANKS