IR transmission wired


My problem :
I have an arduino with an IR LED receiver that perfectly works with my transmitter, a Logitech Harmony Hub, using IRLib2 library. But due to some environement issues, I had like to use a wire between my Harmony Hub and the Arduino. The Harmony Hub provide a jack 2.5mm mono output to plug an external IR transmitter. Instead of using it with external transmitter, I tried to connect this jack output to the Arduino's pin where my receiving IR LED was connected (data pin). Each time I press a button on my remote, a signal is received by the Arduino, but the code is always UNKNOW. What I'm missing ?

An equivalent simple test case to reproduce :
I tried to write a more simple test to reproduce my problem without the Harmnoy Hub. On my Arduino I have connected a direct wire between pin 2 and 3. And used the following code with IRLib2 :

#include <IRLibAll.h>
IRsend mySender; // Default send on pin 3
IRrecvPCI myReceiver(2); // Listen on pin 2
IRdecode myDecoder;   
void setup() {
   delay(2000); while (!Serial); //delay for Leonardo
   myReceiver.enableIRIn(); // Start the receiver
   Serial.println(F("Ready to receive IR signals"));
void loop() {
   mySender.send(SONY,0xa8bca, 20);
   myReceiver.enableIRIn(); // Re-enable receiver
   if (myReceiver.getResults()) {
      myDecoder.decode();           //Decode it
      myDecoder.dumpResults(true);  //Now print results. Use false for less detail
      myReceiver.enableIRIn();      //Restart receiver

Every 5 seconds I receive an UNKOWN code, so I get the behavior than with the Harmoy Hub. Am I missing an electronic component between pin 2 and 3 ?

Get IRLib2 => GitHub - cyborg5/IRLib2: Library for receiving, decoding, and sending infrared signals using Arduino

To drive an external IR LED the signal from the 2.5mm jack is the modulated IR signal. The IR library expects the signal to be un-modulated (and inverted) like the receiver/decoder (IR LED receiver?) outputs.

Ok understood ! I have found someone who asked for a similar problem I think : arduino micro - How to send unmodulated IR-Signal via cable? - Arduino Stack Exchange

Do you know how to do the demodulation by code ? I'm diving into the IRLib2 source code to find an handle to do this... (I think I have to do a custom receiver class)

Do you know how to do the demodulation by code ?

Sorry, no I do not.

Total idiot proof way of doing it: Put IR transmitter and demodulator next to each other in an enclosed black box. Would work just fine.

// Per.

I think using low pass filter should be enough - you filter the signal and the library will see on the input pin expected signal.