This project is to control the home appliances using normal TV remote. It used an arduino board, relay and a TSOP to receive signal from the remote and the control the home appliances. Connect the TSOP with arduino. Connect the 5V and Gnd of TSOP to 5V and Gnd of the arduino and connect the data pin of the TSOP to arduino digital pin 2. Connect the digital pin 10 of the arduino to the relay
Components needed
- Arduino UNO or atmega8 Microcontroller ( Rs.1300 for Arduino or Rs.80 for atmega8 microcontroller )
- TSOP ( Rs. 10 )
- 5V Relays ( Rs. 30 )
Program
#include <IRremote.h>
int TSOP_PIN = 2; // Arduino pin where the TSOP is connected
IRrecv irrecv(TSOP_PIN);
decode_results results;
int i = 0;
void setup()
{
pinMode(10,OUTPUT); // Connect relay to pin 10 of the Arduino
pinMode(2,INPUT);
digitalWrite(2,HIGH);
irrecv.enableIRIn();
Serial.begin(9600);
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value); // Prints the value from remote in Serial monitor
if(results.value==33) // Change the value according to your remote
{
digitalWrite(10,HIGH); // Switches on the relay
}
else
{
digitalWrite(10,LOW); // Switches off the relay
}
delay(300);// delay to avoid repeated value
irrecv.resume(); // To receive the next value from IR remote
}
}
Troubleshooting
The program won't compile until you copy and paste the libraries in the My documents folder.
The libraries are available at
TSOP
Connect the Gnd to arduino Gnd
Connect the Vs to arduino 5V
Connect the OUT to arduino pin 2
Relay Circuit
Connect the digital pin 2 of the arduino to the base of the transistor.
Connect the Gnd of the arduino to the relay circuit Gnd.


No comments:
Post a Comment