IR cloning problems.

I have a Mini DSP that I'm using in my car that I need to make a master volume control for.......

In this particular unit it HAS to be IR(no hard wire on this one),and as I'm using an HDMI fixed level output from the headunit,this is the only way I can have any sort of volume control.
The sofware interface lets me program almost any IR remote control to do volume control and a few other functions.The problem is that I have used numerous different TV etc remotes,they all say that programming was successful,but none of them actually work to alter the volume in either direction.I have been asking this question on the Mini DSP forums for a long time now without any success from the people who make it.The one exception is the remote for my Cambridge Audio soundbase,that both programs AND turns the volume up and down as required.
So using the standard IR libraries supplied with Arduino,I have managed to record what I believe to be the correct information that is transmitted by the CA remote that looks like this......

Volume up..............0x2F5708F

Volume down..........0x2F5C03F

I then transfer the above to an IR send program as below......

//---------Program developed by R.Girish--------//

#include <IRremote.h>

IRsend irsend;

const int button1 = 4;

const int button2 = 5;

const int button3 = 6;

void setup() {

pinMode(button1, INPUT);

pinMode(button2, INPUT);

pinMode(button3, INPUT);

}

void loop()

{

if (digitalRead(button1) == HIGH)

{

delay(50);

irsend.sendNEC(0x2F5708F, 32);

delay(200);

}

if (digitalRead(button2) == HIGH)

{

delay(50);

irsend.sendNEC(0x2F5C03F, 32);

delay(200);

}

if (digitalRead(button3) == HIGH)

{

delay(50);

irsend.sendRC5(0x820, 32);

delay(200);

}

}

//---------Program developed by R.Girish--------//

I use this one because it gives me the push buttons I need for this to work in my car.

I go to learn it to my DSP and it says that both up and down have been learnt successfully,but when I push the buttons again to turn the volume up and down,nothing happens.The IR LED is working ok if I view it through a digital camera.The odd thing is that the CA remote still works both ways when I've learnt it with the Arduino.
I'm I missing something really obvious here and need to give it more information,or should it work as it is?
How critical is the flash rate of the IR LED as it's a LOT faster on the CA remote than it is from the Arduino? I have tried speeding it up by taking the delay down 5ms at a time,but this still hasn't made a difference.

Your sketch is sending NEC and RC5 style remote signals. Are those the style of signal being sent by your CA remote? Use the IRrecvDumpV2 example to find out more about what the CA remote is sending.

Sorry I forgot to say that the CA remote is sending out an NEC signal.I'm not using button 3 so didn't change it from RC5.

Ok this is what I get from IRrecvDump.......

Down.....

#define RAW_DATA_LEN 68
uint16_t rawData[RAW_DATA_LEN]={
9006, 4514, 550, 586, 578, 554, 582, 554,
578, 558, 586, 550, 586, 550, 582, 1686,
582, 554, 578, 1694, 586, 1686, 578, 1690,
558, 1714, 582, 554, 550, 1722, 578, 558,
586, 1682, 582, 1690, 590, 1682, 554, 582,
582, 554, 578, 558, 578, 558, 586, 550,
582, 550, 582, 554, 582, 554, 578, 1694,
586, 1686, 578, 1694, 586, 1686, 582, 1686,
578, 1694, 586, 1000};

Up.....

#define RAW_DATA_LEN 68
uint16_t rawData[RAW_DATA_LEN]={
9002, 4514, 582, 554, 578, 554, 578, 558,
586, 550, 586, 550, 582, 550, 586, 1686,
578, 558, 578, 1690, 586, 1686, 582, 1690,
578, 1690, 554, 582, 582, 1690, 578, 558,
578, 1690, 586, 550, 582, 1690, 578, 1690,
586, 1686, 582, 554, 582, 554, 578, 558,
586, 550, 582, 1686, 582, 554, 582, 554,
590, 546, 586, 1686, 582, 1690, 586, 1686,
582, 1686, 582, 1000};

