IR LED without resistor nano

I am trying to send IR signals using an arduino nano. I have got it all working, it sends signals fine, the device picks up the signals fine, my only issue is range.
I had calculated the resistor I needed through a calculator site for it and everything works great, just the range is the issue. When I removed the resistor from the circuit the range is much better but I'm worried about having that as a permament solution as everywhere tells me I need to use one but then I looked at some of the outputs of the nano and checked against the LED and found that the nano doesn't even produce the ma's of the max ma on the LED. So I was hoping someone could confirm if I can use the LED without a resistor. Im using a nano, it also has a radio reciever module on it too and an IR LED with the following stats:

  • Forward Current: 50 mA
  • Forward Voltage: 1.2V
  • Max Forward Voltage: 1.6V
    I was hoping that the fact the duration of the LED being on would be milliseconds occasionally might be ok enough to run without a resistor too. Could someone please let me know on their thoughts of this or if there are any better LEDs to use for this with better range.
    Thanks

When I removed the resistor from the circuit the range is much better but I'm worried about having that as a permament solution

You are taking a risk. I wouldn't go "into production" with a design like that, but it's up to you if you don't mind the risk of frying your Arduino (or the risk of an otherwise possibly unreliable design).

You are exceeding the current rating of the Arudino, and probably the current rating of the LED too.

You can drive the LED with a transistor or MOSFET, but you should calculate your resistor value to stay under the 50mA rating for the LED.

markyj:
the nano doesn't even produce the ma's of the max ma on the LED.

If the led consumes more power than the nano can produce, you will burn up the nano while getting unacceptable performance from the led.
The resistor is there to limit the amount of current the led can use, normally to prevent damage to the led. You need to power the led from a different supply, and use a small transistor controlled by the nano to operate it. You could also use a mosfet. Either way, you need a different power supply for that led.

Im not sure I quite understand how it is i risk frying either if the led is rated 50ma but the ardiuno only provides 40ma. Does that not mean that only a max of 40ma will be going through the led? And a resistor would lower that 40ma even more? Please explain what I have wrong here, honestly my electronic knowledge is very bad as im better as a coder than electrician.
I am very much thinking about just going with it as its only a personal project and if anything does fry the parts to replace are cheap enough but i will then need to rethink my plan. Im kinda one those kinda people that plugs stuff in and hopes it doesnt blow up and if it does, dont do that again. Also the arduino will just be powered via standard usb cable too, nothing fancy. Plan b is to add the resistor and wire up multiple irs close to the devices like christmas lights that way it will definately work and be safe too.

There is nothing limiting the output current of an Arduino pin. If the user does not take steps to limit the current to 20mA continuous, and limits the time when 40mA is drawn, there is risk of blowing the pin. It's that simple.

The pin on the Arduino can put out X amount of current. You are trying to TAKE X+X from it. The arduino essentially sees it as a short circuit.

What do you suppose would happen if you try to power your whole house with a cellphone battery? The answer isn't "nothing". Yes, nothing in the house would operate, but the battery would essentially be short circuited and probably blow up.

Your devices cannot exceed the current output of the supply, plain and simple

markyj:
Im not sure I quite understand how it is i risk frying either if the led is rated 50ma but the ardiuno only provides 40ma.

You misunderstand. Nothing limits the current out of the Arduino pin. That is the purpose of the resistor. Without the resistor the Arduino will provide whatever current you ask it to. You could try to draw ten amps through it. But anything more than 40mA will burn it up. Your LED wants to draw 50mA. So you're risking burning up the pin on the Arduino. Arduino is going to try to deliver 50mA and in the process will burn itself up.

We don't suggest the resistors because we are in the resistor business. You really do need it. Lots of really smart electronics folks around here. We're not bullshitting you. You really do need that resistor.

You need a resistor, period.
You need a transistor to switch the IRLED when giving it a better power source. You'd see some improvement powering the IRLED with the 5V pin's 200mA with an output pin controlling the transistor.
You'd see the best range giving that IRLED 800-1000mA with a proper power supply and if you keep your signals at <1% duty cycle. Read the datasheet.

So, the led takes 50ma regardless, the arduino is only safely capable of providing 40ma and the resistor ensures that only 40ma is given to the led? Is that correct?
If so, using another pin on the nano could i provide an extra 10ma to the led safely too? Also, that said should i be calculating the resistor value at 40ma and not 50ma? As that is the value i calculated the resistor at, but i think after this new info i may have calculated wrong too.
Also, im not saying i dont believe anyones answers im just trying to wrap it around my head and asking about other possibilities i won't be using a second power supply so either i will just have to deal with low range or try alternative setups maybe the transistor idea if i can somehow split the power between 2 pins to provide the max power to the led.

Measure the current through the LED (voltage dropped over current limiting resistor). You may find the current is less than you think and safe current (through lesser resistor) may be enough.
You could use transistor to power the LED (Google using transistor as a switch).
Internal resistance of pins is around 50 ohm: it is safe to power a LED directly when Arduino is powered from low voltage (3.3 V) or LEDs with high forward drop (blue or white). But not IrLED from 5V.
If you don't have/want to use transistor you may connect more pins together to provide more current. When calculating current you need to take internal resistance of pins into account.

