Introduction to IR Protocol
IR or infrared communication is one of the most common methods of wireless communication due to being easy to use and having an affordable price. Infrared light, with a wavelength longer than visible light, is not within the range of human vision. That’s why it’s a good option for wireless communications. When you press a button on your TV control, an LED on your control turns on and off continuously and causes a modulated infrared signal to send from the control to your TV. The command will execute after the signal is demodulated. IR receiver modules are used to receive IR signals. These modules work in 3, 8 kHz frequency. When the sensor is not exposed to any light at its working frequency, the Vout output has a value equal to VS (power supply). With exposure to a 38 kHz infrared light, this output will be zero.
Find the Code for each Remote Control Button
In this part, we want to set up a connection between the Arduino and an IR sender and receiver. To do this, we first need to know the code for each button on the remote control. By pressing each button, a specific signal sends to the receiver and will be displayed on the Serial Monitor window.
Circuit
Code
You need to install the IR library to use an IR module. Download the library from the following link and in the Sketch window, open the Include library option and select IRRemote.h.
This library may be available in your Arduino libraries by default. In this case, you don’t need to install it.
NOTE:
irrecv.decode(&results) function decodes the received IR signal and stores it in variable results. It returns 0 when nothing is received.
Comments
Post a Comment