Trying to build IR transmitter but either my code is wrong or my circuit

Hello there,

I am trying to build an IR transmitter to control my Sony Minidisc deck. I found a similar project on hackaday (the Sony Minidisc Namer) which provided the Arduino code but I had to reverse engineer the circuit from a photo. I tried to contact the author but so far he has not responded. For the circuit I used a basic LED driver circuit like this one but changed the resistors to match the ones from the project component list. I also substituted the BC547 transistor with a S9014 transistor which has similar characteristics. I uploaded the code to my Arduino Uno, connected the circuit to ground and 3.3V accordingly and the transistor base to pin 9.

But the remote does not work. In fact when I check the IR LED with my phone camera (to make the light visible) it is always on and only flickering when I send a remote command.

Now I noticed that in the code setup the output pin 9 is set to HIGH. If I use a regular LED driver circuit like the on in the link, doesn't it mean the transistor is always switched on? How would I adapt the circuit so that it works with the code?

This is the beginning of the Arduino code:

#include <IRremote.h>
#include "defines.h"

IRsend irsend;

char inputChars[64];
byte charCount = 0;

byte mode = 0; // Capticals = 0, Lowercase = 1, Numbers = 2
byte targetMode = 0;
boolean commandMode = true; // True = control playback | False = name entry mode

int totalCount = 0;
byte blockCount = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);
  pinMode(9, OUTPUT);
  digitalWrite(9, HIGH);
  helpText();
}

Pin 9 in that project is the visible LED indicating transmission. It is not the IR led. the IRRemote library uses pin 3 for that so that is where your remote signal will go out and where you need to connect your transistor. Depending on the characteristics of your IR led, you can drive it directly from an arduino pin through a resistor and you don't need that transistor

Oh man, that is why one should read library documentation :-[ :smiley: . Now everything works. Thank you very much for clearing that up!