TV Remote Control Home Appliances...Tried Real Time
Circuit Diagram:
Arduino Code:
Circuit Diagram:
Arduino Code:
/* * Code written by Sdev * https://youtube.com/sdevelectronics */ #include <EEPROM.h> #include <IRremote.h> int load_status_1,load_status_2,load_status_3,load_status_4; #define LED1 5 #define LED2 6 #define LED3 7 #define LED4 8 int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup(){ delay(5000); Serial.begin(9600); pinMode(LED1,OUTPUT); pinMode(LED2,OUTPUT); pinMode(LED3,OUTPUT); pinMode(LED4,OUTPUT); irrecv.enableIRIn(); // Start the receiver check_load_status(); } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); if (results.value == 0x80BF916E) { //red if(load_status_1){ load_status_1 = 0; digitalWrite(LED1,load_status_1); EEPROM.update(0, load_status_1); }else{ load_status_1 = 1; digitalWrite(LED1,load_status_1); EEPROM.update(0, load_status_1); } } if (results.value == 0x80BF21DE) { //green if(load_status_2){ load_status_2 = 0; digitalWrite(LED2,load_status_2); EEPROM.update(1, load_status_2); }else{ load_status_2 = 1; digitalWrite(LED2,load_status_2); EEPROM.update(1, load_status_2); } } if (results.value == 0x80BF9B64) { //yellow if(load_status_3){ load_status_3 = 0; digitalWrite(LED3,load_status_3); EEPROM.update(2, load_status_3); }else{ load_status_3 = 1; digitalWrite(LED3,load_status_3); EEPROM.update(2, load_status_3); } } if (results.value == 0x80BF6996) { //blue if(load_status_4){ load_status_4 = 0; digitalWrite(LED4,load_status_4); EEPROM.update(3, load_status_4); }else{ load_status_4 = 1; digitalWrite(LED4,load_status_4); EEPROM.update(3, load_status_4); } } irrecv.resume(); // Receive the next value } delay(100); } void check_load_status(){ load_status_1 = EEPROM.read(0); load_status_2 = EEPROM.read(1); load_status_3 = EEPROM.read(2); load_status_4 = EEPROM.read(3); digitalWrite(LED1,load_status_1); digitalWrite(LED2,load_status_2); digitalWrite(LED3,load_status_3); digitalWrite(LED4,load_status_4); }
Video Link:
https://youtu.be/MX3e3i53HhY