Home Automation With Arduino and Relay Module and on/off With Any IR Remote

relay module

circuit diagram

Note: Tsop bhut se type ke hote hai to is baat ka dhyan rakkhe ki sabhi Tsop ki pin out bhi alag alag hoti hai.
Tsop ki wiring karne se pahle uske schematic ko dhyan se samajh le.

Relay module aap koi bhi use kar sakte hai q ki unki wiring same hi hogi.

Arduino Sketch

#includeint RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;#define BUTTON_1 0x1FE50AF
#define BUTTON_2 0x1FED827
#define BUTTON_3 0x1FEF807
#define BUTTON_4 0x1FE30CF
#define BUTTON_5 0x1FEB04F
#define BUTTON_6 0x1FE708F
int R_1 = 5;
int R_2 = 6;
int R_3 = 7;void setup()
{
pinMode(R_1, OUTPUT);
pinMode(R_2, OUTPUT);
pinMode(R_3, OUTPUT);irrecv.enableIRIn();
}
void loop() {if (irrecv.decode(&results))
{
if (results.value == BUTTON_1)
{
digitalWrite(R_1, LOW);
}
if (results.value == BUTTON_4)
{
digitalWrite(R_1, HIGH);
}if (irrecv.decode(&results))
{
if (results.value == BUTTON_2)
{
digitalWrite(R_2, LOW);
}
if (results.value == BUTTON_5)
{
digitalWrite(R_2, HIGH);
}if (irrecv.decode(&results))
{
if (results.value == BUTTON_3)
{
digitalWrite(R_3, LOW);
}
if (results.value == BUTTON_6)
{
digitalWrite(R_3, HIGH);
}
irrecv.resume();
}
}
}
}

Note: First Box me (Red Code) RF Remote Ki Coding hai jise aapko agar change karna ho to kar sakte hai. First aur Second box ki sabhi coading ko copy karke Arduino software me paste kar ke Upload Karna hoga.

Note: aapko pahle apne remote key ka RF Code Nikalna hoga jo ki Bhut jada jaroori hai, ya fir aap video me dikhaye gaye Remote ka bhi use kar sakte hai jo ki MP3 Player ka hai.

Video Link: Watch Now

[content-egg module=Amazon template=item]

One thought on “Home Automation With Arduino and Relay Module and on/off With Any IR Remote

  • 28/07/2019 at 8:35 PM
    Permalink

    Sender Ka kanenxan maize kare

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.