If I put one of those into RAWsend,type a letter into the serial monitor and hit enter,the IR LED flashes just the once.
If I now go to learn it to my DSP,nothing happens i.e. I get the 'failed to learn' message again.

Any thoughts on this please anyone?

Saturday night bump,I could really do with some help on this please.Over 80 views and no one can answer what must be a VERY basic problem?

Perhaps if you provide ALL of the data produced by IRrecvDumpV2 it would give enough information to suggest a fix.

Down......
Encoding : NEC
Code : 2F5C03F (32 bits)
Timing[67]:
+8950, -4450 + 600, - 550 + 600, - 500 + 600, - 550

  • 600, - 500 + 600, - 550 + 600, - 500 + 600, -1650
  • 600, - 550 + 600, -1650 + 600, -1650 + 600, -1650
  • 600, -1650 + 600, - 500 + 600, -1650 + 600, - 550
  • 600, -1650 + 600, -1650 + 600, -1650 + 600, - 500
  • 600, - 550 + 600, - 500 + 600, - 550 + 600, - 500
  • 600, - 550 + 550, - 550 + 600, - 550 + 550, -1700
  • 600, -1600 + 600, -1650 + 600, -1650 + 650, -1600
  • 600, -1650 + 600
    unsigned int rawData[67] = {8950,4450, 600,550, 600,500, 600,550, 600,500, 600,550, 600,500, 600,1650, 600,550, 600,1650, 600,1650, 600,1650, 600,1650, 600,500, 600,1650, 600,550, 600,1650, 600,1650, 600,1650, 600,500, 600,550, 600,500, 600,550, 600,500, 600,550, 550,550, 600,550, 550,1700, 600,1600, 600,1650, 600,1650, 650,1600, 600,1650, 600}; // NEC 2F5C03F
    unsigned int data = 0x2F5C03F;

Up....
Encoding : NEC
Code : 2F5708F (32 bits)
Timing[67]:
+8950, -4450 + 600, - 500 + 650, - 500 + 600, - 500

  • 600, - 550 + 600, - 500 + 600, - 550 + 600, -1650
  • 600, - 500 + 600, -1650 + 600, -1650 + 600, -1650
  • 600, -1650 + 600, - 550 + 600, -1650 + 600, - 500
  • 600, -1650 + 600, - 550 + 600, -1650 + 550, -1700
  • 600, -1600 + 650, - 500 + 600, - 500 + 600, - 550
  • 600, - 500 + 650, -1600 + 600, - 550 + 600, - 500
  • 600, - 550 + 600, -1650 + 600, -1650 + 600, -1650
  • 600, -1650 + 600
    unsigned int rawData[67] = {8950,4450, 600,500, 650,500, 600,500, 600,550, 600,500, 600,550, 600,1650, 600,500, 600,1650, 600,1650, 600,1650, 600,1650, 600,550, 600,1650, 600,500, 600,1650, 600,550, 600,1650, 550,1700, 600,1600, 650,500, 600,500, 600,550, 600,500, 650,1600, 600,550, 600,500, 600,550, 600,1650, 600,1650, 600,1650, 600,1650, 600}; // NEC 2F5708F
    unsigned int data = 0x2F5708F;

Just buy looking at those packets, I can see discrepencies...

I mean look at the second to last line, second in for example.
In the decode, that bit = -1600uS
In the encode that bit = -550uS...

This must be erroneous?

Johnny010:
Just buy looking at those packets, I can see discrepencies...

I mean look at the second to last line, second in for example.
In the decode, that bit = -1600uS
In the encode that bit = -550uS...

This must be erroneous?

Thanks for the answer,but I don't know how to tell if it's wrong or right? This is the only IR remote that does work with the DSP.

