IR receive problem - unknown random codes

I have problem with Infrared Receiver Module VS1838B. To handle it i use IRremote lib. I connect it to Arduino successfull. With example program from IRemote, codes from remote controller shows up in Serial monitor, but... almost every time when i push the same button, codes are different. For example, below are codes received from remote controller, compatible with NEC protocol. I press all the time the same button.
From serial moniotor:

0xFFFFFFFF
0xCC0472F2
0xEB08FCD1
0x920B2F15
0xFFA25D
0xF68369C0
0x6AD683BE
0xB77063E3
0xFFA25D
0x300A3DFC
0xF572FB9B
0xFFA25D
0x822BB6CC
0xC3494FE
0xFFFFFFFF
0xFFA25D
0xE46323BF
0xFFA25D
0xFFFFFFFF
0xFFA25D
0xFFA25D
0xFFFFFFFF
0xFFA25D
0xFFA25D
0xFFA25D
0xFFFFFFFF
0xFFA25D
0xFF
0xFFA25D
0x675E5312
0xFFFFFFFF
0xFFA25D
0xFFA25D
0xE318261B
0xFFFFFFFF
0xFFA25D
0xFFA25D
0xFFFFFFFF
0xFFA25D
0xFFFFFFFF
0xFFA25D
0xFFFFFFFF
0xFFA25D
0xFFA25D
0xE318261A
0xDCC262AB
0xDE912C3A
0xFFFFFFFF
0x6A9A5C6D
0xFFFFFFFF
0xD5482102
0x261CB2C8
0x55FA3E70
0xA2B842E9
0x5F4246BF
0xFFA25D
0xFFA25D
0xFFFFFFFF
0x193715BE
0xFFFFFFFF
0xDB64D040
0xFFFFFFFF
0xFFA25D
0xCC805BC

From this list i can assume, that the right button code is 0xFFA25D - repeated. From NEC protocol, i know that code 0xFFFFFFFF mean the button is held down. What is the meaning of the other codes shown above? Where they came from? The same situation is with any remote controller. THX for help.

In my opinion, these 'cheap' receivers (@36 cents) can cause lots of problems & I would suggest using IR receivers from Vishay (no connection).

However, it should still work for a standard NEC type signal.

Can you post the model of the device (TV, Aircon), how you have wired the IRreceiver to the Arduino & the actual code you used.

How do you know its an NEC signal?

Have you tried to test with any other remote control. Are the batteries good?

I use this kit Arduino Zestaw IR: pilot, nadajnik, odbiornik, FV - 3737376504 - oficjalne archiwum Allegro
To get it to work i use this tutorial http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html
To test it i use programs from GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols examples folder
IRemote says that this is NEC.
I tested it with other remotes - Panasonic TV, Panasonic radio, Ariva tuner. Results always the same - some of the codes are unknown.
I think you have right. The problem causing very cheap, low quality IR receiver.
Is this will be good? Odbiornik podczerwieni TSOP31236 36KHz - 2604864891 - oficjalne archiwum Allegro
THX for reply.

TSOP31236 id not good, because it has the wrong modulation frequency for the remote you are using.

Instead, go for TSOP31238, which is available on the same site and is designed for 38kHz.

Make sure you check the data sheet for pinout as it is often different between devices, even from the same manufacturer.

hello AnalysIR, you seem quite the go-to-guy for InfraRed codes.

awhile back i posted a thread;
http://forum.arduino.cc/index.php?topic=215277.msg1575375#msg1575375
which was related to IR remote codes being read manually (adafruit tutorial)

my problem was program memory size but how i got there was because using the Shiriff library left me with somewhat unresolved issues - i was getting (some of) those strange codes as well.

here's a copy of the relevant part of that thread i started;

======START COPY=======
i did already try the shiriff IRremote-library but was getting inconsistent feedback, which is why i ended up trying the Adafruit way, a bit more complex but a lot more learned in the process !

for what it's worth, with the shiriff Library "IRrecvDemo" i got extraneous data like;

FD8877
FFFFFFFF
FFFFFFFF
FFFFFFFF
6F5974BD
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
6F5974BD
FFFFFFFF

and

DEE522C1
FFFFFFFF
DEE522C1
FD08F7
DEE522C1
FD08F7
FFFFFFFF
FD
FFFFFFFF
FD
FFFFFFFF

the HEX codes in Blue being the relevant ones.
could that indicate faulty hardware ?

======END COPY=======

am i right in guessing that the hardware is possibly faulty in that case ?
it's using the DFRobot IR receiver module which has no chip-specs so i can't really tell what it is !

