Arduino returning the same value from an infrared receiver even after the signal

I am trying to receive an infrared signal using an infrared sensor connected to an Arduino UNO. I have tried out multiple remotes and I only experience this problem with 2 out of the 6 remotes.

When I click a button on one of the remotes I get the button code appearing on-screen and if I hold it down I get FFFFFFFFFF to signify a repeated code, then when I let go of the button the codes stop appearing on the screen (this remote works fine).

But when I use a different remote, when I first press the button I get the button code, and if I continue to hold it down instead of getting FFFFFFFFFF I get the button code again. When I release the button the Arduino continues to display the same button code, the TX light on the Arduino continues to flash as if it is still reading the button code from the infrared receiver but the light on the receiver has stopped flashing to show that there is no code being received. The Arduino continues to show this button code and will not show any other button codes until it is reset

I think I have narrowed the problem down to the way the remote transmits the signal. Using a camera (so I can see the IR signal) the working remotes all pulsate and flicker their code very quickly (i can see this because the IR LED flickers in the camera view while the button is down) but the other remotes constantly emit their codes (the IR LED is constantly on while the button is down).

Because of what I am creating, I need to use one of the remotes that are currently not working so if anyone knows how I can fix this problem it would be greatly appreciated.

Here is my code.

#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
  if (irrecv.decode(&results))
    {
     Serial.println(results.value, HEX);
     irrecv.resume(); // Receive the next value
    }

}

The code looks simple enough.
There has been a lot of updating activity on this library recently: IRremote.h and some untested changes have leaked out. The first thing to try is using an older version of the library. In the Arduino IDE, do this from the library manager.

1 Like

Oh, Thankyou SOOOOOO much. This fixed my problem straight away.

Well, I'm pleased that work around was OK for you. If you are a Github user, you could report the issue here so that, hopefully, it gets solved in a future release: GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols

I'll anyway, collect together all the forum posts which I have responded to, concerning the latest release of this IR library, and open a collective issue. I'll wait a few days to see what else emerges, though.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.