Home TV, air-conditioning appliances are infrared remote control,
This experiment is to see the principle of its reception and emission.
So two blocks of Arduino Uno are required to receive & launch separately.
The reception of the Arduino Uno Infrared remote control (in this article)
Next, Arduino Uno Infrared remote control receiving and transmitting signal experiment (bottom)
First look at this module
Experimental Results
The experiment receives the infrared signal and records its signal.
In the experiment, I used a LED color light strip infrared remote control, remote control press on the key, the computer serial port will receive the signal
In the experiment, I can see that when I press the key, I will receive the signal and display it in 16, in fact, it can be converted into 10 in order to understand the values we use.
When you keep pressing the switch, sometimes there are different values,
I estimate that this condition is not entirely caused by reception.
I don't know if it is, please correct me.
And then I recorded this value FF02FD
Save to the next article, infrared emission use, see if can control LED light bar.
BOM List
Arduino Uno * *
Infrared Receiver Tube * *
Jumper several
Wiring
Arduino Uno <-----> IR Receiver Tube (or IR receiver module)
5V <-----> VCC
GND <-----> GND
Pin <-----> Out
Program Source Code
This program needs to use the library function
Https://github.com/z3t0/Arduino-IRremote
Please go to the above link, download the library file, and then unzip the file into the Libraries folder of the Arduino.
There may be some installation of the Arduino IDE and installed a irremote library, if any, try not to, not the original deleted, and then unzip the library file.
Installing a library file can bring up the program like this:
You see the following code
/
* * Irremote:irrecvdemo-demonstrates receiving IR codes with IRRECV
* A IR detector/demodulator must be Conne CTED to the input recv_pin.
* Version 0.1 July,
* Copyright Ken shirriff
* http://arcfn.com * *
#include <IRremote.h> //irremote Library declaration
int recv_pin = one; The pin of the infrared receiver is defined as one
irrecv irrecv (recv_pin);
Decode_results results;
void Setup ()
{
serial.begin (9600);
Irrecv.enableirin (); Start receiver
}
void Loop () {
if (Irrecv.decode (&results))
{
serial.println (Results.value, HEX);//16-in-line newline output receive code
Irrecv.resume (); e//receives next value
}
delay;
}