I'm still very much in need of help with this problem.I've answered the questions that have been asked of me,but I still have no response to them.
This happened at the weekend.I did some Googling for NEC raw IR data,and found one for the on/off function of an LG television.I installed it,and as if by magic it not only says it's learnt it,but it also is the only one I've ever found that I can actually adjust the volume of my DSP with.I did this with the raw data,so tried the same with all the buttons on my CA remote,and still they only learn but don't actually do anything.

Here's what I've been using (forget button 3 as I'm not using it yet)........

#include <IRremote.h>

IRsend irsend;

const int button1 = 4;

const int button2 = 5;

const int button3 = 6;

void setup() {

pinMode(button1, INPUT);

pinMode(button2, INPUT);

pinMode(button3, INPUT);

}

void loop() {

if (digitalRead(button1) == HIGH)

{

int khz = 38; // 38kHz carrier frequency for the NEC protocol
unsigned int irSignal[] = {9000, 4500, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560,
1690, 560, 1690, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 39416, 9000, 2210, 560};

irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);

delay(25);
}

if (digitalRead(button2) == HIGH)

{
int khz = 38; // 38kHz carrier frequency for the NEC protocol
unsigned int irSignal[] = {8900,4450, 600,550, 600,500, 600,550, 600,500, 600,550, 600,500, 600,1650, 600,550, 600,1650, 550,1650, 650,1600, 600,1650, 600,550, 600,1650,
600,500, 600,1650, 600,550, 600,500, 600,1650, 600,1650, 600,1650, 600,550, 600,500, 600,550, 600,1650, 600,1650, 600,500, 600,550, 600,500, 600,1650, 600,1650, 600,1650, 600};

irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);

delay(25);

}

if (digitalRead(button3) == HIGH)

{

delay(50);

irsend.sendRC5(0x820, 32);

delay(200);

}

}

Button #1 is the one that learns and works,button #2 is the one that learns but doesn't work.I don't understand enough about what the raw data is doing to be able to figure this out for myself.

You could try the non-raw date:

    // Down...
    // Encoding  : NEC
    // Code      : 2F5708F (32 bits)
    irsend.sendNEC(0x2F5708F, 32);

    // Up...
    // Encoding  : NEC 
    // Code      : 2F5708F (32 bits)
    irsend.sendNEC(0x 2F5708F, 32);

johnwasser:
You could try the non-raw date:

    // Down...

// Encoding  : NEC
    // Code      : 2F5708F (32 bits)
    irsend.sendNEC(0x2F5708F, 32);

// Up...
    // Encoding  : NEC
    // Code      : 2F5708F (32 bits)
    irsend.sendNEC(0x 2F5708F, 32);

Thank you for the answer.I did try it that way to start with,but it still only said the learning was a success but didn't actually work afterwards.
The only one that does learn AND work is the first lot of raw data,the second lot learns but doesn't work.Apart from representing a different hex code (if that's how this works),how is the second lot of raw data different from the first lot?

I still really need help with this please anyone.

I don't really know what I'm looking at with the raw data.I know it represents the mark/space ratio of a square wave burst,but that's about it.I don't understand how significant the different groups of numbers are in respect of what I'm trying to do here.I don't understand and haven't been able to figure out by randomly changing some values why this lot of raw data learns and works........

{9000, 4500, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560,
1690, 560, 1690, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 39416, 9000, 2210, 560}

While this lot of raw data learns but doesn't work......

{9006, 4514, 550, 586, 578, 554, 582, 554, 578, 558, 586, 550, 586, 550, 582, 1686, 582, 554, 578, 1694, 586, 1686, 578, 1690, 558, 1714, 582, 554, 550, 1722, 578, 558, 586, 1682, 582, 1690, 590, 1682, 554, 582, 582, 554, 578, 558, 578, 558, 586, 550, 582, 550, 582, 554, 582, 554, 578, 1694, 586, 1686, 578, 1694, 586, 1686, 582, 1686, 578, 1694, 586, 1000}

What can I change in the working data to make it represent another hex value (if that's what we need to do) so that I use it as the second IR function?