IR LED

Hi everybody,

I recently bought an IR LED to control my TV with Arduino. Here is the thing: I tried to send an IR code with the IRremote library but it doesn't work and when I look to the LED through my camera I can't see any light ! I can only turn it on with a simple code for classic LEDs (which means I can't send a specific code) and even when it works the light is so powerless that I must be 2 cm from the receiver...

Any help please ?

Thanks

Maybe you need a 940nm IR led.
You may have damaged the led or it is faulty from the seller.
If you cannot detect any IR, you may not be connecting it properly.

Maybe your sketch is at fault.

Thanks for responding. I can't detect any IR when I use the IRremote library. But when I make digitalWrite(ir_led, HIGH) there is some infrared but they are very powerless as I said...

This is the only code that "works" :

const int ir=5;

void setup() {
  pinMode(ir, OUTPUT);
}

void loop() {
  digitalWrite(ir, HIGH);
  delay(200);
  digitalWrite(ir, LOW);
  delay(1000);
}

For this I connect the long leg of the led with a resistance and the resistance to the digital pin. And the other leg to the GND pin.

What resistance are you using?

You should get at least 20 feet of range out of a transmit IR LED.

I just picked up the first one I saw xD It seems to be a 250 Ohms resistance

At 250 ohms, that gives about 14mA through through the LED.
This should be OK but, IMO, I would finalize the operating current to 40mA in the end device. Use a transistor driver.
250 is not a standard value though.
What are the color bands on it, or better still measure the resistance with an DVM.

.

omaflak:
I just picked up the first one I saw xD It seems to be a 250 Ohms resistance

Hmmm.

Yeah, well ...
250 ohms would be a red-green-brown.

Not common. I've never seen one.

OTOH, brown-green-red - 1k8 - is common.

I haven't really a lot of stuff at my home (to measure the resistance...). But I joined a picture of the resistance.

That's 270 ohms. R Y BN gold

Still about 14mA which should be good for testing.

The only thing I don't understand is why is it "working" with digitalWrite(led_ir, HIGH) and not with the IRremote library ...

Also if someone knows how those ir receiver works it would be great !

I have those with 3 pins and they're working perfectly, but I don't know how these ones works.

When you say it's working one way and not the other, keep in mind the two test are not really related for comparison.

When using it in the remote application you are sending data out and it has to be 100% compatible with the receiver.
As it is not working in remote control, either the IR wavelength is not the same between the TX and RX or the data format/timing between TX and RX is not the same. This would imply software problem.

For now I am not trying to make a remote control, I'm just seeing if I can send and receive IR code. I can receive (the infrared were sent with my remote control and I saw the ir code successfully) but I cannot send datas. That's why I am stuck...

What IR receiver are you using?

Here are some popular ones.
https://arduino-info.wikispaces.com/IR-RemoteControl

If you are using a detector with two pins to receive codes from a TV remote, this is a photo transistor and will not work.

LarryD:
What IR receiver are you using?

Here are some popular ones.
https://arduino-info.wikispaces.com/IR-RemoteControl

I have these one and they're working perfectly. I was just wondering what was the difference between them and those with two pins. My problem is only for emitting IR...

The 3 pin receivers have a built in 38/36/. . . Khz demodulator, the IR transistor does not.

Don't be afraid to put more current thru your LED. I haven't done any measurements but commercial TV remote controls emit with hundreds of mA. Since it's a pulsed current, you can go higher than with DC.

With a typical LED rated at 30 or 40 mA DC max, you should be able to double that value when using a carrier with a 1/3 duty cycle (most common carrier for TV remote control). That'll give you more range. 14 mA is really low.

Since it's a pulsed current, you can go higher than with DC.

ONLY when the data sheet says it is OK.

I haven't done any measurements but commercial TV remote controls emit with hundreds of mA.

Then what is your evidence for this?

you should be able to double that value when using a carrier with a 1/3 duty cycle

Your making it up.

Grumpy_Mike:
It's stated in his link that it does... Without any real datasheet, it's still worth it to try with a reasonably higher current. No LED will blow if your peak pulsed current with a low duty cycle and not too low frequency is a little higher than the DC max current.

Grumpy_Mike:
Then what is your evidence for this?

No evidence, just a comparison of the intensity of the light emitted. It is indeed maybe unwise to give figures like that, my bad, but I'd be really surprised if it was as low as 20 mA... I'm talking about the peak value here, not the average, of course.

Grumpy_Mike:
Your making it up.

I've used some IR LEDs for TV remote control emissions. For example, one was 100 mA DC max and 400 mA with the characteristics of a typical remote control protocol.
It's still worth a try.