(SKU:RB-03T002)IR Transmitter and Receiver Kit

From ALSRobot-Wki
Jump to: navigation, search
Sdfa1.jpg

Contents

overview

Arduino infrared wireless remote control kits by mini ultra-thin infrared remote controller and 38kHz infrared receiver module, mini slim infrared remote control with 20 function keys and launch the farthest distance up to 8 meters, is very suitable for the indoor control a variety of devices. The infrared receiving module can receive standard 38kHz modulated the remote control signal, through programming the Arduino can be realized on the remote control signal decoding operation, thus making all kinds of remote control robot and interactive works.

Technical parameters and performance

  1. CR2025 green button battery, the capacity of 160mah
  2. transmitting distance: 8m above (the specific and the surrounding environment, the receiver sensitivity and other factors)
  3. effective angle: 60 degrees
  4. surface material: 0.125mmPET, effective life 20000 times.
  5. stable quality, cost-effective
  6. static current of 3-5uA, the dynamic current of 3-5mA.

using method

  • What is infrared receiver head?

Emitted by the infrared remote control signal is a series of binary pulse code to make it from other infrared signal interference in wireless transmission process, usually first its modulation on the specific carrier frequency, and then by the infrared emitting diodes emitted, and the infrared receiving device to filtering the clutter, receive only the specific frequency signal and restore it to the binary pulse code, also is demodulation.

  • Working principle

Built in the receiving tube infrared emission tube emitted the light signal is converted to a weak signal, the signal via the internal IC amplifier amplification, then by automatic gain control, bandpass filtering, demodulation and waveform shaping after reduction for the remote control emission of the original code, through the receive signal output foot of the head is input to the appliance of coded identification circuit.

  • infrared receiver head for pin and wire
  1. D data output
  2. GND for power supply ground
  3. VCC is power positive

Application Routine

We use the Arduino controller to do a test, to use the hardware device as follows:

  1. controller Arduino * 1
  2. Arduino LCD1602 character LCD expansion board * 1
  3. infrared remote control receiver sensor module * 1
  4. buzzer module * 1
  5. ultra-thin infrared remote controller * 1
  6. general 3P sensor cable * 2
  7. USB data communication line x 1

Infrared remote control experiment

experimental device of infrared remote control 1 IR Receiver Module 1 digital sensor cable 1
logical 0 and 1 definitions as shown below:

Hongwai1.jpg

Agreement is as follows:
press the button press the release pulse at once:

Hongwai2.jpg

The above picture shows the typical pulse sequence of the NEC protocol. Note: This is the first to send LSB (lowest level) protocol. The address of the above pulse is 0x16 for the 0x59 command. A message is started with a high level of 9ms, followed by a low level of 4.5ms (which is composed of a boot code for the two stage) and then by the address code and the command code. Address and command transmission two times. The second time all bits are taken, and can be used for confirmation of the received message. The total transmission time is constant because each point is repeated with its counter - length. If you are not interested, you can ignore the reliability of the anti - and can also expand the address and command to every 16 bit!

Press the launch pulse for a period of time:



Hongwai3.jpg


A command is sent once, even though the buttons on the remote are still pressed. When the key press is pressed, the first 110ms pulse is like the image above, and then repeat the code once per 110ms.. This repetition code is composed of a 9ms high level pulse and a 2.25ms low level and 560 s high level.

repetitive pulse

Hongwai4.jpg


Note: pulse waveform of integration into the receiving head, because integration receiving head to decoding, signal amplifying and shaping, so it is necessary to pay attention to in the absence of infrared signal, the output end of the signal for a high level to low level, so its output signal level just and a transmitting terminal are reverse. The receiving end of the pulse can be seen by the oscilloscope, combined with the waveform understanding program.this experimental programming ideas

According to the characteristics of NEC code and the receiving end of waveform, this experiment will be receiving end waveform is divided into four parts: boot code (9ms and 4.5ms pulse), an address code 16 bit (including 8 bits of the address bits and 8 bit address counter), command code 16 bit (including 8 bit command bit and 8-bit command bit Invert), repetition code (9ms, 2.25ms, 560us pulses). The high level and low level of the received waveform are measured by the timer, and the logic "0" and the logic "1" and the guiding pulse and the repetition pulse are guided by the time.. Boot code and address code as long as the judge is correct pulse can be, without storage, but command code must be stored, because each button command codes are different, the command code to perform the corresponding action according to the. VOL+: control of several key buttons on the remote control: LED control lights; VOL-: as a control buzzer;






