We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

Zocker1996
Posts: 3
Joined: Wed Apr 19, 2017 8:05 am

Series Wired IR LEDs for LIRC

Wed Apr 19, 2017 8:15 am

I need to control 5 ir devices. Unfortunaly they have to be placed in a special way, thus I need to use a seperate ir led for each.
The raspi (Pi 1 Model B) I use is also placed in a fixed way so that it is hard now to add wires to additional gpios.
I got one wire from gpio 17, a 3.3V and a GND. The raspi also controls a 4 channel 5V relais.

The ir leds use 1.35V each. The setup works with up to 3 series-wired ir leds, but the range of them is obviously very small (which is not a problem in my case, the leds are taped to the receivers).
4 leds are close together and close to the raspi, but one is far away (10m wire [32,8ft]).
But I cant get more then 3 ir leds to work. Here is a scheme of how everything is wired:
Image

Can I add an external power source and some resistors to get everything to work?
Maybe wire them parallel? I dont know much about eletrics...

User avatar
Burngate
Posts: 6560
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore

Re: Series Wired IR LEDs for LIRC

Wed Apr 19, 2017 10:36 am

I'm surprised that even three in series works, with power from the 3v3 rail.

Each LED requires 1.35v (according to your diagram).
So three in series requires a total of 4.05v.
Four in series => 5.40v
Five in series => 6.75v

You've put a 220Ω resistor from the GPIO to the transistor base - that means about 12mA is flowing into the base. With a gain of ~10 in the transistor, that means up to 120mA could flow in the collector.
But there's nothing in the LED string to control the current there, so as much current will flow as they can take.
LEDs aren't linear, so the voltage across them and the current through them aren't easily calculated. That's why most diagrams you'll see on line have a resistor in series to control the current.

So your best bet is to rewire everything, with the LEDs in parallel and with each LED fed through its own resistor, from the supply rail to the collector.
Use the 5v rail rather than the 3v3 rail - it could give more current - and choose resistors that will give a few mA through each LED

Snow360
Posts: 3
Joined: Wed Apr 19, 2017 1:51 am

Re: Series Wired IR LEDs for LIRC

Wed Apr 19, 2017 11:54 am

Hey Zocker,

Burngate already answered your question, but since you mentioned you don't know much about electronics, I wanted to share a resource that explains some basics about series and parallel circuits and circuit analysis. Here's a link to a PDF with some good info: https://learn.digilentinc.com/Classroom ... er_1p5.pdf

The key takeaway is that circuit components in serial have the same current running through them, while components in parallel have the same voltage drop across them. More specifically, if you connected the LEDs in parallel to a 5V rail, per Burngate's suggestion, each LED could have up to 5V across it. (You'll want to include some current limiting resistors for each LED though.) In any case, a parallel connection will give each of your LEDs the needed voltage.

-Snow

Zocker1996
Posts: 3
Joined: Wed Apr 19, 2017 8:05 am

Re: Series Wired IR LEDs for LIRC

Wed Apr 19, 2017 5:13 pm

Thanks for that answers!
If I understood correctly I should wire the leds in parallel with a serires wired resistor connected to each.
I also should use a 5v line. The problem here is that the Raspi 1 Model B only got one 5V line, so I have to wire
the leds in parallel to the relais? I fear that the current which the 5V pin has to provide might be to high.

It would look like this (scenario 1):
Image

I thought of adding an external USB wall plug (5V, 1A) like in this scheme to relieve the raspi (scenario 2):
Image

So now the resistors: I started building this system according to this tutorial: https://klenzel.de/3588
Here the ir led is powerd by the 3,3V line and has a series wired resistor of 22 Ohm connected. The led uses 1,35V
which means the resistor in the tutorial has to consume 3,3V-1,35V=1,95V. Since I=U/R the current is 1,95V/22Ohm=87mA.
If I want to use the 5V line now with the same current trough each led the resistors will have to consume 5V-1,35V=3,65V.
Since R=U/I the resistors should have 3,65V/87mA=42ohm each? The total current of this parallel wired setup is now 5*87mA=435mA.
If I use scenario 1 from above the 5V pin would have to provide 435mA plus the relais current.
According to wikipedia and https://www.raspberrypi.org/blog/power- ... micro-usb/ the Pi 1 Model B can only consume 700mA.
So it has less than 700mA-435mA=265mA left for its CPU and other components? Or would I have to use a USB Wall Plug which can provide more than 700mA+435mA+the relais current to source the Raspi?

Edit: By the way I noticed that the schemes are wrong, there is no 5,5V line, it has to be 5V.
Edit2: The images are displayed a bit small, you could open them in a new tab to get a better view

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: Series Wired IR LEDs for LIRC

Wed Apr 19, 2017 10:32 pm

435mA is far too much; go with scenario 2.
Your parallel array wastes a lot of power in the resistors. With a five volt supply you can drive three 1.35V LEDs in series. If you know the LED's current requirements this tool will design it all for you:

http://led.linear1.org/led.wiz
Submarine communication systems engineer and amateur robot enthusiast.

Snow360
Posts: 3
Joined: Wed Apr 19, 2017 1:51 am

Re: Series Wired IR LEDs for LIRC

Thu Apr 20, 2017 12:41 am

For current-limiting resistors with LEDs, I most often use 220 Ohms. 22 Ohms offers very little in the realm of limiting current, as you have realized yourself.

If you used 220 Ohms in series with each LED, and the 5V rail, each leg of your parallel circuit would have (5-1.35)/220, or 16.6mA. With that, all 5 of your LED/resistor lines would only consume 83mA total, which is easy enough for the Pi to handle.

That's what I would suggest, versus going back to a series circuit. Using a series circuit limits you to only being able to use 3 LEDs. You would also lose power to the whole line if a component "burned out". Whereas with parallel, if one goes out, the other 4 operate as normal. This may not be critical for your application, but it's something to consider.

So I would still suggest parallel, but adjust your resistor values.

-Snow360

Zocker1996
Posts: 3
Joined: Wed Apr 19, 2017 8:05 am

Re: Series Wired IR LEDs for LIRC

Sat Apr 22, 2017 11:47 am

So I wired them parallel now with 220Ohm resistors and it works. Thanks for the answers!

Return to “Automation, sensing and robotics”