Powering modulated IR LEDs with more current than Arduino outputs can supply

So I'm building a long range IR beam-break detector.
I've bought a bunch of these LEDs which I'm going to modulate at 38kHz using the Arduino:
https://docs-emea.rs-online.com/webdocs/1545/0900766b81545a2c.pdf

The receiver is a Vishay TSSP4038:

My problem is that the Arduino can only safely supply ~20mA on the output pins.

Is there a basic way to bump up the current supplied to the LEDs? I'm guessing using a transistor or a capacitor?
I'm no expert in these components but wouldn't a capacitor "even out" the modulation? I mean, the LED needs to turn off quiete a few times every second. Won't the energy stored in the capacitor just keep the LED evenly on?

I haven't settled on a number of LEDs yet but the beam needs to be powerful enough to travel 15m to a retroreflector and back. Alignment is obviously key here but first, power!

Yes, a capacitor will act as a filter!

The way to go is to use a transistor.

Here are NPN bipolar and N channel MOSFET LED drivers. To choose the LED current limit resistor (R4, R5) the formula is: R = (Vsupply - LED Vf) / desired LED current. Vf is the forward current from the data sheet (1.5V). The max current for the 2N7000 is 200mA, 600 mA for the 2N2222.

Nice. Thank you guys.
Does it make a difference If I use an NPN or a PNP transistor?

Does it make a difference If I use an NPN or a PNP transistor?

Yes, PNP would require a different circuit and it would invert the logic.

Great. I've already ordered a bunch of these TIP120G transistors:
https://docs-emea.rs-online.com/webdocs/1385/0900766b813859d2.pdf

Does the type of transistor matter when choosing resistor values?
Say I want to use 4 LEDs and a 12V power supply (the power supply is already installed and in use for other components so it will be easier to use)
The LEDs have a forward current of 100mA and forward voltage of 1.5V.
The specs also says:
Forward voltage
(If = 1 A,
tp = 100 µs) = 2.3V
I guess this means that you can boost the LEDs to 2.3V and 1A if the LEDs are pulsed for 100us at a time?

How would I go about calculating resistors here ?

TIP120 is a darlington - the calculations will be different.

If you go for 1A pulses, you drop 4 x 2.3V = 9.6V across the LEDs, about 1.5V across the TIP120,
so a 1 ohm series resistor might be right for the remaining 1V drop (some measurements would
be needed to check this).

However note that forward voltages are only rough guides as vary between devices and with temperature,
I'd suggest using 3 LEDs in series for 1A pulses, using a 3.3 ohm resistor.

Yes, the 100us max pulse length at 1A is probably close to the maximum it can take.

With these current spikes some good decoupling of the supply is advisable, 100uF or more.

MarkT:
TIP120 is a darlington - the calculations will be different.

With these current spikes some good decoupling of the supply is advisable, 100uF or more.

I just bought some 2N7000 MOSFETs also to simplify things for me.

I also tried doing some reading about decoupling capacitors. Where would I put this 100uF capacitor you mention?

Remember 2N7000 = 200mA max. So you're not going to boost to 1A using them.

Steve

Did you read the datasheet of the IR LED.
High LED current could only be specified for a very short time (e.g. <100usec for 1Amp),
so not suitable for the beambreak transmitter you're making.
Most IR LEDs have a 100mA limit for continuous 38kHz, and intermittend/pulsed is also limited to 100mA over time (longer than 100 seconds).

Did you try how far it will work with two LEDs in series and ~30mA current, straight from a 5volt Arduino pin.
You might be surprised.
Don't always grab a hammer to crack an egg.
Leo..

Wawa:
Did you read the datasheet of the IR LED.
High LED current could only be specified for a very short time (e.g. <100usec for 1Amp),

I might be wrong here but modulating it at 38kHz means turning it on and off 38000 times every second. That corresponds to ON-periods of roughly 26us. I understand that as less than 100us and therefore possible to boost the current to 1A. Am I missing something?

You must take the duty cycle into account. Refer to the graphs on page 4 of the data sheet. If your 38KHz square wave is 50% (0.5) duty cycle and the temperature of the LED is 25C then the max current is less than 200mA.

