Control Your Home Appliances Using IR Remote
by kitty 1234 in Circuits > Arduino
5099 Views, 42 Favorites, 0 Comments
Control Your Home Appliances Using IR Remote
Hello everyone, In this instructable we will be using Arduino And Relay module to control home appliances using IR remote.
Controlling home appliances using IR remote is basics of home automation.
Once done you can use the same method to control other appliances around your house like Fan, Coffee maker, e.t.c.
How it works?
- When you hit a key on your remote, the transmitting IR LED will blink very quickly for a fraction of a second, transmitting encoded data.
- The Arduino recive these encoded data using IR receiver and performs a pre-specified function.
Gather the Parts
In order to remote control your home appliances you'll need:
- A breadboard
- A LED
- An Arduino
- A TSOP382 IR receiver
- A 5V Relay module
- Some jumper or hookup wires
Wiring
Hookup all the components according to the circuit diagram shown above.
If you haven't already, check my previous instructable on how to wire up a Relay module to Arduino.
Receive IR Signals
Download Ken Sherrifs IR library from github then add the library to "Arduino installation location\libraries\"
Then upload the following code to your arduino:
#include
int IR_Recv = 2; //IR Receiver Pin 2
IRrecv irrecv(IR_Recv);
decode_results results;
void setup(){
pinMode(13, OUTPUT);
Serial.begin(9600); //starts serial communication
irrecv.enableIRIn(); // Starts the receiver
}
void loop(){
if (irrecv.decode(&results))
{
long int decCode = results.value;
Serial.println(decCode);
irrecv.resume();
}
}
Then open the serial monitor on your arduino IDE and receive IR decimal signals by pressing buttons on your remote for this project we'll need two IR decimal signals.
Downloads
Arduino Sketch
Upload the following code to your arduino after replacing 2340092731 and 2086679999 with your IR remote decimal code:
#include
int IR_Recv = 2; //IR Receiver Pin 2
IRrecv irrecv(IR_Recv);
decode_results results;
void setup(){
pinMode(13, OUTPUT);
Serial.begin(9600); //starts serial communication
irrecv.enableIRIn(); // Starts the receiver
}
void loop(){
if (irrecv.decode(&results))
{
long int decCode = results.value;
Serial.println(decCode);
if (results.value == 2340092731)
{
digitalWrite(13, LOW);
Serial.println("Bulb turned ON");
}
if (results.value == 2086679999)
{
digitalWrite(13, HIGH);
Serial.println("Bulb turned OFF");
}
irrecv.resume();
}
}
Downloads
Done
Now, power up the arduino and relay. Then, Press the buttons on your remote to see your AC bulb turning on and off.
Thanks for viewing.