[IRremote] Send Command RC5 (Marantz AV) or Raw values

Hey forum-members,

I want to build a volume knob for my stereo and send the signals via IR.
I’ve already decoded the original remote, these are the IR signals I need:

Vup = RC5 16 16 0 – Protocol=RC5 Address=0x10 Command=0x10 Raw-Data=0x3410 (13 bits) MSB first
Vdown = RC5 16 17 1 – Protocol=RC5 Address=0x10 Command=0x11 Raw-Data=0x3411 (13 bits) MSB first
Power = RC5 16 12 0

I used several different codes to receive the codes.

But now I want to send it via IRLED.
I’ve tried several different send methodes, the last one was from Arduino-IRremote:

<IrSender.sendRC5(0x10, 0x11, 2, true)> for Vdown
But nothing happens.
Every try with the same result.

Can you please help me :frowning:

Greetings from Germany

Looking at the source code for the Arduino IRremote library (ir_RC5_RC6.cpp), I see these functions:

void IRsend::sendRC5(uint32_t data, uint8_t nbits) {

void IRsend::sendRC5ext(uint8_t addr, uint8_t cmd, boolean toggle) {

I don't know where your function call fits into those options. Have you tried:

IrSender.sendRC5(0x3410, 13)

Well, I've never done RC5, so I'm just guessing. Does the IR LED flash when viewed on your phone camera? Or if you replace the IR LED with a visible LED, does it flash?

Yes the LED flashes.

I try it.

||Doesn’t work:

#include <IRremote.h>

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
}
void loop() {

Serial.println(F(“Send RC5 with 13 bit address”));
IrSender.sendRC5(0x3410, 13);
delay(2000);
}

tried the receive and send example and it worked, he tells me the same as I posted in the first one:

Protocol=RC5 Address=0x10 Command=0x11 Raw-Data=0x3411 (13 bits) MSB first

and then:

Sent: Protocol=RC5 Address=0x10 Command=0x11 Raw-Data=0x3411 (13 bits) LSB first

And this works.
But the example code works with internal “stored Data”.
No near specification. :frowning:

Can you confirm something is being sent? Can you see the IR LED flash in your phone camera?

Yes I can see the LED blink via smartphone.

Well if you have flashing, then you have the right pin. I don’t have any experience with RC5, so I don’t know what the problem is. I’m particularly uncertain about how the toggle bit works.

Perhaps you could experiment with the sendRC5ext() format.

In your first example at the top:

IrSender.sendRC5(0x10, 0x11, 2, true)

what is the “2”? What about trying:

IrSender.sendRC5ext(0x10, 0x11, true)

Well, we need to find someone with RC5 experience. It’s pretty clear I’m not much help to you.

the 2 is for the repeates.

Okay, but thank you a lot.

The pin is right, and with the example-code of receive and send I can receive the command, and I can send the command.
So it is not impossible.

You might take a look at this post:

particularly the last entry.

And I also found this:

http://lirc.10951.n7.nabble.com/Marantz-RC5-22-bits-Extend-Data-Word-possible-with-lircd-conf-semantic-td9784.html

Do you have an oscilloscope?

Oh perfect, I’ll read it!

I always searched for RC5 in the forum, but never for Marantz hahah.
||Edit:
I think my remote uses the normal RC5 type, because every decoder shows me the RC5 protocol.
Even the example code handles my command as a RC5, and this code works.

So, even the RC5 decoder shows me the Adress 16, Command 16/17/12, 13 Bit and the toggle 0/1 (changes with every button press to distinguish between a long button press and a second new button press.

But no way to send this command :frowning:

So, now I get the Raw data:

Power > +840 -932 +844 -908 +868 -932 +1736 -924 +848 -932 +840 -932 +840 -932 +844 -932 +848 -1804 +848 -932 +1740 -952 +816 -30008

Vup > +848 -900 +872 -904 +848 -920 +1772 -900 +872 -892 +880 -904 +872 -900 +848 -1812 +1764 -892 +856 -920 +880 -920 +856 -30008

Vdown > +868 -904 +872 -900 +880 -900 +1764 -904 +864 -904 +872 -932 +848 -896 +872 -1792 +1732 -952 +844 -900 +872 -1792 +844 -30008

Now I've got two ways to go;

  1. I find a way to send it via RC5 protocol, would be very easy.
  2. I find a way to send the raw data, not so nice but better then nothing.

I think the first step would be to get something that works, no matter how combersome it is.

Here is a site that might have useful information on raw codes:

http://www.remotecentral.com/cgi-bin/codes/

What are the model numbers of your Marantz amp and remote?

Edit: I think IRremote also lets you send Raw.

SR5012 & remote is RC034SR
I've already searched this site.
It feels like I've been through the whole internet haha.

I think, my remote codes are just right.
I just have to know hot to send this.

A code works, it's called "Receive and Send".
This means that the signal is received via a receiver and output via my IR Led by pressing a button.
So I know that it is at least theoretically possible.

Unfortunately, I cannot decode the example code because it writes the code internally in the buffer and sends it again directly from there.

||Edit to your Edit :smiley:

Yes, I know I can send raw via IRsendRawDemo, but I don't know how to get my Raw data right into the code.

What happens to the signs? Do I have to adjust even more? I don't think the IRsendRawDemo is a universal RawSender.
the protocol NEC is very common in this example, so I think you can send NEC Raws, but nothing more, nothing less.
I can't quite understand the raw example.
I've been working on it for half the day.

I assume the signs just mean carrier off, carrier on, for the time indicated. But I don't know for sure.

The Wikipedia entry on RC-5 says the stream is Manchester encoded, whatever that means.

But I think you should be able to capture the raw values by sending them to the serial monitor, then put them into your code as an array. In any case, you should be able to translate the raw values into your command values.

Another concern is whether the raw capture is going on long enough to get any repeats.

Do you have a scope?

Yes, this is my actually knowledge.
But I think sendig raw isn't so easy as it should.

Nop, no scope here :frowning:

I just don’t know why it doesn’t work. All I can suggest is to try repeats zero through 2, with and without toggle.

If you are not committed to IRremote, you can use Infrared4Arduino, available in the library manager as “Infrared”. Here is a slightly silly sketch that does what you want to do. It takes care of toggles automatically.

// This Arduino sketch was automatically generated by IrScrutinizer.

// It supports:
//
// * Infrared4Arduino https://github.com/bengtmartensson/Infrared4Arduino,
//                    http://www.harctoolbox.org/Infrared4Arduino.html

// For problems, bugs, and suggestions, please open an issue at
// https://github.com/bengtmartensson/IrScrutinizer/issues

#include <IrSenderPwm.h>
#include <Rc5Renderer.h>

// Constants
static const long BAUD = 115200UL; // Change if desired

IrSender *irsend = IrSenderPwm::getInstance(true);

// Command #1: MAIN VOLUME UP
// Protocol: rc5, Parameters: D=16U F=16U

// Command #2: MAIN VOLUME DOWN
// Protocol: rc5, Parameters: D=16U F=17U

// Command #3: POWER
// Protocol: rc5, Parameters: D=16U F=12U

static void sendRc5(unsigned D, unsigned F, unsigned times) {
    const IrSignal *irSignal = Rc5Renderer::newIrSignal(D, F);
    irsend->sendIrSignal(*irSignal, times);
    delete irSignal;
}

void setup() {
    Serial.begin(BAUD);
    Serial.setTimeout(60000UL);
}

// A pretty silly main loop; feel free to replace it by something smarter.
void loop() {
    Serial.println(F("Enter number of signal to send (1 .. 3)"));
    long commandno = Serial.parseInt();
    Serial.println(F("Enter number of times to send it"));
    long times = Serial.parseInt();
    switch (commandno) {
    case 1L:
        sendRc5(16U, 16U, times);
        break;
    case 2L:
        sendRc5(16U, 17U, times);
        break;
    case 3L:
        sendRc5(16U, 12U, times);
        break;
    default:
        Serial.println(F("Invalid number entered, try again"));
        break;
    }
}

Wow thank you!
I've got the Infrared4Arduino lib installed allready.
I try it!

Have you ever controlled a Marantz AV or sent RC5 commands?

Wow, thank you!
Worked just fine!! :o