(SKU:RB-03T003)IR Remote Controller

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

Contents

overview

Have you ever needed a cheap way to activate something from across the room? Infrared remotes are still the cheapest way to wirelessly control a device. The remote does control volume, power, and mute on most of the IR equipment in our office. Rather, we are carrying this remote to work with many of the more common IR receiver ICs.

Technical parameters and performance

  1. CR2025 environmental button batteries, 160mah capacity
  2. Transmitting distance: above 8m (related to the surrounding environment, the sensitivity of receiving end)
  3. Effective Angle: 60 degrees
  4. Surface materials: mmPET 0.125, effective life 20000 times.
  5. Stable quality, cost-effective
  6. Quiescent current 3-5uA, dynamic current 3-5mA
  7. Weight:15g

Product figure

Asda2.jpg


Application Routine

we use the Arduino controller to do a test, use hardware equipment 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
Asda3.jpg
as shown in the figure, using the sensor cable to connect the infrared remote control receiver sensor is connected to the expansion board character LCD1602 LCD analog port 1, for voice prompts to the company's buzzer module is connected to the analog port 2, here to explain, we are the digital interface is used as analog interface, so more convenient, see example program interface definition. Hardware connection, then the test source library to unzip the files to your Arduino installed inside a directory hardware\libraries (for infrared remote control receiving sensor library files, please contact our technical service). Then the code is compiled and downloaded to the Arduino, you can are keys to read test, also in the software serial port monitor window can be seen on the synchronization of the key display (Note: the software serial port baud rate is set to 9600)
  1. matching remote control key table:
Asda4.jpg

Sample code

#include <LCD4Bit_mod.h>   
LCD4Bit_mod lcd = LCD4Bit_mod(2);   
#define TIMER_RESET  TCNT1 = 0 
#define SAMPLE_SIZE  68 
int BUZZER = 16; 
int IRpin = 15;     
unsigned int TimerValue[SAMPLE_SIZE]; 
char direction[SAMPLE_SIZE]; 
byte change_count; 
long time1, time2; 
unsigned long data; 
char a,b,c,d,e; 
unsigned long irc; 
char tab[12]={"0123456789"}; 
void setup() { 
    pinMode(IRpin, INPUT);  
    pinMode(13, OUTPUT);   
    pinMode(BUZZER,OUTPUT); 
    lcd.init(); 
    lcd.clear(); 
    lcd.printIn("www.robotbase.cn"); 
    lcd.cursorTo(2, 0);
lcd.printIn("IR_CODE:"); 
    TCCR1B = 0x03;  
    TCCR1A = 0x00;  
    a=0;b=0;c=0;d=0;e=0; 
    Serial.begin(9600);  
    bee(); 
} 
void loop() { 
          lcd.cursorTo(2, 9);   
      lcd.print(tab[a]); 
          lcd.cursorTo(2, 10);  
      lcd.print(tab[b]); 
          lcd.cursorTo(2, 11);  
      lcd.print(tab[c]); 
          lcd.cursorTo(2, 12);  
      lcd.print(tab[d]); 
          lcd.cursorTo(2, 13);   
      lcd.print(tab[e]); 
          ir_code();                                                                   
          Serial.println(irc); 
} 

void bee() 
{ 
    digitalWrite(BUZZER,LOW);
    delay(300); 
    digitalWrite(BUZZER,HIGH);
    delay(300); 
} 
void ir_code() { 
         change_count = 0; 
         while(digitalRead(IRpin) == HIGH) {}           
         TIMER_RESET; 
         TimerVal ue[change_count] = TCNT1; 
         directio n[change_count++] = '0'; 
         while (change_count < SAMPLE_SIZE) {   
            if (direction[change_count-1] == '0') {   
         	   while(digitalRead(IRpin) == LOW) {}                                                                     
         	   TimerValue [change_count] = TCNT1;   
        		   direction[change_count++] = '1';   
}          
            else  {              
         	  while(digit alRead(IRpin) == HIGH) {}    
         	  TimerValue [change_count] = TCNT1;   
              direction[change_count++] = '0';    
           } 
        } 
        change_count = 0; 
        data = 0; 
        time1 = (long) TimerValue[change_count] * 4;   
        change_count += 2; 
        while (change_count < SAMPLE_SIZE) { 
        time2 = (long) TimerValue[change_count] * 4; 
          if ((time2 -  time1) > 8000)          
         { 
} 
         else if ((time2 - time1) > 1680) {         
            data = data << 1;       
data |= 1;                 
}
        else {                   
               data = data << 1;             
} 
        change_count += 2; 
        time1 = time2; 
      } 
       irc=data%100000; 
        a=irc/10000; 
        b=irc%10000/1000; 
        c=irc%1000/100; 
        d=irc%100/10; 
        e=irc%10; 
        bee(); 
}


Product recommendation

Buy address:IR Remote Controller

Personal tools
Namespaces

Variants
Actions
Navigation
Tools