Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Daini
Published © CC BY-NC

Control Your Home Appliances Using IR Remote

How to make Control Your Home Appliances Using IR Remote

BeginnerFull instructions provided1 hour1,202
Control Your Home Appliances Using IR Remote

Things used in this project

Story

Read more

Schematics

Schematics

Code

code 2

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();

}

}

code 1

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);

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();

}

}

Credits

Daini
31 projects • 17 followers
Contact

Comments

Please log in or sign up to comment.