# Multiple infrared LEDs in parallel or series?

For a bird camera project, I would like to power 4 infrared LEDs from a Raspberry Pi as the light source for the Pi's NoIR camera.

The IR LEDs (TSHF6410) have a forward voltage of 1.4V and a maximum forward current of 100mA.

I came up with two different circuits: one with all 4 LEDs in parallel, and one with two strings of two LEDs in series.

Which circuit would be the best choice?

In the first circuit, with all LEDs in parallel:

• LED current: 77mA = (5V - 1.4V) / 47Ω
• Transistor current: 308mA = 4 * 77mA

In the second circuit, with all LEDs in parallel:

• LED current: 100mA = (5V - 2 * 1.4V) / 22Ω
• Transistor current: 200mA = 2 * 100mA

For the LED current, the second circuit is exactly at the maximum rating for the IR LED. Would that be a problem? Do I risk damaging the LED?

For the transistor current, both circuits are within the limits of the 2N5551 transistor (600mA). For the second circuit a 2N3904 transistor (200mA), might work as well - or is this again too close to the limits?

Does the higher current of the first circuit also mean it consumes more power? So in that regard the second circuit would be the best choice? Are there any other advantages/disadvantages?

PS: I'm not sure whether it matters, but I intend to control the brightness of the LEDs via PWM.

• Your note on using PWM doesn't mention if you will be smoothing that with a capacitor to avoid any possible beating of the pulse frequency with the frame rate of the camera, and none is shown in the schematic, so maybe there's something to consider. – DarylK Dec 31 '20 at 12:37
• I'm simply using the hardware PWM of the rasperry pi gpio (on pin 12). The schematics is exactly as in the drawing, so no capacitor. Why would I need a capacitor? (This is my very first electronics project, so this is all new to me.) – Jef Driesen Dec 31 '20 at 12:52
• why aren't you also aiming for 77mA in the second circuit? Without the same current through the LEDs it's not a fair comparison, and even though the second circuit is better with your current current (!) figures it would be better still if your LED currents were consistent. – Alnitak Dec 31 '20 at 13:41
• To obtain a 77mA current in the second circuit, I would need a 28.5Ω resistor. But the nearest value I have is either 22Ω (100mA) or 47Ω (47mA). – Jef Driesen Dec 31 '20 at 13:52
• Given that (IIUC) the 100mA current is not intended for continuous operation you may want to ensure that the GPIO pin is held low until such time as the PWM code is initialised. You may also want to find an LED specifically intended for illumination rather than data signalling (e.g. VSLY5940?) – Alnitak Dec 31 '20 at 14:08

Series is always the best, you waste less power on the resistors, your BJT needs to handle less current.

Also the forward voltage of LEDs may vary quite a bit, which will make some LED draw more current than others and generate different brightness. This will not happen when in series as they will all share the same current. Brightness is directly correlated to the current, not the voltage.

If you can (have a higher voltage rail than 5V if it's battery-powered), put everything in serie.

Higher voltage is always easier to handle than higher current (within reason).

• Amen to using a higher voltage on the LED arrary, as long as the transistor can handle it. All LEDs in series wastes less power. There's no reason to suppose that the LED supply has to be the same as the Raspberry voltage, with that circuit arrangement. They just need to share ground. – DarylK Dec 31 '20 at 12:28
• I only have access the rasperry pi 5V (or 3.3V) as power supply. For practical reasons (a single cable to the bird nestbox) an external power supply is not an option. – Jef Driesen Dec 31 '20 at 12:58

For the LED current, the second circuit is exactly at the maximum rating for the IR LED. Would that be a problem? Do I risk damaging the LED?

I think it will be a problem.

The data sheet tells you that the forward voltage reduces by 1.8 mV for every °C the temperature rises. Given that the power dissipated is nominally 1.4 volts x 100 mA = 140 mW AND the thermal resistance of the LED is 230 °C / watt, the LED will warm by 32.2 °C. The forward voltage will drop by nearly 58 mV.

That means that the forward voltage drops from 1.4 volts to 1.342 volts AND with two LEDs in series that's a total drop of 2.684 volts. The current through the 22 Ω will be: -

$$\dfrac{5 - 2.684}{22} = 105.2 \text{ mA}$$

So, it's creeping up a bit and you'd then need to recalculate the power dissipation given the new lower volt drop and the higher current but, it looks to me like you are teetering on the slippery slope. I'd probably go for a 27 Ω resistor to put the basic current calculation at 82 mA.

But then you could argue that the BJT might drop 100 mV when activated and that will reduce the currents a little. Why not simulate and get a better idea how to play this? Or just be done and use a MOSFET with a guaranteed turn on resistance less than 0.1 ohms so that you don't have to factor the BJT volt-drop into things.

Does the higher current of the first circuit also mean it consumes more power?

Yes it does. It's certainly more inefficient.

• How do I simulate a circuit? Regarding using a MOSFET, I don't really know how to use those. The only one I have available in my kit is the IRF520, and I have no idea if that one is suitable or not. – Jef Driesen Dec 31 '20 at 14:11
• OK, the IRF520 isn't going to be any better than a BJT given that your GPIO isn't going to be more than 5 volts. Simulation tools are really the way forward. I recommend microcap but they are a big leaning curve. – Andy aka Dec 31 '20 at 15:02

Both of your designs are inefficient and weak. Keep in mind these are bright point sources with a 45 degree beamwidth and inverse squared illumination loss. You want to consider the illumination quality and glare to the observer (tweet) and consider a diffused array.

I suggest you should use a string of 3 x 1.4V LEDs and use as many strings in parallel as you want.

I would use a power NPN rated for 5W driven by a current sense emitter R driven by a PN2222A. Choose something under 100mA per string.

I agree with Andy's assessment but I would go a few steps further to improve your design.

Don't use PWM s this will cause all sorts of poor image quality pixel blanking and/or aliasing with the frame rate Using a linear control voltage such as 0 to full scale with 0 to 3.3V

This is my design using a 5W power transistor for low Rce (< 0.2) and a PN2222A or equiv.

Batched IR LEDs are pretty well matched and in a string of 3 reduces chance of thermal runaway. But failure of any string is not protected yet here.

• Use two 1/4W 3Ohm R's to make 1.5 Ohm and reduce temp. – Tony Stewart EE75 Dec 31 '20 at 16:27
• I already did a small test setup (with the first schematic) to evaluate the illumination. The brightness at 77mA is more than sufficient. That's one of the reasons I looked at using PWM, so I can reduce brightness if necessary. Since this is something I can control in software, it's a feature I can add later. That's not the case for the hardware. – Jef Driesen Jan 1 at 19:35
• The distribution of the light looks good too with one LED in each corner. That's why I did choose to use 4 LEDs. I'm afraid your schematic is a bit beyond my knowledge. I have no idea what it does, or why it's an improvement over my simple version. I know how to calculate current limiting resistors, and that I need a transistor because the current is too high for the gpio pins. – Jef Driesen Jan 1 at 19:52
• This is an active current limiter and more efficient with 3S. You can use both linear or PWM control with this – Tony Stewart EE75 Jan 1 at 23:31