Arnov Sharma
Published © GPL3+

DIY Arduino Remote for TV

Made a TV Remote from Arduino nano, Pretty basic but functional

BeginnerFull instructions provided24 minutes25,189

Things used in this project

Hardware components

UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1
Arduino Nano R3
Arduino Nano R3
×1
IR transmitter (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×4
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×4

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

HEX receiving scheme

SCH

Code

IR_Remote.ino

C/C++
#include <IRremote.h>
#include "LowPower.h"

IRsend irsend;

const int b1  = 4;  //on off
const int b2  = 5;  //Vol +
const int b3  = 6;  //vol -
const int b4  = 7;  //HDMI



int timer;
int modeCounter = 0;



void wakeUp() {
  timer = 0;
}

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(b1, INPUT);
  pinMode(b2, INPUT);
  pinMode(b3, INPUT);
  pinMode(b4, INPUT);
}

void loop() {
  attachInterrupt(0, wakeUp, HIGH);
  while (timer < 10000) {
    
    if (digitalRead(b1) == HIGH) {
      timer = 0;
      delay(50);
      irsend.sendNEC(16580863, 32);  //just remove my remote code and add your                                          //remote hex value
    }

    if (digitalRead(b2) == HIGH) {
      timer = 0;
      delay(50);
      irsend.sendNEC(16585453, 32);
    }

    if (digitalRead(b3) == HIGH) {
      timer = 0;
      delay(50);
      irsend.sendNEC(16618093, 32);
    }

    if (digitalRead(b4) == HIGH) {
      timer = 0;
      delay(50);
      irsend.sendNEC(16644103, 32);
    }

   
    delay(1);
    timer = timer + 1;

  }
  LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
}

IRreciever

C/C++
for getting HEX value from existing remote
#include <IRremote.h>

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
  }
}

Credits

Arnov Sharma

Arnov Sharma

267 projects • 273 followers
Just your average MAKER

Comments