That makes sense. So I need to pulse the LEDs with no more than 200mA. That's still a lot more than the 20mA I can safely pull from the Arduino pin in total.

Any suggestions as to how I should wire this to supply ~150mA to each of the 4 LEDs and still pulse them at 38kHz?
I've bought TIP120 Darlington transistors and some 2N7000 MOSFETs

BlueSails:
I've bought TIP120 Darlington transistors

Bad choice, particularly if you are operating at 5 V. Pity you can't take them back.

If on the other hand, you have a 12 V supply, you put four IR LEDs in series.

Paul__B:
Bad choice, particularly if you are operating at 5 V. Pity you can't take them back.

Would it be possible for you to elaborate on why it's a bad choice? Maybe even recommend another type of transistor for my purpose?

A 2N2222 with a 330ohm base resisor can drive six IR LEDs in series from a 12volt supply.
I would calculate the CL resistor for <=100mA peak (>=22ohm for 6 LEDs).
You should use active current limiting for peak currents >100mA.
Leo..

BlueSails:
Would it be possible for you to elaborate on why it's a bad choice? Maybe even recommend another type of transistor for my purpose?

Darlingtons switch off slowly, this may be an issue at these frequencies. And they drop 1 to 2V
from the available supply, and may need heatsinking for the waste heat this generates.

Problem with TIP120 is that there is a ~1.5v drop across the transistor when it's on (since a darlington is an array of two BJT's each with ~0.7v drop). That really hurts when you're running with only 5v of supply current.

A MOSFET, on the other hand, acts like a very low value resistor when on (within it's operating current range); modern mosfets often have on-state resistance (Rds(on) ) in the tens of milliohms - almost negligible - so you get the whole supply voltage to power whatever it's switching the supply to.

BlueSails:
Would it be possible for you to elaborate on why it's a bad choice? Maybe even recommend another type of transistor for my purpose?

Others have said it.

(Many) years ago, the Darlington was the way to get high gain in a power transistor. It was not very efficient and it was actually better to use two separate transistors with the first connected not to the load, but to the supply so that the second transistor could be fully saturated and therefore minimise saturation voltage and consequently, dissipation.

But something happened.

FETs became not just another sort of transistor with some advantages, but then the basis of logic ICs, and then microprocessors and microcontrollers, becoming smaller and smaller and (consequently) faster and faster.

On the other hand, power FETS were developed which similarly became more and more capable, with lower and lower "on" resistances and higher voltage ratings. Because that "on" resistance is in effect, a resistance and not a voltage drop, this means they are actually capable of carrying very high currents as switches with minimal heating and combined with high voltage ratings they have essentially replaced transistors in most power applications.

Not to mention that FETs have an exceptionally high input resistance (but a significant capacitance) and require current only to switch.

The bottom line: Darlingtons, including the ULN2x03 driver chips - are essentially obsolete. You might use them to replace a faulty part, but really should not consider them for a new design because even if they are cheap, they introduce design limitations that are easily avoided with available FETs.

But do remember that to control them with microprocessors, you need to use "logic-level" FETs whose "RDS" - the minimum or saturation source-drain resistance - is specified at less than the logic voltage you will be using. Your 2N7000 is sort-of in this category with an on resistance of 6 Ω (close to the value of 5 Ω at 10 V on the gate).

Wawa:
A 2N2222 with a 330ohm base resisor can drive six IR LEDs in series from a 12volt supply.
I would calculate the CL resistor for <=100mA peak (>=22ohm for 6 LEDs).
You should use active current limiting for peak currents >100mA.
Leo..

Great, I've just ordered som 2N2222 as well.
As I understand it I will need a 330Ohm resistor between the Arduino pin and the base of the transistor, Right?

What if I can only fit 4 LEDs? Are my calculations correct if I use a 62Ohm resistor then? The online calculator says "power dissipated by resistor=600mW" Is this a lot?

What is Active current limiting and why is it necessary? I'm not sure I'm finding what you mean when searching for it.