Universal IR Remote Control
This Arduino-based device can act as a remote control for any appliance when needed.
Project description
Code
Arduino Source Code For Universal IR Remote Control
h
1#include <IRremote.h> // Include IR remote Library 2IRsend irsend; 3#define select1 // Select Buttons 4#define select2 5#define select3 6#define row1 4 // Operational Keypad Matrix (2x3) 7#define row2 5 8#define col1 6 9#define col2 7 10#define col3 8 11void setup() 12{ 13 pinMode(row1,OUTPUT); 14 pinMode(row2,OUTPUT); 15 pinMode(col1,INPUT); 16 pinMode(col2,INPUT); 17 pinMode(col3,INPUT); 18 pinMode(select1,INPUT); 19 pinMode(select2,INPUT); 20 pinMode(select3,INPUT); 21} 22void loop() 23{ 24if(digitalRead(select1)==HIGH) // Remote 1 (TV) 25{ 26 digitalWrite(row1,HIGH); 27 digitalWrite(row2,LOW); 28 if(digitalRead(col1)==HIGH) // key1 pressed 29 { 30 irsend.sendNEC(0x1CE338C7,32); //power 31 } 32 else if(digitalRead(col2)==HIGH) // key2 pressed 33 { 34 irsend.sendNEC(0x1CE3A857,32); //mute 35 } 36 else if(digitalRead(col3)==HIGH) // key3 pressed 37 { 38 irsend.sendNEC(0x1CE36897,32); //Channel Up 39 } 40 else 41 { 42 digitalWrite(3,LOW); 43 } 44 delay(10); 45 digitalWrite(row2,HIGH); 46 digitalWrite(row1,LOW); 47 if(digitalRead(col1)==HIGH) // key4 pressed 48 { 49 irsend.sendNEC(0x1CE3E817,32); //Channel Down 50 } 51 else if(digitalRead(col2)==HIGH) // key5 pressed 52 { 53 irsend.sendNEC(0x1CE330CF,32); //Volume Up 54 } 55 else if(digitalRead(col3)==HIGH) // key6 pressed 56 { 57 irsend.sendNEC(0x1CE3B04F,32); //Volume Down 58 } 59 else 60 { 61 digitalWrite(3,LOW); 62 } 63 delay(10); 64} 65else if (digitalRead(select2)==HIGH) // --> Remote 2 (DVD/DTH/etc) 66{ 67 // Similar to 'if(){}' block above; copy your own remote codes; 68} 69else if (digitalRead(select2)==HIGH) // --> Remote 3 (other appliances like AC) 70{ 71 // Similar to 'if(){}' block above; copy your own remote codes; 72} 73else 74{ 75 // if multiple select switches ON simultaneously --> NO operation 76} 77} 78
Arduino Source Code For Universal IR Remote Control
h
1#include <IRremote.h> // Include IR remote Library 2IRsend irsend; 3#define 4 select1 // Select Buttons 5#define select2 6#define select3 7#define 8 row1 4 // Operational Keypad Matrix (2x3) 9#define row2 5 10#define col1 11 6 12#define col2 7 13#define col3 8 14void setup() 15{ 16 pinMode(row1,OUTPUT); 17 18 pinMode(row2,OUTPUT); 19 pinMode(col1,INPUT); 20 pinMode(col2,INPUT); 21 22 pinMode(col3,INPUT); 23 pinMode(select1,INPUT); 24 pinMode(select2,INPUT); 25 26 pinMode(select3,INPUT); 27} 28void loop() 29{ 30if(digitalRead(select1)==HIGH) 31 // Remote 1 (TV) 32{ 33 digitalWrite(row1,HIGH); 34 digitalWrite(row2,LOW); 35 36 if(digitalRead(col1)==HIGH) // key1 pressed 37 { 38 irsend.sendNEC(0x1CE338C7,32); 39 //power 40 } 41 else if(digitalRead(col2)==HIGH) // key2 42 pressed 43 { 44 irsend.sendNEC(0x1CE3A857,32); //mute 45 } 46 47 else if(digitalRead(col3)==HIGH) // key3 pressed 48 { 49 irsend.sendNEC(0x1CE36897,32); 50 //Channel Up 51 } 52 else 53 { 54 digitalWrite(3,LOW); 55 56 } 57 delay(10); 58 digitalWrite(row2,HIGH); 59 digitalWrite(row1,LOW); 60 61 if(digitalRead(col1)==HIGH) // key4 pressed 62 { 63 irsend.sendNEC(0x1CE3E817,32); 64 //Channel Down 65 } 66 else if(digitalRead(col2)==HIGH) // 67 key5 pressed 68 { 69 irsend.sendNEC(0x1CE330CF,32); //Volume 70 Up 71 } 72 else if(digitalRead(col3)==HIGH) // key6 pressed 73 74 { 75 irsend.sendNEC(0x1CE3B04F,32); //Volume Down 76 } 77 78 else 79 { 80 digitalWrite(3,LOW); 81 } 82 delay(10); 83} 84else 85 if (digitalRead(select2)==HIGH) // --> Remote 2 (DVD/DTH/etc) 86{ 87 88 // Similar to 'if(){}' block above; copy your own remote codes; 89} 90else if 91 (digitalRead(select2)==HIGH) // --> Remote 3 (other appliances like AC) 92{ 93 94 // Similar to 'if(){}' block above; copy your own remote codes; 95} 96else 97{ 98 99 // if multiple select switches ON simultaneously --> NO operation 100} 101} 102
Downloadable files
Universal-Remote-Control
Universal-Remote-Control

Comments
Only logged in users can leave comments