# Arduino Uno outputting IR code directly into device (tv, sound bar, etc.)

#### abu1985

Joined Oct 18, 2015
74
I'm trying to get an Arduino Uno to output the IR code to turn on an old sound bar, but without using an IR transmitter/receiver. I've removed the IR receiver from the sound bar board as I'd like to wire the Uno right into the sound bar receiver pads bypassing the remote all together.

Attached is a wiring sketch of what I'm thinking.

Am I out in left field here or can this be done? It didn't work when I tried it, but my oscope shows a signal output from the Arduino pin (uninterpretable signal, but something of a pattern).

Here is the code that would otherwise output to a IR transmitter.
Code:
#include <Arduino.h>
#include <IRremote.h>

// Define switch pin
const int switchPin = 7;

// Define a variable for the button state
int buttonState = 0;

// Create IR Send Object
IRsend irsend;

void setup()
{
// Set Switch pin as Input
pinMode(switchPin, INPUT);
}

void loop() {

// Set button state depending upon switch position

// If button is pressed send power code command
if (buttonState == HIGH) {
irsend.sendRC6(0x150C, 20); // power code
}

// Add a small delay before repeating
delay(200);

}

#### Walter Literowich

Joined Mar 15, 2018
26
nice diagram ......

Joined Apr 16, 2011
425
That will not work.

Arduino library sends signals modulated at 36 KHz. The original receiver chip would have removed the 36KHz modulation, but you have now removed the demodulator.

What you want can be done, but you will need to bit-bang the RC6 bits for yourself.

Domestic IR signals are described well here https://www.sbprojects.net/knowledge/ir/

#### abu1985

Joined Oct 18, 2015
74
Arduino library sends signals modulated at 36 KHz. The original receiver chip would have removed the 36KHz modulation, but you have now removed the demodulator.
Thanks for the link. The receiver does more than just send the light pulses to the MCU. Great info on that page.

What you want can be done, but you will need to bit-bang the RC6 bits for yourself.
The hex number 150C = 1010100001100 in binary. Are you saying I can send that to the sound bar MCU as a word? I don't know how fast the pulses for that word would need to send for the sound bar to recognize it as a command.

I also believe RC6 is 20 bits and 150C is not 20 bits long. So I might have an issue there as well...

Joined Apr 16, 2011
425
RC6 mode 0 is a (leader + 4 bits) header, 8bits control, 8 bits information.

I do not know enough about Arduino library to know what 150C means. Are you even sure that the protocol is RC6?

RC6 mode 0 information is here: https://www.sbprojects.net/knowledge/ir/rc6.php
There are also RC6 mode 6 variations.

Without knowing anything about the original remote handset, I do not know what to suggest.

#### abu1985

Joined Oct 18, 2015
74
RC6 mode 0 is a (leader + 4 bits) header, 8bits control, 8 bits information.

I do not know enough about Arduino library to know what 150C means. Are you even sure that the protocol is RC6?

RC6 mode 0 information is here: https://www.sbprojects.net/knowledge/ir/rc6.php
There are also RC6 mode 6 variations.

Without knowing anything about the original remote handset, I do not know what to suggest.
My fault, I spoke a too soon. I found some more info on the site you linked to, and I looked up bit-bang. and it basically is what it sounds like.

It is RC6 (Philips). There's a sketch that finds IR codes from remotes and serial prints them to the console. Pretty easy. 150C is the hex code the remote power button sends.

Thanks for the direction!

Joined Apr 16, 2011
425
Note that 3-pin receiver chip (the thing you removed) gives a high level output when nothing is happening.
The output of the receiver goes low when 38KHz is being received, with the 38KHz removed.
This looks upside-down compared with the wave-forms shown on the SB projects site.

Joined Apr 16, 2011
425
Oh.... just noticed - might be important
Your sound bar expects 3.3 Volt signal, but Arduino outputs 5 Volt signals. You will need to put a voltage converter circuit (usually 2 resistors) between Arduino and sound bar

Should have spotted that earlier...

#### abu1985

Joined Oct 18, 2015
74
Note that 3-pin receiver chip (the thing you removed) gives a high level output when nothing is happening.
The output of the receiver goes low when 38KHz is being received, with the 38KHz removed.
This looks upside-down compared with the wave-forms shown on the SB projects site.
Yeah.. I was writing some binary in my IDE to output and was thinking - how does the sound bar know when the command has started, because say decimal 6 = 0110, it would just see 011..

#### abu1985

Joined Oct 18, 2015
74
Oh.... just noticed - might be important
Your sound bar expects 3.3 Volt signal, but Arduino outputs 5 Volt signals. You will need to put a voltage converter circuit (usually 2 resistors) between Arduino and sound bar

Should have spotted that earlier...
I also spotted it but actually thought 5v would still work. I can place a voltage divider in there. Uno has a 3.3v pin as well.

#### djsfantasi

Joined Apr 11, 2010
6,709
Why do you want to omit the IR transmitter and receiver?

The easiest approach would simply mount the IR LEDs next to the receiver’s photodiodes. Then you can use the Arduino library without modification.

#### abu1985

Joined Oct 18, 2015
74
Why do you want to omit the IR transmitter and receiver?

The easiest approach would simply mount the IR LEDs next to the receiver’s photodiodes. Then you can use the Arduino library without modification.
I do realize this and this will be plan B, and most likely what will happen lol. I just get in the mood to try something difficult, it's a good way to learn.

Joined Jan 15, 2015
5,608
Got a smart phone? Got a smart TV? There are apps out there which allow you to use your smart phone to connect (control) your TV or whatever. Even a dumb TV using IR apps assuming the smart phone has IR capabilities. That's always amusing.

IR, Bluetooth or WiFi. are all available.

Ron