Sample code

#define BUZZER 10
#define LED_RED 11
#define IR_IN  8  
int Pulse_Width=0;
int  ir_code=0x00;
void timer1_init(void)
{
  TCCR1A = 0X00;
  TCCR1B = 0X05;
  TCCR1C = 0X00;  TCNT1 = 0X00;
  TIMSK1 = 0X00;	
}
  void remote_deal(void)
  {
   switch(ir_code)
   {
     case 0xff00:
     digitalWrite(LED_RED,LOW);
     digitalWrite(BUZZER,LOW);
     break;  case 0xfe01://VOL+
     digitalWrite(LED_RED,HIGH);
     break;  case 0xf609://VOL-
     digitalWrite(BUZZER,HIGH);
     break;
   }
  }
  char logic_value()
  {
  while(!(digitalRead(8))); 
  Pulse_Width=TCNT1;
  TCNT1=0;
  if(Pulse_Width>=7&&Pulse_Width<=10)
  {
    while(digitalRead(8));
    Pulse_Width=TCNT1;
    TCNT1=0;
    if(Pulse_Width>=7&&Pulse_Width<=10)
      return 0;
    else if(Pulse_Width>=25&&Pulse_Width<=27) 
      return 1;
  }
  return -1;
  }
  void pulse_deal()
  {
  int i;  
  for(i=0; i<8; i++)
  {
    if(logic_value() != 0) 
        return;
  }
    
  for(i=0; i<6; i++)
  {
    if(logic_value()!= 1) 
        return;
  }
    //执行1个0
  if(logic_value()!= 0) 
      return;
    //执行1个1
  if(logic_value()!= 1) 
      return;
    
  ir_code=0x00;
  for(i=0; i<16;i++ )
  {
    if(logic_value() == 1)
    {
      ir_code |=(1<<i);
    }
  }
  }
  void remote_decode(void)
  {
  TCNT1=0X00;
         while(digitalRead(8))
  {
    if(TCNT1>=1563)  
    {
      ir_code = 0xff00;
      return;
    }
    }
 
  TCNT1=0X00;
  while(!(digitalRead(8))); 
  Pulse_Width=TCNT1;
  TCNT1=0;
  if(Pulse_Width>=140&&Pulse_Width<=141)//9ms
  {
   while(digitalRead(8));
    Pulse_Width=TCNT1;
    TCNT1=0;
    if(Pulse_Width>=68&&Pulse_Width<=72)//4.5ms
    {
      pulse_deal();
      return;
    }
    else if(Pulse_Width>=34&&Pulse_Width<=36)//2.25ms
    {
      while(!(digitalRead(8)));
      Pulse_Width=TCNT1;
      TCNT1=0;
      if(Pulse_Width>=7&&Pulse_Width<=10)//560us
      {
        return;
       }
    }
  
  }
  void setup()
  {
  unsigned char i;
  pinMode(LED_RED,OUTPUT);
  pinMode(BUZZER,OUTPUT);
  pinMode(IR_IN,INPUT);
  }
  void loop()
  {
    timer1_init();
  while(1)
  {
    remote_decode(); 
    remote_deal();  
  }
}

Program effect

The encoding pulse emitted from the remote controller is decoded and the corresponding action is executed according to the decoding result.. Press forward key light is bright, loosen the red light stop; pressing the back button buzzer rang, loosen the buzzer to stop ringing; so you can use remote control remote control your devices, let it listen to your command. Other key decoding mode and the key, as long as we use oscilloscope measured their waveform, understanding the respective command code, in the implementation of the function of decoding results in written on the corresponding command code and to perform the action can be.
Remote control key schedule

Yaokongqibiaoge.jpg

Product recommendation

Buy address:IR Transmitter and Receiver Kit

Personal tools
Namespaces

Variants
Actions
Navigation
Tools