on a theroretical aside; is it possible to read IR signals (from an IR-LED) via an IR photodiode ?
one would connect that to an Arduino INPUT pin, and then just digitalRead LOW or HIGH, right ?

Common problems are:

  • wiring / circuit / buggy 'C' code
  • cheap IR receiver
  • batteries in remote control
  • not close enough to receiver (or too close)

Never buy electronic components if you cannot get a data sheet for it. I am pretty sure there is a reason sellers do not provide the model number of a component.

Regarding using a photo sensor to receive an IR signal: Yes its possible, but is likely to be a lower quality receiver than the one you already have. It will suffer from lots of inteference from ambient light and more. It is much cheaper just to buy a quality IR receiver.

Regarding the signals you are getting

FD08F7
DEE522C1
FD08F7
FFFFFFFF

The valid signals will be the ones with the last 2 hex bytes inverted.

so '08' is the inverse of 'F7' above

You could use that trick to only recognise signals which pass this error check (or ignore ones that don't).
In your case the FD is an ID code and should be the first HEX byte of every valid signal. If you check that the last 2 HEX bytes are inverted, you have a way of ensuring you only detect valid signals - even with this receiver.

Also the FFFFFFFF is just a repeat signal for the NEC protocol, if you keep a key pressed the code is sent once and then the repeat code is sent until you release the key..

AnalysIR:
Common problems are:

  • wiring / circuit / buggy 'C' code
  • cheap IR receiver
  • batteries in remote control
  • not close enough to receiver (or too close)

Never buy electronic components if you cannot get a data sheet for it. I am pretty sure there is a reason sellers do not provide the model number of a component.

Regarding using a photo sensor to receive an IR signal: Yes its possible, but is likely to be a lower quality receiver than the one you already have. It will suffer from lots of inteference from ambient light and more. It is much cheaper just to buy a quality IR receiver.

ahh i see, okay - it's just for academic purposes, and if for a simple digital switch, then it should suffice for that purpose.

AnalysIR:
Regarding the signals you are getting

FD08F7

DEE522C1
FD08F7
FFFFFFFF




The valid signals will be the ones with the last 2 hex bytes inverted.

so '08' is the inverse of 'F7' above

You could use that trick to only recognise signals which pass this error check (or ignore ones that don't).
In your case the FD is an ID code and should be the first HEX byte of every valid signal. If you check that the last 2 HEX bytes are inverted, you have a way of ensuring you only detect valid signals - even with this receiver.

wow, great tips !!
thanks so much !

AnalysIR:
Also the FFFFFFFF is just a repeat signal for the NEC protocol, if you keep a key pressed the code is sent once and then the repeat code is sent until you release the key..

ahh, it's possible the transmitter (on a remote control) is faulty, even if i press a key just briefly, i'm getting the 'FFFFFFFF' codes - loose button, or 'debouncing' ?

ahh, it's possible the transmitter (on a remote control) is faulty, even if i press a key just briefly, i'm getting the 'FFFFFFFF' codes - loose button, or 'debouncing' ?

No - that is normal, even with a short press you can get the FFFFFFFF repeat codes.

In most cases just ignore the FFFFFFFF codes in this NEC protocol, unless using VOL+/VOL- or brightness in the case of lights.

AnalysIR:

ahh, it's possible the transmitter (on a remote control) is faulty, even if i press a key just briefly, i'm getting the 'FFFFFFFF' codes - loose button, or 'debouncing' ?

No - that is normal, even with a short press you can get the FFFFFFFF repeat codes.

ok, good to know ! :slight_smile:

AnalysIR:
In most cases just ignore the FFFFFFFF codes in this NEC protocol, unless using VOL+/VOL- or brightness in the case of lights.

or, if one wants to make a robot move while the button is still pressed. :smiley:

It's a very old post but I had facing the same problem this week and after one day, I have realized that the problem comes from the poor quality of the remote control, so I have change to my Sony TV remote control and the problem was fixed, I have writen a post on my facebook page regarding this : Arduino 4 fun (http://www.arduino4fun.com)

Domi

Hi

I know it's an old topic but it helps me a lot to have some ideas about what can goes wrong. I have a similar problem and it's partially due to cheap hardware but I noticed that the problem occurs mostly when I'm not pointing the IR remote directly toward the receiver. It's somehow related to another answer about the distance of the remote and the receiver, but remember that the direction is very important due to using cheap hardware. When I use my LG TV remote, it almost always prints the same code even if I point to other directions.

Regards
Ehsan

I am also using 1838 IR receiver that comes with 37 in 1 Kit. It seems cheap Chinese version. Using IRremote library I was also getting inconsistency of data for the same button. However after using RILib2 library I am able receive consistent data.

Below is the link for RILib2