IRRemote library and Due concerns

Hey everyone :slight_smile:

I am currently working on a little home automation project, and chose to use the Due as a platform.

I am using the IRRemote library that was rewritten for Due as described here (Arduino Due libraries (official and 3rd party) - #32 by system - Arduino Due - Arduino Forum)

Now, I have my emitter set up the following way:
Pin 7 goes through a 470 ohm resistor to the base of a 2N3904.
The Collector goes through a 47 ohm resistor and to the cathode of the IR LED. The Anode is fed with +5V from the Arduino (I have tried an external power supply as well).
The emitter is wired straight to common ground.

I have a very simple sketch to test that everything works. All it does is pop up the menu on a Samsung TV...

#include <IRremote2.h>

IRsend irsend;

void setup()
{  
  Serial.begin(9600);
  while (!Serial) { ; }
}

void loop() 
{
  if (Serial.read() != -1) {
    for (int i = 0; i < 3; i++) {
      irsend.sendSamsung(0xE0E058A7, 32);
      delay(100);
    }
  }
}

Here's my conundrum: This setup works a treat on Arduino Uno, wired to pin 3... Absolutely nothing happens on Due, pin7... I realize the Uno outputs 5V, where the Due outputs 3.3V - but since the output does nothing but trigger the transistor, I don't see the voltage difference being the problem as there ought to be enough to saturate the transistor.

My question: Did anyone here, by chance, have something similar running on the Due, or have any input on what I have done wrong?

Thanks in advance :slight_smile:

I spoke to Enternoescape who rewrote the library for Due, and he said that it was tested on 1.5.5 r2 and didn't know if more recent releases could have broken the code.

Welcome to the forums!

If there is doubt about suitability of a particular version of the Arduino software, you can always try an older version, available here :- https://www.arduino.cc/en/Main/OldSoftwareReleases#previous

There were several libraries that 'broke' with 1.5.6 onwards. Many have been rewritten now to handle the changes, but if your IR library is not one of them, then just use an older version of the IDE as a workaround.

Regards,

Graham