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

Uno R3 ATmega328P with USB Cable length 1 feet, Compatible with ATMEGA16U2 Arduino (Color may vary)

Rs. 500
27 new from Rs. 460
Free shipping
Buy Now
Amazon.in
as of 28/05/2018 1:47 AM

Features

  • Microcontroller ATmega328P
  • Operating Voltage : 5V
  • Digital I/O Pins
  • 14 (of which 6 provide PWM output)
  • PWM Digital I/O Pins .6 Analog Input Pins .6.Flash Memory 32 KB (ATmega328P) of which 0.5 KB used by bootloader

REES52 Optocoupler 4 Channel 5V Relay Module Relay Control for Arduino DSP AVR PIC ARM

Rs. 500
Rs. 268
11 new from Rs. 195
Free shipping
Buy Now
Amazon.in
as of 28/05/2018 1:47 AM

Features

  • 4-channel relay output module, relay output contact is maximum 250A 10A
  • Effective VCC, GND power input, can relay a separate power supply relay power input of JD-VCC
  • Input IN1, IN2, IN3, IN4 signal line active low
  • 5V 4-Channel relay board controlled directly by micro-controller (Arduino, 8051, AVR, PIC, DSP, ARM, ARM, MSP430, TTL logic) need 50-60mA driver current
  • High-current, AC250V 10A, DC30V 10A. Packing Including: 1x 5V 4 channel relay module

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.