Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
sagar saini
Published © GPL3+

IR remote control Arduino based electric board

Arduino based electric board controlling system, Can be controlled using any universal IR remote. good IR receiving range and support 12 CH.

IntermediateFull instructions provided1 hour2,586
IR remote control Arduino based electric board

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
IR receiver (generic)
×1
LED (generic)
LED (generic)
×5
JLCPCB Customized PCB
JLCPCB Customized PCB
×12
Resistor 1k ohm
Resistor 1k ohm
×1
4-CHANNEL RELAY CONTROLLER FOR I2C
ControlEverything.com 4-CHANNEL RELAY CONTROLLER FOR I2C
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×3
Optocoupler, Transistor Output
Optocoupler, Transistor Output
×3
9V to Barrel Jack Connector
9V to Barrel Jack Connector
×1
9V battery (generic)
9V battery (generic)
×1

Software apps and online services

EasyEDA
JLCPCB EasyEDA

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering

Story

Read more

Schematics

Circuit diagram

Use this to build your own project

Code

4 channel relay code

C/C++
/* hello guys this code is designed by Sagar saini,  youtube channel- sagar networks 
 *  follow us on hackster using this link
 * If the code not work, try to update IR libraries or download new and compatible library from my website.
 * link:
 * To decode the data of any universal ir remote follow this link:
 * I am always availble on Instagram so please check out me there: saini_sagar_7294
 */

#include <IRremote.h>
const int RECV_PIN=8;
IRrecv irrecv(RECV_PIN);
decode_results results;

#define Relay1 12  // Load1 Pin Out
#define Relay2 11  // Load2 Pin Out
#define Relay3 10  // Load3 Pin Out
#define Relay4 9  // 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 ( change the hex value ED127F80 to your remote value)
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

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

Comments