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

  Рет қаралды 72,535

upgrdman

upgrdman

Күн бұрын

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 жыл бұрын
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 :)
@robdevenney
@robdevenney 7 жыл бұрын
Nice shorts.... excellent video and everything was very well explained which is much appreciated as most KZbin tutorials leave out half of the steps.
@Ali-io9lw
@Ali-io9lw 4 жыл бұрын
Hey , your channel is amazing. This is the third video I've watched today. Gem quality material on KZbin. Love your work.
@upgrdman
@upgrdman 4 жыл бұрын
Thanks for the kind feedback.
@EdgarFroes
@EdgarFroes 5 жыл бұрын
You are the Bob Ross of Arduino.
@ammar.imrann
@ammar.imrann 7 жыл бұрын
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!
@dennismillican4164
@dennismillican4164 6 жыл бұрын
Great tutorial. Worked just right. One note, if using a Mega 2560 the LED should be connected to digital pin 9.
@rsandkumar
@rsandkumar 6 жыл бұрын
Thank You.
@ToanNguyen-mo5qr
@ToanNguyen-mo5qr Жыл бұрын
thank you
@ToanNguyen-mo5qr
@ToanNguyen-mo5qr Жыл бұрын
i can change pin 9 to another pin, how to change in code. Please
@lazydave137
@lazydave137 7 жыл бұрын
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!
@shinevisionsv
@shinevisionsv 7 жыл бұрын
One of the best tutorials on IR. Thanks A Lot!
@kyoko703
@kyoko703 6 жыл бұрын
VERY well done video. I just sat through the whole thing. DAMN. :D You've earned yourself a new sub.
@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.
@azucar151
@azucar151 7 жыл бұрын
Outstanding tutorial ! .... thank you for taking the time and sharing ..... SUBSCRIBED !
@largerification
@largerification 7 жыл бұрын
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 KZbin 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 жыл бұрын
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.
@ruisku100
@ruisku100 6 жыл бұрын
Thanx man. Now I can do my home automation easy way !
@wilkes0007
@wilkes0007 5 жыл бұрын
Best video for arduino i hve ever seen or i will watch.
@sukmaraharja7446
@sukmaraharja7446 6 жыл бұрын
this is well produced video, thanks man
@dparson
@dparson 7 жыл бұрын
Awesome project, thanks so much for sharing!
@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?
@nisstw
@nisstw Жыл бұрын
添加一個任意數字在RAW碼前端,造成遙控成功與失敗的區別,原因在於RAW碼是IR LED點亮與熄滅的間隔時間序列。 抓RAW檔的 library沒有刪除剛啟動LED的元素,造成點亮與熄滅的時機完全相反,所以,只要添加任一小數字在前方,即可修正。 甚至,可以去掉第一個元素,很可能也能工作
@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 !
@nikumamit
@nikumamit 6 жыл бұрын
Awesome job. Thanks for sharing your work. Appreciate it
@ajaysiswal7913
@ajaysiswal7913 6 жыл бұрын
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 !!
@prakhartibrewal9886
@prakhartibrewal9886 7 жыл бұрын
Very well explained video.
@billweis4112
@billweis4112 7 жыл бұрын
Excellent presentation!!!!
@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
@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
@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!
@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
@antoniogargiulo9491
@antoniogargiulo9491 4 жыл бұрын
Good Job!
@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!!!
@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?
@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 жыл бұрын
nice project, thanks
@IronSherlock
@IronSherlock 7 жыл бұрын
great tutorial, thanks. can you make one but using sms gateway please. thanks a lot.
@gujarisantamanyugmai
@gujarisantamanyugmai 7 жыл бұрын
WHAT IS THE MAXIMUM DISTANCE, IT CAN WORK?
@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?
@geniman1263
@geniman1263 5 жыл бұрын
thanks a lot sir , u explained it very well
@Leothi
@Leothi 6 жыл бұрын
do you still answer comments? i have a question for you
@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
@Haithamr
@Haithamr 7 жыл бұрын
amazing keep it up!!!
@upgrdman
@upgrdman 7 жыл бұрын
Thanks
@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 жыл бұрын
Like it , thanks
@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.
@zbigniewloboda3393
@zbigniewloboda3393 4 жыл бұрын
5:52 ...you know, you know... Are you an engineer or ... man.
@ashishpardhi8131
@ashishpardhi8131 6 жыл бұрын
how to control MY AC plz give me any link or code in detail
@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?
@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
@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
@milhampratama6126
@milhampratama6126 5 жыл бұрын
is it still not working?
@naveenravichandran4084
@naveenravichandran4084 7 жыл бұрын
please provide source code ..thank u
@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.
@MuhammadUmer-cs4dh
@MuhammadUmer-cs4dh 6 жыл бұрын
which Transistor i can use ?
@upgrdman
@upgrdman 6 жыл бұрын
Most n-channel MOSFETs that can handle a drain current of at least 1 Amp should be fine.
@MuhammadUmer-cs4dh
@MuhammadUmer-cs4dh 6 жыл бұрын
Thanks
@MP3Martin
@MP3Martin 5 жыл бұрын
Wow
@prathamganapathy1734
@prathamganapathy1734 7 жыл бұрын
Is 120 ohm resistor ok or not?
@benskikchannel9508
@benskikchannel9508 4 жыл бұрын
how i disable reset button on arduino uno?
@benskikchannel9508
@benskikchannel9508 4 жыл бұрын
its turn on the tv but doesnt turn off the tv, anyone know how?
@naveenravichandran4084
@naveenravichandran4084 7 жыл бұрын
source code ...i was downloaded ..but it is empty
@byt3w4rri0r
@byt3w4rri0r 7 жыл бұрын
Same here :( … but anyhow great tutorials! well made!
@ASHOKKUMAR-hc8ye
@ASHOKKUMAR-hc8ye 3 жыл бұрын
If I can contact you
@IronSherlock
@IronSherlock 7 жыл бұрын
btw, the source code is empty. re-upload it please.
@upgrdman
@upgrdman 7 жыл бұрын
Fixed it.
@francodiaz8439
@francodiaz8439 4 жыл бұрын
I don´t know why dont work :(
@gamersteam2900
@gamersteam2900 7 жыл бұрын
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
Using IR Remote Controls with the Arduino
35:28
DroneBot Workshop
Рет қаралды 935 М.
Bed Occupancy and IR transmitter for Home Assistant
26:46
ResinChem Tech
Рет қаралды 10 М.
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 106 МЛН
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
This mother's baby is too unreliable.
00:13
FUNNY XIAOTING 666
Рет қаралды 36 МЛН
Take control of your life for only $10!
7:02
Make it for less
Рет қаралды 13 М.
Hacking a weird TV censoring device
20:59
Ben Eater
Рет қаралды 3,1 МЛН
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
Intro to Hardware Reversing: Finding a UART and getting a shell
12:07
Tony Gambacorta
Рет қаралды 897 М.
The coolest robot I've ever built!
19:40
Thomas Burns
Рет қаралды 4,7 МЛН
Smart IR remote control
14:28
kian
Рет қаралды 33 М.
Advanced Arduino Telemetry and Data Visualization
55:24
upgrdman
Рет қаралды 25 М.
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 106 МЛН