Experiment on the reception and transmitting signal of Arduino Uno Infrared Remote Control (i)

Source: Internet
Author: User

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;
}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.