sagar saini
Published © GPL3+

Remote control 4 channel Electric Board

Controlling electricity using electronic circuits is called smart switching method, we are using IR remote to control electric board

BeginnerFull instructions provided1 hour623
Remote control 4 channel Electric Board

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
4-CHANNEL RELAY CONTROLLER FOR I2C
ControlEverything.com 4-CHANNEL RELAY CONTROLLER FOR I2C
×1
IR receiver (generic)
×1

Software apps and online services

EasyEDA
JLCPCB EasyEDA
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

circuit PDF

Code

code

C/C++
#include <IRremote.h>
const int RECV_PIN=6;
IRrecv irrecv(RECV_PIN);
decode_results results;

#define Relay1 7 // Load1 Pin Out
#define Relay2 5  // Load2 Pin Out
#define Relay3 4  // Load3 Pin Out
#define Relay4 3  // Load4 Pin Out

int load1, load2, load3, load4, power;


void setup()
{
  Serial.begin(9600);

  pinMode(Relay1, OUTPUT); // declare as output for Load1 Pin Relay1     
  pinMode(Relay2, OUTPUT); // declare as output for Load2 Pin Relay2 
  pinMode(Relay3, OUTPUT); // declare as output for Load3 Pin Relay3  
  pinMode(Relay4, OUTPUT); // declare as output for Load4 Pin Relay4 
  
 digitalWrite(Relay1, 0); // Turn Off Load1
 digitalWrite(Relay2, 1); // Turn Off Load2
 digitalWrite(Relay3, 1); // Turn Off Load3
 digitalWrite(Relay4, 1); // Turn Off Load4
  
  irrecv.enableIRIn(); // Start the receiver
  irrecv.blink13(true);
}
void loop() {
 

 if (IrReceiver.decode()) 
  {
    Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);


     if(IrReceiver.decodedIRData.decodedRawData==0xED127F80){ // For Load1 On  
load1 = 0;  
}
else if(IrReceiver.decodedIRData.decodedRawData==0xE51A7F80){ // For Load1 Off 
load1 = 1; 
}

else if(IrReceiver.decodedIRData.decodedRawData==0xFE017F80){ // For Load2 On 
load2 = 0; 
}
else if(IrReceiver.decodedIRData.decodedRawData==0xFD027F80){ // For Load2 Off 
load2 = 1;  
}

else if(IrReceiver.decodedIRData.decodedRawData==0xFB047F80){ // For Load3 On 
load3 = 0;  
}
else if(IrReceiver.decodedIRData.decodedRawData==0xFA057F80){ // For Load3 Off 
load3 = 1;  
}

else if(IrReceiver.decodedIRData.decodedRawData==0xF8077F80){ // For Load4 On 
load4 = 0;   
}
else if(IrReceiver.decodedIRData.decodedRawData==0xF7087F80){ // For Load4 Off 
load4 = 1;
}
else if(IrReceiver.decodedIRData.decodedRawData==0xE11E7F80){ // For Load4 Off 
load1=0;
load2=0;
load3=0;
load4=0;
}
else if(IrReceiver.decodedIRData.decodedRawData==0xFC037F80){ // For Load4 Off 
load1=1;
load2=1;
load3=1;
load4=1;
}
 irrecv.resume(); // Receive the next value
 delay(100);
 }

if(power==1){  
 digitalWrite(Relay1, 1); // Turn Off Load1
 digitalWrite(Relay2, 1); // Turn Off Load2
 digitalWrite(Relay3, 1); // Turn Off Load3
 digitalWrite(Relay4, 1); // Turn Off Load4
}else{
digitalWrite(Relay1, load1); 
digitalWrite(Relay2, load2); 
digitalWrite(Relay3, load3); 
digitalWrite(Relay4, load4);
}
  
delay(500);  
}

Credits

sagar saini

sagar saini

78 projects • 81 followers
I am Sagar Saini an electronic hardware enthusiast

Comments