Problems sending IR to Denon M38

Hi,

I have tried to find codes for a CD player (Denon RCD M38) but I haven't been able to find any information (neither lirc nor irdb.tk)

So I have used this code to find the codes

#include <IRremote.h>

// Define sensor pin
const int RECV_PIN = 2;

// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
// Serial Monitor @ 9600 baud
Serial.begin(9600);
// Enable the IR Receiver
irrecv.enableIRIn();
}

void loop(){
if (irrecv.decode(&results)){
Serial.print(results.value, HEX);
Serial.print(" - ");
Serial.println(results.value);

switch (results.decode_type){
case NEC:
Serial.println("NEC");
break;
case SONY:
Serial.println("SONY");
break;
case RC5:
Serial.println("RC5");
break;
case RC6:
Serial.println("RC6");
break;
case DISH:
Serial.println("DISH");
break;
case SHARP:
Serial.println("SHARP");
break;
case JVC:
Serial.println("JVC");
break;
case SANYO:
Serial.println("SANYO");
break;
case MITSUBISHI:
Serial.println("MITSUBISHI");
break;
case SAMSUNG:
Serial.println("SAMSUNG");
break;
case LG:
Serial.println("LG");
break;
case WHYNTER:
Serial.println("WHYNTER");
break;
case AIWA_RC_T501:
Serial.println("AIWA_RC_T501");
break;
case PANASONIC:
Serial.println("PANASONIC");
break;
case DENON:
Serial.println("DENON");
break;
default:
case UNKNOWN:
Serial.println("UNKNOWN");
break;
}
irrecv.resume();
}
}

With this code loaded in an Arduino Genuino, I press the original remote and I get UNKNOWN in the console.
I can read other remotes such as LG TV but for this Denon device is impossible.

Then, I have tried to read raw data with the following code

#define maxLen 800

volatile unsigned int irBuffer[maxLen]; //stores timings - volatile because changed by ISR
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISR

void setup() {
Serial.begin(115200); //change BAUD rate as required
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}

void loop() {
// put your main code here, to run repeatedly:

Serial.println(F("Press the button on the remote now - once only"));
delay(5000); // pause 5 secs
if (x) { //if a signal is captured
digitalWrite(LEDPIN, HIGH);//visual indicator that signal received
Serial.println();
Serial.print(F("Raw: (")); //dump raw header format - for library
Serial.print((x - 1));
Serial.print(F(") "));
detachInterrupt(0);//stop interrupts & capture until finshed here
for (int i = 1; i < x; i++) { //now dump the times
if (!(i & 0x1)) Serial.print(F("+"));
Serial.print(irBuffer - irBuffer[i - 1]);

  • Serial.print(F(", "));*
    _ //Serial.println(irBuffer - irBuffer[i - 1], HEX);_
    * //Serial.print(F(", "));*
    * }*
    * x = 0;*
    * Serial.println();*
    * Serial.println();*
    * digitalWrite(LEDPIN, LOW);//end of visual indicator, for this time*
    * attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal*
    * }*
    }
    void rxIR_Interrupt_Handler() {
    * if (x > maxLen) return; //ignore if irBuffer is already full*
    * irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions*
    }
    [/quote]
    And I get an array that I send with this code:
    > #include <IRremote.h>
    >
    > IRsend irsend;
    >
    > //int irPin = 9; // pin IR led
    >
    > int khz = 38;
    >
    >
    > void setup()
    >
    > {
    > Serial.begin(115200);
    >
    > }
    >
    > void loop() {
    >
    > // Denon
    > unsigned int denon_on[] =
    > {3480, +1592, 500, +336, 500, +312, 500, +1140, 436, +372, 532, +1160, 364, +448, 392, +1276, 360, +424, 496, +336, 388, +1280, 360, +452, 464, +344, 404, +1264, 464, +1184, 432, +376, 464, +372, 500, +336, 412, +372, 464, +368, 504, +312, 500, +1140, 468, +340, 504, +1192, 360, +424, 500, +1196, 392, +392, 504, +332, 360, +448, 396, +1272, 404, +1244, 472, +340, 496, +312, 504, +308, 416, +416, 396, +420, 500, +332, 472, +312, 504, +332, 468, +1204, 360, +448, 504, +1168, 360, +452, 360, +424, 528, +308, 500, +312, 504, +1192, 440, +344, 436, +400, 504, +9232, 3456, +1680, 384, +456, 624, +156, 456, +1244, 412, +404, 408, +1240, 408, +384, 408, +1308, 384, +404, 408, +428, 412, +1260, 388, +424, 388};
    > Serial.println("Sending denon");
    > irsend.sendRaw(denon_on, sizeof(denon_on) / sizeof(unsigned int), khz);
    >
    > delay(1000);
    >
    >
    >
    > }
    But it doesn't work. I don't know why.
    Any ideas?

Any ideas?

Maybe your Denon doesn't use the default 38kHz carrier frequency? What reception hardware did you use? Have you tried a IR photodiode (without the 38kHz filter) and looking at the signal with a scope?

pylon:
Maybe your Denon doesn't use the default 38kHz carrier frequency? What reception hardware did you use? Have you tried a IR photodiode (without the 38kHz filter) and looking at the signal with a scope?

I think frequency could be the problem.

In order to read original remote I use this sensor

And to emit, a normal IR 940nm led.

I don't know how I can analyze signal with a scope and I don't have one :frowning:

I have been able to send IR signal to LG and Samgung TVs but It's impossible to send to this Denon device.

In order to read original remote I use this sensor

That sensor already contains a 38kHz filter.

I don't know how I can analyze signal with a scope and I don't have one

Try to find somebody in your area that has one and knows how to use it.

I have been able to send IR signal to LG and Samgung TVs but It's impossible to send to this Denon device.

That again indicates that your Denon uses another carrier frequency. Get a simple IR photo transistor and someone with a scope to analyze the signal your Denon needs. Or ask Denon to give you the needed details.

Thanks for your answer

pylon:
That sensor already contains a 38kHz filter.

Therefore, I could not read any command by using this sensor if the frequency is not 38 kHz. That must be the reason why the results were not repeatable.

Try to find somebody in your area that has one and knows how to use it.

It's dificult because I should learn how to use it before and how I could apply the results.

That again indicates that your Denon uses another carrier frequency. Get a simple IR photo transistor and someone with a scope to analyze the signal your Denon needs. Or ask Denon to give you the needed details.

I'm going to ask Denon. Let's enjoy its customer support.

I asked Denon information about IR protocol and they kindly send me this document.

It doesn't have any information about frequency so I think I will try to send command by the use of irsend.sendDenon(command, nbits);

But I can't understand the table.

As indicated in the table, the data is LSB (Least Significant Bit), but I don't know how can I send this data with irsend.sendDenon(command, nbits)

I think it should be something like:

Maker Code 4H
Maker Code 5H
Maker Code 2H
Maker Code 3H

  • 0H
    D0 5H
    D1 1H
    D2 3H
    D2 0H
    D2 4H
    DP 1H
    DP 2H

Any ideas?

Buy an IR photo transistor, point the remote to it and push some buttons. Look at the resulting wave using a scope and find out if the signal is modulated onto a 38kHz carrier. If it isn't you have to change the PWM frequency in the IR library. The table Denon sent you only helps if you know the carrier frequency.