Project showcase
TV Remote for Speakers - IR Translator

TV Remote for Speakers - IR Translator © GPL3+

Use your TV's IR remote to control the volume and mute of separate speakers without using the speaker's remote.

  • 1,108 views
  • 0 comments
  • 9 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)
Hy gluegun
Hot glue gun (generic)

About this project

The code allows you to use your TV's IR remote control Vol Up, Vol Down, and Mute buttons to control speakers that come with their own IR remote. It's a pain to keep 2 remotes at hand.

I used hot glue to mount the Nano between the grill and speaker.

The blue led and IR Rcvr face the user, while the IR Led faces backward towards the speakers' IR remote sensor.

Space was tight, and you can see from picture I used creative soldering to place the components. I used a USB cable plugged into a USB port on the TV to power the board, and with one end removed, I soldered the Black (GND) and Red (+5VDC) USB wires directly to the 5V & GND inputs of the Nano.

Code

TV IR remote to Speaker IR remote code translatorArduino
recieve IR codes from TV IR remote control, send code for speaker system
You will first need to gather the IR codes for your TV's remote and your speaker system remote. See "IR Remote" tutorials elsewhere for how to do this. The below is for LG Magic Remote and EDIFIER R1280DB speakers.
#include <IRLibSendBase.h>
#include <IRLibDecodeBase.h> // First include the decode base
#include <IRLib_P01_NEC.h>
#include <IRLibCombo.h>
#include <IRLibRecv.h>
IRdecodeNEC myDecoder; // Now declare an instance of that decoder.
IRsend mySender;       //pin 3 is set aas IR LED transmitter output by IRLibSendBase.h
IRrecv myReceiver(2); //pin number for the receiver

void setup() {
  myReceiver.enableIRIn(); //Start the receiver
  pinMode(4, OUTPUT); //BLUE LED CONNECTED TO PIN 4
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
}

void loop() {
  digitalWrite(4, LOW);
  if (myReceiver.getResults()) {
    if (myDecoder.decode()) {
      switch (myDecoder.value) {
        case 0xFF827D: mySender.send(NEC, 0x8E7906F, 0); //if rcv TV VOL UP, send SPKR VOL UP
          delay(25);
          digitalWrite(4, HIGH); // 1st BLUE LED BLINK
          delay(200);
          digitalWrite(4, LOW);
          delay(25);
          mySender.send(NEC, 0x8E7906F, 0); //resend SPKR VOL UP
          delay(25);
          digitalWrite(4, HIGH); // 2nd BLUE LED BLINK (2 BLINKS FOR VOL UP)
          delay(200);
          digitalWrite(4, LOW);
          break; 

        case 0xFFA25D: mySender.send(NEC, 0x8E730CF, 0); //if rcv TV VOL DOWN, send SPKR VOL DOWN
          delay(25);
          digitalWrite(4, HIGH); // 1 BLUE BLINK FOR VOL DOWN
          delay(200);
          digitalWrite(4, LOW);
          delay(25);
          mySender.send(NEC, 0x8E730CF, 0); //resend SPKR VOL DOWN
          delay(25);
          mySender.send(NEC, 0x8E730CF, 0); //resend SPKR VOL DOWN
          delay(25);
          break; 

        case 0xFF12ED: mySender.send(NEC, 0x8E700FF, 0); //if rcv TV MUTE, send SPKR MUTE
          delay(25);
          digitalWrite(4, HIGH); // LONG BLUE BLINK FOR MUTE ACKNOWLEDGED
          delay(800);
          break;
      }
    }

    delay(200);
    digitalWrite(4, LOW);
    myReceiver.enableIRIn(); //Re-enable rcvr after sending
  }
}
TV IR Remote translatorArduino
#include <IRLibSendBase.h>
#include <IRLibDecodeBase.h> // First include the decode base
#include <IRLib_P01_NEC.h>
#include <IRLibCombo.h>
#include <IRLibRecv.h>
IRdecodeNEC myDecoder; // Now declare an instance of that decoder.
IRsend mySender;       // Pin 3 set as IR LED by IRLibSendBase.h
IRrecv myReceiver(2); // Pin 2 is IR receiver

void setup() {
  myReceiver.enableIRIn(); //Start the receiver
  pinMode(4, OUTPUT); // Pin 4 is BLUE LED for visual confirmation of "IR command sent"
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
}

void loop() {
  digitalWrite(4, LOW);
  if (myReceiver.getResults()) {
    if (myDecoder.decode()) {
      switch (myDecoder.value) {
        case 0xFF827D: mySender.send(NEC, 0x8E7906F, 0); //if rcv TV VOL UP, send SPKR VOL UP
          delay(25);
          digitalWrite(4, HIGH); // 1st BLUE LED BLINK
          delay(200);
          digitalWrite(4, LOW);
          delay(25);
          mySender.send(NEC, 0x8E7906F, 0); //resend SPKR VOL UP
          delay(25);
          digitalWrite(4, HIGH); // 2nd BLUE LED BLINK (2 BLINKS FOR VOL UP)
          delay(200);
          digitalWrite(4, LOW);
          break; 

        case 0xFFA25D: mySender.send(NEC, 0x8E730CF, 0); //if rcv TV VOL DOWN, send SPKR VOL DOWN
          delay(25);
          digitalWrite(4, HIGH); // SINGLE BLUE BLINK FOR VOL DOWN
          delay(200);
          digitalWrite(4, LOW);
          delay(25);
          mySender.send(NEC, 0x8E730CF, 0); //resend SPKR VOL DOWN
          delay(25);
          mySender.send(NEC, 0x8E730CF, 0); //resend SPKR VOL DOWN
          delay(25);
          break; 

        case 0xFF12ED: mySender.send(NEC, 0x8E700FF, 0); //if rcv TV MUTE, send SPKR MUTE
          delay(25);
          digitalWrite(4, HIGH); // LONG BLUE BLINK FOR MUTE ACKNOWLEDGED
          delay(800);
          break;
      }
    }

    delay(200);
    digitalWrite(4, LOW);
    myReceiver.enableIRIn(); //Re-enable rcvr after sending
  }
}

Schematics

IR translator schematic

Comments

Similar projects you might like

Nano IR Remote for DC Motors

Project showcase by Boaz Lawnce

  • 1,802 views
  • 2 comments
  • 4 respects

IR Remote Controlled Power Switch for Rapsberry Pi 3

Project tutorial by Vilém Kužel

  • 1,270 views
  • 1 comment
  • 7 respects

Control TV Using A Touch Remote

Project tutorial by the lonely programmer

  • 587 views
  • 2 comments
  • 8 respects

Developing an IR Remote and Software Controller

Project tutorial by Steve

  • 18,352 views
  • 0 comments
  • 38 respects

IR Remote Controlled Home Automation

Project tutorial by suhail jr

  • 10,116 views
  • 5 comments
  • 15 respects
Add projectSign up / Login