Sending IR code with no base frequency

Hi,

I am searching around for a code that i can use to send a specific signal.

Hex: 0x62
8bit, 1start bit and 1 end bit,
520microsec lenght,
max 5,208ms

can anyone point me in the right direction?

It's been a while since i did any coding so i am very rusty.

Please cite sources so we can give this a decent try. 1 bit period of a 19200 baud transmission is about 52us.,are you sure you didn't slip a digit? Where do these figures come from? Maximum what? What do you mean, no base frequency?

My problem is that this is all the info i got and can give, sadly...

We have been able to copy and replicate the signal but our output seems to be a lot slower than the original sender.

The producer of the equipment then gave us the stats mentioned in the first.

I am unsure of what i need to ask.

Just went through the readout of the code at 9600baud:

44, 66,	
	34, 72,
	38, 68,
	42, 66,
	30, 78,
	40, 66,
	42, 64,
	36, 72,
	40, 66,
	34, 72,
	42, 68,
	30, 74,
	38, 70,
	38, 70,
	28, 78,
	42, 68,
	34, 72,
	32, 72,
	40, 70,
	36, 72,
	36, 70,
	30, 76,
	36, 72,
	30, 76,
	30, 76,
	40, 68,
	30, 76,
	36, 74,
	32, 74,
	32, 0};

I believe that I could just take the first 5 lines:

44, 66,	
	34, 72,
	38, 68,
	42, 66,
	30, 78};

and it actually sums up close to the 520microseconds lenght.

I am not hands on in this project, I am currently trying to guide my boss on another who is in another country atm.

Just went through the readout of the code

What code?

Currently the copy and replay of the signal works but the receiving side reacts very slow compared to the original equipment.

As aarg said the baud rate is 19200.

So it would be like this:
Baud rate: 19200
8bit signal with 1 start bit and 1 stop bit, with 0x62 Hex.
Meaning we will send a bit stream of 1 0110 0010 1 to trigger the device.

Problem now is to figure out why the equipment reacts so slowly to the copied IR signal compared to the original sender. By watching the IR LED through a camera we can see that the IR is sending and that the receiver reacts after about 1 second after it received the signal. While the original sender does not have any visible delay.

What could be the reason for this delay on the copied signal?

What could be the reason for this delay on the copied signal?

See reply #4

Thinkerion:
What could be the reason for this delay on the copied signal?

Code would be helpful.

For this delay: my best guess would be it's some kind of timeout, with the device waiting for further communication, that not arriving, and after a while the device just using whatever it got and act on that.

So you'd have to look for what exactly the original transmission is. There may be a stop sequence following your signal, telling the device the command is complete.

I have tried adjusting the signal to se if i could get better results.

// This program allows an Arduino to power on/off a Duraflame heater using infrared
//
// Usage: hook up an IR led with Annode on pin 13.  Then send serial data "POWER"
// to the arduino.  It should flash the LED code.
//
// By Rick Osgood with code borrowed from adafruit.com
//

#define IRledPin 13
#define NumIRsignals 14

const int buttonPin = 6;
//boolean toggle = false;
int buttonState = 0; 

     
// This is the code I determined works for my Duraflame heater
int IRsignal[] = {
// ON, OFF (in 10's of microseconds)
 0,  74,
 31, 70,
 31, 70,
 31, 70,
 31, 70,
 31, 70,
 31, 0};


void setup(void) {
  digitalWrite(IRledPin, LOW);   //Make sure LED starts "off"
  Serial.begin(9600);            //Initialize Serial port
  pinMode(buttonPin, INPUT);
}

void loop() {
  char data[6];
  int index = 0;

//delay(10);  //Serial input seems to need some kind of short delay or the data gets screwed up.

  buttonState = digitalRead(buttonPin);

//  while (Serial.available() > 0) {            //Loop if there data on the serial line
//    if (index < 5) {                          //Make sure we don't overflow
//      data[index] = Serial.read();            //Load a character into the string
//      index++;                                //Increment the index to get the next character
//    }
//  }
//  
  data[5]='\0';  //Null terminate the string
  
  if (buttonState == HIGH){                //If the Arduino receives the POWER signal...
  
    for (int i = 0; i < NumIRsignals; i+=2) {         //Loop through all of the IR timings
      pulseIR(IRsignal[i]*10);              //Flash IR LED at 38khz for the right amount of time
      delayMicroseconds(IRsignal[i+1]*10);  //Then turn it off for the right amount of time
    }
  }                                         //Otherwise do nothing!
}

// This function allows us to PWM the IR LED at about 38khz for the sensor
// Borrowed from Adafruit!
void pulseIR(long microsecs) {
  // we'll count down from the number of microseconds we are told to wait
 
  cli();  // this turns off any background interrupts
 
  while (microsecs > 0) {
    // 38 kHz is about 13 microseconds high and 13 microseconds low
//    toggle = !toggle;
//  digitalWrite(IRledPin,toggle);

   digitalWrite(IRledPin, HIGH);  // this takes about 3 microseconds to happen
   delayMicroseconds(9);         // hang out for 10 microseconds, you can also change this to 9 if its not working
   digitalWrite(IRledPin, LOW);   // this also takes about 3 microseconds
   delayMicroseconds(9);         // hang out for 10 microseconds, you can also change this to 9 if its not working
 
   // so 26 microseconds altogether
   microsecs -= 26;
  }
 
  sei();  // this turns them back on
}

You're possibly missing a pinMode statement for the IR led. Intentionally?

According to the comments, the code in reply #8 uses a 38 kHz "base frequency" and is not consistent with the post title.