5-min Tutorials: Arduino IR Remote & Receiver

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey four engineers back with another tutorial for you and this time we will start with the basics in this video on how to set up this infrared remote controller and the sensor and then we will write a bit of very simple code for our Arduino to understand let's get started already so here is the kit in question and this is a Kees infrared kit and it comes packed with this transmitter or remote controller whatever you want to call it and the infrared receiver now these guys are really really cheap so I usually get a bunch of them and I'm ordering in case one doesn't work or I decide to do multiple projects once you have the kit you will obviously need an Arduino board some LEDs a couple of wires and that's about it if you're not familiar with Arduino I have a video of on Arduino for beginners where you can literally build your first project in five minutes I also tell you where and what to buy and how to write code so do check it out if you are new to this channel so let's build our circuit if you have seen my previous videos this receiver is no different than most Arduino sensors it has three ports one for powering the device with five rolls one port that communicates with your Arduino and one ground one very important thing to keep in mind is that every sensor is built different so my 5 volt port might be your ground or communications port and if you don't connect the right ports you might burn your sensor and see some nice fireworks just in time for the holiday season thankfully you can search for the model number on your sensor and download the datasheet to see which pin is which and once you have that figured out we can make our connections in my setup here the pins are from left to right ground 5 volt power and output so once you have the connection set up you are ready to write some code most people have no problem with the hardware connections but find coding a bit tricky if you are one of those people don't worry I will simplify the code for you as much as possible and I will also place the complete code in the comments below since I have been getting constant requests for that so let's go ahead and open our arduino ide and which you should be familiar with by the way from a previous tutorial the first thing we want to do is include the infrared libraries you should have a library in your libraries folder by default but sometimes it may not include your specific manufacturer's library what you can do is you can go to github or github whatever people want to call it and download this library and replace your older library with it once you've done that let's write some code a lot going into details of defining the pins and including the libraries and all the boring stuff because you already know that from previous videos I've also included comments at the end of every line so everything is pretty much self-explanatory let's run the code open the serial monitor and see what we get make sure your remote transmitter has batteries in it and it's working oh by the way one hack to find out whether your remote is actually transmitting it is by placing it in front of your phone or any camera and pressing the buttons but you will actually be able to see the infrared light being transmitted that we normally cannot see through naked eye it's a pretty neat hack okay so let's press the number one good we got FF six eight nine seven and let's press the number two okay we get FF nine eight six seven all right we're gonna we're gonna see what these numbers mean in a minute okay now let's make each button do something like turn a light on and off let's take this LED and connect it to pin 12 and let's go to our code let us define the numbers one and two now so let's say define button underscore one as zero x 5 5 6 8 9 7 oh by the way when you are defining these you have to put the zero X in front just so that your Arduino knows that this is a hexadecimal number and let's define the button 2 as as this let's put a loop down here we will use a switch case loop instead of the normal if-then loops that we've been using because I like switch cases better when there are multiple cases for one action and the later you can add to them easily let's say if the case is button 1 we need LED to be switched on and if you press 2 we need to be switched off this should do it let's test as you can see it works perfectly pressing one turns the LED on and pressing two turns it off and now you can begin to imagine that the possibilities are endless you can take this idea and you can basically control anything with it okay so although that's it for this video but the next video we will be connecting this to a relay and controlling some household equipment with this remote so if you want to follow the project hit the subscribe button and hit the bell icon so you get a notification whenever there's a new video uploaded thank you for watching guys you
Info
Channel: Fungineers
Views: 110,231
Rating: undefined out of 5
Keywords: Arduino, arduino ir, ir sensor, ir remote, ir tutorial, arduino tutorial, IR for beginners, infrared, infrared remote sensor, ir sensor tutorial, arduino projects, arduino beginners, ir blaster, arduino infrared sensor tutorial, ir arduino sensor, infrared arduino sensor
Id: 3jeSfsnQOWk
Channel Id: undefined
Length: 5min 21sec (321 seconds)
Published: Tue Dec 12 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.