(SKU:RB-03T001)IR Kit For Arduino

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

Contents

overview

The Alsrobot IR Remote Kit for Arduino provides a remote control capability to your project. Have you ever needed a cheap way to activate something from across the room? Infrared is still the cheapest way to wirelessly control a device. This kit includes everything you need to start playing around with IR control for your Arduino.This kit includes a keychain remote control, a couple infrared receivers, some resistors, and even some IR LEDs. Using this kit, you can control your Arduino with the included remote control, or use the receiver and LEDs to communicate from one board to another. You can even use your own remote control, or use the kit to control your TV or stereo!

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

using method

Step 1:Wiring
S port is connected to the I/O port of the controller. +, - respectively, received +5V and GND power.
Step 2:Fixed
According to the passage diameter connector 3 (copper, screws, bolts) fixed.


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
Sdfa2.jpg

As shown in figure, the infrared remote control receiving sensor is connected to the LCD1602 character LCD by using the sensor connection line. The 1 Analog panels, such as the voice prompts the company's buzzer module is connected to the analog port 2, Here to illustrate, we are the analog interface as a digital interface, so it is more convenient, see examples of procedures Interface definition. After connecting the hardware, then extract the test source library files to your Arduino installation directory Libraries hardware\ (such as the need for infrared remote sensor library file please contact our technical customer service). So After the code is compiled and downloaded to the Arduino, you can read the test key, at the same time in the software serial The watch window can see synchronous display key (Note: software serial baud rate is set to 9600).

Sample code

#include <LCD4Bit_mod.h>
LCD4Bit_mod lcd = LCD4Bit_mod(2);
#define TIMER_RESET   TCNT1 = 0 
#define SAMP LE_S IZE    68 
int BUZZER = 16;
int IRpin = 15;    
unsigned int TimerValue[SAMPLE_SIZE];  
char direction[SAMPLE_SIZE];  
byte change_count; 
long t ime1, t ime2; 
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_RES ET; 
TimerValue[change_count] = TCNT1; 
direct ion[change_count++] = '0'; 
while (change_count < S AMP LE_SIZE) {
if (direction[change_count-1] == '0') {
while(digitalRead(IRpin) == LOW) {}    
TimerValue[change_count] = TCNT1;
direct ion[change_count++] = '1';      
}
else {
while(d igit alRead(IRpin) == HIGH) {}     
TimerValue[change_count] = TCNT1;
direct ion[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 ((t ime2 - time1) > 8000)
{ 
else if ((time2 - t ime1) > 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(); 

}

Program effect

matching remote control key table: The Arduino platform the key code

Sdfa3.jpg

51 MCU platform full key code

Sdfa4.jpg

Product recommendation

Buy address:IR Kit For Arduino

Personal tools
Namespaces

Variants
Actions
Navigation
Tools