TechnicalEngineer
Published © GPL3+

Universal IR Remote Control

This Arduino-based device can act as a remote control for any appliance when needed.

IntermediateFull instructions provided729
Universal IR Remote Control

Story

Read more

Schematics

Universal-Remote-Control

Code

Arduino Source Code For Universal IR Remote Control

C Header File
#include <IRremote.h>    // Include IR remote Library
IRsend irsend;
#define select1        // Select Buttons
#define select2
#define select3
#define row1 4         // Operational Keypad Matrix (2x3)
#define row2 5
#define col1 6
#define col2 7
#define col3 8
void setup()
{
  pinMode(row1,OUTPUT);
  pinMode(row2,OUTPUT);
  pinMode(col1,INPUT);
  pinMode(col2,INPUT);
  pinMode(col3,INPUT);
  pinMode(select1,INPUT);
  pinMode(select2,INPUT);
  pinMode(select3,INPUT);
}
void loop()                                      
{
if(digitalRead(select1)==HIGH)                  // Remote 1 (TV)
{
    digitalWrite(row1,HIGH);
    digitalWrite(row2,LOW);
      if(digitalRead(col1)==HIGH)       // key1 pressed
       {
         irsend.sendNEC(0x1CE338C7,32);      //power
       }  
      else if(digitalRead(col2)==HIGH)   // key2 pressed
       {
         irsend.sendNEC(0x1CE3A857,32);      //mute
       }
       else if(digitalRead(col3)==HIGH)  // key3 pressed
       {
         irsend.sendNEC(0x1CE36897,32);      //Channel Up
       }
       else
       {
         digitalWrite(3,LOW);
       }
    delay(10);
    digitalWrite(row2,HIGH);
    digitalWrite(row1,LOW);
      if(digitalRead(col1)==HIGH)         // key4 pressed
       {
         irsend.sendNEC(0x1CE3E817,32);      //Channel Down
       }  
      else if(digitalRead(col2)==HIGH)    // key5 pressed
       {
         irsend.sendNEC(0x1CE330CF,32);      //Volume Up
       }
       else if(digitalRead(col3)==HIGH)   // key6 pressed
       {
        irsend.sendNEC(0x1CE3B04F,32);      //Volume Down
       }
       else
       {
         digitalWrite(3,LOW);
       }
    delay(10);
}
else if (digitalRead(select2)==HIGH)          // --> Remote 2 (DVD/DTH/etc)
{
 // Similar to 'if(){}' block above; copy your own remote codes;
}
else if (digitalRead(select2)==HIGH)          // --> Remote 3 (other appliances like AC)
{
  // Similar to 'if(){}' block above; copy your own remote codes;
}
else
{
  // if multiple select switches ON simultaneously --> NO operation
}
}

Credits

TechnicalEngineer

TechnicalEngineer

4 projects • 49 followers

Comments