Unreliable reception of IR signals

Hi there...

It seems to be one of the simplest things ever, but for me it just doesn't work reliably... I have removed the IR receiver from a LED strip controller, hooked it up to an Arduino Nano, and uploaded a sample program relying on IRLib that dumps the received data. It works, but sometimes (approx. every 4th-8th signal) the decoded data is invalid - it contains less samples than a valid one.

What I already tried: using another data pin (11 vs 2), another IR receiver, several different remotes (including the one shipped with the LED controller from which the IR receiver was removed, and also another one using Sony protocol instead of NEC), but it's just the same. To rule out optical interference, I also tried it in a darkened room without any IR source (tested with a NIR-sensitive camera). The receiver is connected with a mere 5cm of wire (unshielded though). The LED controller has no reception problems, even if it's placed much farther than my setup.

A correctly received signal looks like:
Decoded Sony(2): Value:2421 (15 bits)
Raw samples(32): Gap:55204

  • Head: m2312 s664*
    *0:m548 s664 1:m1120 s664 2:m576 s632 3:m608 s604 *
    *4:m1120 s664 5:m604 s608 6:m544 s664 7:m548 s664 *
    *8:m548 s660 9:m1124 s664 10:m544 s664 11:m548 s664 *
    12:m576 s632 13:m604 s608 14:m1148
    Extent=22792
    Mark min:544 max:1148
    Space min:604 max:664

A broken one:
Decoded Unknown(0): Value:0 (0 bits)
Raw samples(24): Gap:27636

  • Head: m2344 s636*
    *0:m548 s664 1:m1120 s664 2:m572 s636 3:m552 s660 *
    *4:m1120 s664 5:m572 s636 6:m548 s664 7:m548 s664 *
    8:m548 s660 9:m1124 s660 10:m572
    Extent=17376
    Mark min:548 max:1124
    Space min:636 max:664

For broken signals, the received length varies.

Does anyone have an idea what can be wrong?
TIA!

Why not just ignore invalid signals?

Any wireless method of data transmission is inherently unreliable, and wired connections can be also be unreliable.

Because I intend to create a superior product, not an inferior one. It's frustrating if the device doesn't respond to your commands, isn't it?

And the cheap and primitive Chinese controller has no such problems.

PS: an updated version of the library seems to have improved the reliability, but still not as reliable as the Chinese controller... Maybe the library needs some tweaking...

Most remotes send a single command more than once, to make it more likely that a good copy is received.