A little doubt about the signal I'm receiving

Everything related to protocols and IR codes
Post Reply
mruttmann
Posts: 5
Joined: Tue Mar 20, 2018 2:07 pm

A little doubt about the signal I'm receiving

Post by mruttmann »

Hello!

I'm doing some tests with the sketch provided on the following post: https://www.analysir.com/blog/2014/03/1 ... s-arduino/

I have two signals that I received and stored:

Springer AC ON signal:

Code: Select all

{9032, -4476, 580, -572, 556, -600, 556, -576, 576, -1648, 560, -1648, 580, -572, 556, -600, 556, -596, 556, -576, 576, -576, 556, -600, 552, -1648, 556, -600, 556, -600, 556, -572, 552, -600, 556, -600, 556, -596, 556, -1648, 556, -600, 556, -572, 580, -576, 556, -596, 556, -576, 580, -572, 576, -576, 560, -596, 556, -572, 580, -1648, 560, -572, 580, -1648, 556, -1672, 560, -572, 580, -572, 556, -600, 556, -596, 556, -576, 552, -600, 556, -576, 576, -576, 580, -572, 556, -1652, 580, -572, 552, -604, 552, -1652, 580, -1648, 556, -596, 556, -576, 576, -10100, 8980, -4504, 556, -1672, 560, -572, 580, -576, 552, -600, 556, -576, 576, -576, 552, -1652, 580, -576, 576, -1648, 560, -1648, 580, -1648, 556, -596, 560, -572, 580, -1648, 556, -600, 556, -576, 576, -576, 552, -600, 556, -576, 576, -1648, 556, -600, 556, -576, 576, -576, 556, -600, 552, -600, 556, -572, 556, -600, 556, -596, 556, -576, 552, -600, 556, -596, 556, -576, 580, -572, 556, -600, 556, -576, 576, -1648, 556, -1648, 584, -572, 552, -604, 552, -600, 556, -576, 576, -576, 552, -600, 556, -576, 580, -572, 552, -604, 552, -580, 576, -572, 556}
PHILIPS television ON/OFF signal:

Code: Select all

{2628, -912, 416, -912, 420, -496, 392, -496, 392, -900, 860, -504, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 392, -496, 836, -496, 392, -912, 420, -496, 392, -17524, 2632, -908, 416, -916, 416, -496, 392, -500, 388, -900, 864, -500, 392, -476, 412, -472, 416, -472, 416, -472, 416, -472, 416, -472, 416, -472, 416, -472, 416, -496, 392, -496, 392, -496, 836, -496, 416, -892, 440, -472, 412}
Just looking to these signals, is possible to realize if there's something wrong with my receptor?

I'm not sure, I've written the following sketch to send these signals and it's not working:

Code: Select all

#include <IRremote.h>

//Ommited the IR arrays.

IRsend irsend;

char PIN_BUTTON = 51;

void sendRAW_Flash(const unsigned int * signalArray, unsigned int signalLength, unsigned char carrierFreq) {
  irsend.enableIROut(carrierFreq);

  for(unsigned int i = 0; i < signalLength; i++) {
    if (i & 1) {
      irsend.space(pgm_read_word_near(&signalArray[i]));
    } else {
      irsend.mark(pgm_read_word_near(&signalArray[i]));
    }  
  }
  irsend.space(1);
}

void setup() {
  Serial.begin(115200);
  pinMode(PIN_BUTTON, INPUT);
}

void loop() {
  unsigned int botao1 = digitalRead(PIN_BUTTON);
  if (botao1) {
      Serial.println("Starting IR transmission");
      sendRAW_Flash(AC_irSignal1, sizeof(AC_irSignal1), 38);
      delay(5000);
  }
}
I did read a lot of topics here about the right circuits to get a better range for the IR emitter. I'll make this new circuit and try to test transmission again, but would be nice to know if I'm doing the right things so far.

Thanks! ;)
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: A little doubt about the signal I'm receiving

Post by AnalysIR »

Both signals look OK.

Make sure you change the arrays so that the '-' (minus signs) are removed.

Code: Select all

{9032, 4476, 580, 572, 556, 600, 556, 576, 576, 1 ....etc}
If that is not the issue, post the complete sketch, in lcuding the array defs
mruttmann
Posts: 5
Joined: Tue Mar 20, 2018 2:07 pm

Re: A little doubt about the signal I'm receiving

Post by mruttmann »

Hmm, I didn't pay attention to that. The negative signals must be removed from the array, right?

The arrays definitions are the same as on your preview sketches. I'm saving them on the Flash memory (I'm using MEGA 2560). I just added some Serial writes to debug and a routine to send the IR command when I press a push button.

Other interesting thing that I found was the data sheet of my IR receiver: http://www.everlight.com/file/ProductFile/IRM-3640T.pdf

At the page 2, an application circuit is presented. I bought an Arduino module that only have this receiver, whithout other components. Should I have to make this circuit? I see an capacitor and, from my small electronics knowledge, I guess that capacitor are used to filter some undesired noises...

Thanks a lot for your response!
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: A little doubt about the signal I'm receiving

Post by AnalysIR »

Corrrect, so I presume it is working for you now.

Be sure you are using the correct IR send pin on the Mega2560 (the default pins are available in the IRremote readme on Github).


Usually it is OK to leave out the RC circuit for the IR receiver, unless you have a 'noisy' system/environment/power supply/inteference. However, I am not familiar with your particular Receiver & use Vishay IR receivers by preference.

(Check out our webshop for the IR receivers/IR components we have tested & recommend)
mruttmann
Posts: 5
Joined: Tue Mar 20, 2018 2:07 pm

Re: A little doubt about the signal I'm receiving

Post by mruttmann »

The only problem was the negative values.

Now I could turn the TV and the AC.

Thanks a lot for your help!

I'm doing my final project in order to get my bachelor grade. You will be on my thanks session! :D

Thanks again! ;)
Post Reply