Something like this?
LED-Drive2.png
A 2N2222 might be better, it can do 800 mA.

markyj:
So, the led takes 50ma regardless, the arduino is only safely capable of providing 40ma and the resistor ensures that only 40ma is given to the led? Is that correct?
If so, using another pin on the nano could i provide an extra 10ma to the led safely too? Also, that said should i be calculating the resistor value at 40ma and not 50ma? As that is the value i calculated the resistor at, but i think after this new info i may have calculated wrong too.
Also, im not saying i dont believe anyones answers im just trying to wrap it around my head and asking about other possibilities i won't be using a second power supply so either i will just have to deal with low range or try alternative setups maybe the transistor idea if i can somehow split the power between 2 pins to provide the max power to the led.

I'm glad you're not one of those professed newbies that refuse to listen to wise advice even though it really seems that way.
How will you be powering the Arduino? Battery? USB? Wall plug?
As I said in my post you didn't read, you can use the 5V pin of the Arduino as your higher current source.
And as I said in my post that you didn't read, the IRLED handles current up to 1000mA depending on duty cycle. Had you read my post, you wouldn't come out saying that the IRLED 'takes 50mA regardless'.
And as others have tried to spell out for you, Arduino pins should only have 40mA pulled from them max, and it is your job to limit what is pulled, THERE IS NOTHING ON THE ARDUINO SIDE THAT ENFORCES THE 40mA LIMIT. Get that through your head.
No resistor is the same as connecting both ends of a battery to each other. While the battery has a listed max draw, shorting it out because you're fiercely dense means the battery will draw until it destroys itself. Nothing enforces the listed max, that's your job.

markyj:
I am trying to send IR signals using an arduino nano. I have got it all working, it sends signals fine, the device picks up the signals fine, my only issue is range.
I had calculated the resistor I needed through a calculator site for it and everything works great, just the range is the issue. When I removed the resistor from the circuit the range is much better but I'm worried about having that as a permament solution as everywhere tells me I need to use one but then I looked at some of the outputs of the nano and checked against the LED and found that the nano doesn't even produce the ma's of the max ma on the LED. So I was hoping someone could confirm if I can use the LED without a resistor. Im using a nano, it also has a radio reciever module on it too and an IR LED with the following stats:

  • Forward Current: 50 mA
  • Forward Voltage: 1.2V
  • Max Forward Voltage: 1.6V
    I was hoping that the fact the duration of the LED being on would be milliseconds occasionally might be ok enough to run without a resistor too. Could someone please let me know on their thoughts of this or if there are any better LEDs to use for this with better range.
    Thanks

Hi,

A couple things...

First, the 50ma is probably an average current rating and that is what the LED should be run at not what it does run at no matter how you power it. If you overpower it, you burn out the LED. So you can drive it at 200ma but that would burn it out so you dont want to do that. That is what the resistor is for, to prevent an over current level.

Second, since that is probably an average rating (check data sheet) you can probably pulse it much higher like 100ma at 50 percent duty cycle and thus with a standard IR pattern you can get much farther communication distance.

Also, since the characteristic voltage is around 1.2v and you are using a 5v supply, the current is about 3.8/Rs where Rs is your series resistor. Thus a 100 ohm resistor gives you about 38ma, but then again the output pin probably does not put out the full 5v at that current so you have a little safety margin already.

Next, to drive the LED safely from a 5v Arduino, use 2 i/o pins set up as outputs instead of just 1. Use two 100 ohm resistors, one for each pin, to drive the LED assuming you will pulse it at about 50 percent duty cycle or less. Alternately you can use 3 i/o pins set up as outputs and use 110 to 120 ohm resistors, one for each pin and that will get you up near 80 or 90ma peak current.

If you want to stick with 50ma anyway, use 2 pins and one 150 ohm resistor on each of the two pins. That will mean you'll get about 25ma from each pin for a total of about 50ma.

None of these designs require a transistor circuit but they do require that you have at least one more i/o pin to spare that you can use for the second output pin. They also require that you set both output pins to the same state one right after the other using digitalWrite() with no other instructions in between, or use a direct register i/o software technique to set both output pins at the same time.

Of course your power supply has to be able to handle whatever peak current you decide to use in addition to the normal running current of the board.

markyj:
So, the led takes 50ma regardless, the arduino is only safely capable of providing 40ma and the resistor ensures that only 40ma is given to the led? Is that correct?

No.
Led's are somewhat different from other components when it comes to current. A led on it's own will just act as a short and pull increasing current until it destroys itself. That's going to happen pretty quick depending on voltage/current available. Take your IR led and hook both leads to a car battery (12V, 500A) and you won't even get to see a flash before it pops.

Leds require additional means to regulate the current to the specifications of the led. The current (If) for any particular led tells you what is the SAFEST max current that can go through that led without damaging the led. The easiest way is to use a resistor for low power leds, based upon the voltage, and led Vf and If. High power leds (>1W) require different means to limit the current via current regulating supplies or chips.

