IR Remote Controlled Home Automation Using Arduino
IR Remote Controlled Home Automation Using Arduino
Introduction
In this project, we are using IR based wireless communication for controlling home
appliances. In this project, Arduino is used for controlling whole the process. We send some
commands to the controlling system by using IR TV/DVD/MP3 remote for controlling AC
home appliances. After receiving signal from IR remote, Arduino sends related signal to
relays which are responsible for switching ON or OFF of the home appliances through a relay
driver.
1
IR Remote Controlled Home Automation using Arduino
Working Explanation:
There are many types of IR Remote are available for different device but most of them are
worked on around 38KHz Frequency signal. Here in this project we control home appliances
using IR TV remote. For detecting IR remote signal, we use TSOP1738 IR Receiver. This
TSOP1738 sensor can sense 38Khz Frequency signal. The working of IR remote and the
TSOP1738 can be covered in detail in this article: IR Transmitter and Receiver
2
IR Remote Controlled Home Automation using Arduino
Components:
Arduino UNO
TSOP1738
IR TV/DVD Remote
ULN2003
Relays 5 volt
Bulb with holder
Connecting wires
Bread board
16x2 LCD
Power supply
PVT
IC 7805
Here in this project we have used 7, 8 and 9 number button of IR remote, for controlling Fan,
Light and TV respectively and ON/OFF button (Power button) is used for turning ON and
OFF all the appliances simultaneously.
Here we have used toggle [EVEN ODD] method for ON and OFF the single home
appliance. Toggle method is nothing but to get that whether the button is pressed even no of
times or the odd no of times. This is found by getting the reminder after dividing it by 2
(i%2), if there is some reminder then device will be turned ON and if reminder is 0 then it will
be turned OFF. Suppose Key 7 is pressed on the remote then remote sends a signal
to Arduino through TSOP IR Receiver. Then Arduino decode it and store the decoded value
into the results variable. Now results variable has a hex value 0x1FE00FF, after matching it
with the predefined hex value of key 7 (see above image), Arduino turns ON the Fan. Now
when we press the same key (key 7) again then IR sends the same code. Arduino gets same
code and matched with same code like before but this time Fan turned OFF because of
toggling the bit [EVEN ODD] (i%2).
3
IR Remote Controlled Home Automation using Arduino
4
IR Remote Controlled Home Automation using Arduino
If you don’t know the Decoded output for your IR remote, it can be easily found, just
follow these steps:
5
IR Remote Controlled Home Automation using Arduino
Circuit Description:
Connections of this circuit are very simple here a liquid crystal display is used for displaying
status of home appliances which is directly connected to arduino in 4-bit mode. Data pins of
LCD namely RS, EN, D4, D5, D6, D7 are connected to arduino digital pin number 6, 7, 8, 9,
10, 11. And output pin of TSOP1738 is directly connected at digital pin number 14 (A) of
Arduino. And Vcc pin is connected a +5 volt and GND pin connected at Ground terminal of
circuit. A relay driver namely ULN2003 is also used for driving relays. 5 volt SPDT 3 relays
are used for controlling LIGHT, FAN and TV. And relays are connected to arduino pin
number 3, 4 and 5 through relay driver ULN2003 for controlling LIGHT, FAN and TV
respectively.
6
IR Remote Controlled Home Automation using Arduino
Code
#include<LiquidCrystal.h>
#include <IRremote.h>
const int RECV_PIN=14;
IRrecv irrecv(RECV_PIN);
decode_results results;
#include<LiquidCrystal.h>
LiquidCrystal lcd(6,7,8,9,10,11);
#define Fan 3
#define Light 4
#define TV 5
int i=0,j=0,k=0,n=0;
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
pinMode(Fan, OUTPUT);
pinMode(Light, OUTPUT);
pinMode(TV, OUTPUT);
//digitalWrite(13,HIGH);
lcd.print("Remote Controlled");
lcd.setCursor(0,1);
lcd.print("Home Automation");
delay(2000);
lcd.clear();
lcd.print("Circuit Digest");
lcd.setCursor(0,1);
delay(1000);
lcd.print("System Ready...");
delay(1000);
irrecv.enableIRIn(); // Start the receiver
7
IR Remote Controlled Home Automation using Arduino
irrecv.blink13(true);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Fan Light TV ");
lcd.setCursor(0,1);
lcd.print("OFF OFF OFF");
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value,HEX);
delay(100);
lcd.setCursor(0,0);
lcd.print("Fan Light TV");
if(results.value==0x1FE00FF)
{
i++;
int x=i%2;
digitalWrite(Fan, x);
lcd.setCursor(0,1);
if(x)
lcd.print("ON ");
else
lcd.print("OFF ");
// delay(200);
}
{
j++;
int x=j%2;
8
IR Remote Controlled Home Automation using Arduino
digitalWrite(Light, x);
lcd.setCursor(6,1);
if(x)
lcd.print("ON ");
else
lcd.print("OFF ");
// delay(200);
}
if(results.value==0x1FE9867)
{
k++;
int x=k%2;
digitalWrite(TV, x);
lcd.setCursor(13,1);
if(x)
lcd.print("ON ");
else
lcd.print("OFF");
// delay(200);
}
if(results.value==0x1FE48B7)
{
n++;
int x=n%2;
digitalWrite(TV, x);
digitalWrite(Fan,x);
digitalWrite(Light,x);
lcd.setCursor(0,1);
if(x)
lcd.print("ON ON ON ");
else
9
IR Remote Controlled Home Automation using Arduino
10