LESSON 7 – REMOTE CONTROL WITH IR RECEIVER MODULE OF ARDUINO

The Keyes IR receiver is used in this project for infrared remote control. With low power consumption and an easy to use package, it mates well with embedded electronics and can be used with common IR remotes. The TSOP18 series are miniaturized receivers for infrared remote control systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The demodulated output signal can directly be decoded by a microprocessor. The main benefit is the reliable function even in disturbed ambient and the protection against uncontrolled output pulses.


Figure 1 – Keyes IR Receiver Module
Specifications 

· Supply Voltage: 2.7V to 5.5V
· Supply Current : 1.5mA
· Operating Temperature: -25°C to 85°C
· Frequency: 37.9KHZ
· Receiving Angle: 90°
· Receiving Distance: 18m


Figure 2 – Schematic of Keyes IR Receiver Module



Figure 3 – The Circuit of Remote Control with IR Receıver Module Of ARDUINO


You can read The TV Control Buttons (Figure 4) Code on Serial Monitor (Figure 5).




Figure 4 – TV Control



Figure 5 - The TV Control Buttons Codes on Serial Monitor

Arduino UNO Program
#include<IRremote.h> // Library of IR Remote
int RECV_PIN = 8; // Arduino Pin Number for IR Receiver Data Pin
IRrecv irrecv(RECV_PIN);
decode_results results;
#define LED1 4
#define LED2 5
#define LED3 6
#define LED4 7

void setup()
{
  Serial.begin(9600); // Serial Bound Rate
  irrecv.enableIRIn(); // Start the receiver
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED4, OUTPUT);
}

void loop() {
  if (irrecv.decode(&results)) {
    uint32_t resultCode = (results.value );
    if (resultCode==0x20DF8877)// TV Control Button “1” Code
    {
    digitalWrite(LED1,HIGH); //LED1 ON
    }
    else if (resultCode==0x20DF48B7)// TV Control Button “2” Code
    {
    digitalWrite(LED2,HIGH); //LED2 ON
    }
    else if (resultCode==0x20DFC837)// TV Control Button “3” Code
    {
    digitalWrite(LED3,HIGH); //LED3 ON
    }
    else if (resultCode==0x20DF28D7)// TV Control Button “4” Code
    {
    digitalWrite(LED4,HIGH); //LED4 ON
    }
    else if (resultCode==0x20DF08F7)// TV Control Button “0” Code
    {
    digitalWrite(LED1,LOW); //LED1 OFF
    digitalWrite(LED2,LOW); //LED2 OFF
    digitalWrite(LED3,LOW); //LED3 OFF
    digitalWrite(LED4,LOW); //LED4 OFF
    }
    Serial.println(results.value, HEX); //Write the button code to serial monitor
    irrecv.resume(); // Receive the next value
  }
}

Click for the Arduino Program (IR_LEDKontrol.ino)
Click for the IRremote Library (IRremote.h) 

Video Of Lesson




Hiç yorum yok:

Yorum Gönder