The power supply (in your case a pin) are capable of safely supplying "X" Volts and "Y" Amps . Most supplies are voltage regulated, which means it will try to maintain the voltage regardless of current. The volts are fixed. A 5V 200mA supply will read 5V regardless if you are using 1mA or 100mA. As you try to use more current than it is designed to supply, the volts will start to drop as current increases, there is considerable heating of connections/ traces/ components until something basically has a meltdown. On a physical power supply, there are fuses that prevent damage/fire. In ICs, some chips have internal protections, but those are usually dedicated power controlling chips. The pins you are using go directly to the ATmega chip. There are no such protections there. There is nothing to prevent more than 40mA from going through that pin, other than the USER (that's you) NOT TRYING TO PULL MORE THAN 40mA. Using components that regularly use the max ratings of a supply is also a bad idea in the long run if you expect things to last for any period of time.

  1. The absolute maximum rating for an Arduino pin (ATmega boards) is 40mA. You'd never run the pin at its absolute maximum if you want a reliable circuit, you run it comfortably below, say 25mA or less.

  2. The LED has a continuous rating for current and a pulse rating. The pulse rating is what the device
    can stand without immediate damage, the continuous rating is what won't cause it to overheat and
    be thermally damaged for continouous on operation. If you are pulsing the LED you'd go to the right
    graph in the datasheet to see what maximum current you can run for the duty-cycle you use, or estimate
    it from the average current (which has to be equal (or better still less) than the continuous rating).

  3. Arduino pins as OUTPUTs have about 30 ohms of internal resistance in the driver transistors for the pin,
    you can factor that in to your external resistor calculations. This internal resistance depends a bit on the
    supply voltage - its more for a 3.3V ATmega board.

  4. There is no pulse rating for Arduino pins given. They may or may not be able to handle > 40mA for
    short periods, so until Atmel say otherwise you make the conservative assumption that the pulse
    rating is also 40mA.

Actually 40mA is much higher than most logic chips can drive, 5mA is more normal, so don't be lulled
into assuming all logic signals can drive an LED at 20mA - in fact most can't (and modern high-brightness
LEDS are way too bright at 20mA anyway).

For IR remote you need as much IR as possible which is why the IR emitters are driven in pulses at
high current, and to do this a transistor to boost current is needed, such as 2N2222 or a MOSFET.

Ok after reading the further replies i gathered that the 5v pin provides 200ma and that i can use this pin to power the led, then use a transistor to switch the led. And of course add the resistor to the led.
My question i have is you have said that i can run 200ma through the led, but im told it is 50ma.
Here is the led i have (should really have added this in my first post)

I also looked at the datasheet (download on link) and saw that dc forward current stated 50ma and then saw that peak forward current (1/100 pwm) was 1.2A.
So from what i've been told and read on the data sheet is the led max current via pwm is 1.2A (not going to run at that level anyway) and the 5v pin can provide a max of 200ma safely (well rated but half should be better as not to run at max). I have tried to find a definitive answer to this and have read that the 5v pin provides 200ma, 500ma and 900ma but didn't find anything officially stating it. Also i will be powering via usb using a standard usb plug (the sort used for phone chargers, not fast charge ones).
Just want to thank everyone for their help, knowledge and patience with me on this. Cheers.

What are the specs on your USB power source? There is no 'standard'. Actually describe yours.
Because, while you could use the Arduino's 5V pin to pull 200mA from, you will get better distance if you power the IRLED with your power source (instead of through the Arduino) which will allow pulling 1A or whatever the source has available.
If you're using some kind of phone charger, look to where it says on the sticker something like "OUTPUT DC5V ~~ 1000mA".

Power source goes separately to Arduino and IRLED, Arduino controls transistor to pulse IRLED @ <1% duty cycle. Make sure your transistor collector current is at least whatever mA your phone charger is.

If you run that LED over 20mA continuously, it will heat up and ultimately fail prematurely.
Make sure to read the notes, like this one for 1.2A current:

  1. 1/100 Duty Cycle, 10μs Pulse Width.

USB input power on Uno has 500mA rated fuse, so there's one limit.
Barrel jack has 1A rated reverse polarity protection diode, and 5V current comes from a 800mA rated regulator, which will overheat and shutdown well before that if more than 7.5V is brought in.

I will have to get back to you on the power supply then as i am not able to look right now.
Am i correct in thinking that 1.2A is max for running the led via pwm?
I am also thinking for my next test then is to try the led on 5v pin limited to 100ma to see the range on that. If it is fine then i think i might go with that.
Using a nano is there a pin to pull directly from usb or would that require some rewiring? Is it the vin pin that i can pull directly from usb as i read i could do that somewhere.

If you want range without the high current issues, use a second IR LED.

Use the diagram from post#10.
Use two IR LEDs and a 22ohm (not 82ohm) resistor in series, powered from the 5volt pin of the Nano.
Note that the 5volt pin of a Nano is 4.6volt when powered via the USB connector.

You have linked to narrow beam LEDs (10 degrees).
Your remote will be directional.
Leo..