Send TV Remote signal using Arduino

First decode the tv remote and get the hex code for each button..This code will do that…

#include 

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}

Copy the codes for the button say for channel up is 80BFA15E…ok to send this code connect an IR Led to pin no 3..

ir

 

Check whether the remote model is NEC or SONY and use this code to send the value

#include <IRremote.h>

IRsend irsend;
const int buttonPin = 2; // the number of the pushbutton pin
//const int ledPin = 3;
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
// pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}

void loop() {

buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
irsend.sendNEC(0x80BFA15E, 32);
}

}

Now when the button is pressed the channel will change..If the remote is sony then use irsend.sendSony…

 

 

Happy Hacking 🙂

Advertisements

6 thoughts on “Send TV Remote signal using Arduino

  1. sir,after copying the library files when i tried to compile it showing error written below plz give some solution:
    e:/softwares/arduino/new folder (2)/isenso new/arduino-1.0.1/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: sketch_apr03a.cpp.elf section .text will not fit in region text
    e:/softwares/arduino/new folder (2)/isenso new/arduino-1.0.1/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: region text overflowed by 208 bytes

    • Most of the remotes come under these standards the library supports these two standards only if you try some other it says unknown devoce

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s