Send TV Remote signal using Arduino

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


int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
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..



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

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 🙂


Arduino IR Remote identification

Download IR remote library from the following link

Unzip the download.Rename it as IRremote and put it in arduino’s libraries folder.

To detect the remote


Set up a TSOP sensor like the above schematic…

Load the example code from File -> Examples -> IRremote -> IRrecvDemo then click the “Upload” button.Click the “Serial Monitor” button to bring up a window that will allow us to see the codes being returned to us by the Arduino. Start mashing buttons and you should see a lot of numbers scroll by like in the image below.


The ones that start off with FF and then have numbers or letters are the codes we are after. A FFFFFFFF is a continuation code and the 0 on its own line is a read error.

Happy Hacking 🙂