Basic question about LEDs with USB chip

Hi, I'm working on a device that uses a PIC chip to control 6 terminals via USB. The terminals can be signaled on/off independently using 6 optocouplers. I would also like to add 6 indicator LEDs.

USB is of course 5V and I believe the PIC is sending about 5V out.

I'm now using 470 Ohm resistors before each of the 6 optocouplers, but it's my understanding that in order to add indicator LEDs in series, I would put resistors in front of them separately using a total of 12 X ~470/2 LEDs.

So my question is whether there are power issues involved in using this many LEDs. Since LEDs take 3.3V, does that mean I need to have

3.3*12=40 volts, or does the USB power supply somehow keep up with what is needed??
Reply to
Dave
Loading thread data ...

if the LEDs will signal when a given opto-coupler is on, why not just parallel it with the led pins on the opto and then lower the resistance value slightly? if you use red LEDs, think about using high efficiency... although a tad more expensive, they will glow very brightly at just 2mA - I bet if you paralleled them, you wouldn't even need to lower the resistor value at all.

BTW a PIC will sink or source 25mA - the outputs are designed to direct drive LEDs and 25mA is about as much current as you'll ever need for a stock LED - I find I can get good brightness with much less

- hate LEDs so bright (as indicators rather than light source) they make you squint.

Reply to
feebo

This is all fairly new to me and just finding the right LED to use has taken forever. The one I currently have planned is green, not red. Are there high efficiency green LEDs? Here is another one that is red

formatting link
Is this the kind you mean? I want the LED to glow through the front panel of the enclosure.

Reply to
Dave

One more question if you get around to it. When you say 'direct drive', is it possible to not use resistors at all to power 2 LEDs in parrallel? Thanks a lot for your help.

Reply to
Dave

You have this:

PIC ---[470]---[OPTO]---

Do this:

PIC -+-[470]---[OPTO]-+- | | +-[470]---[LED]--+

Do not put the LED directly in parallel with the opto. It needs its own current limiting resistor. You may want to decrease the value of the current lmiting resistor for the indicator LED to 220 ohms.

Ed

Reply to
ehsjr

I wonder which optiocouplers they are....

leds take some voltage, of their own chosing, ... it depends on the

Because that won't work, many optos use IR leds (because they're cheaper). they typically start at a lower voltage than visible LED so the indicator leds will never come on.

So don't parallel them with the opto, use separate resistors for the opto and LED and stay below the 25mA limit, (also watch the USB mA limits)

Bye. Jasen

Reply to
jasen

Thanks for the diagram. I can definitely see an advantage to controlling the current to the LEDs and opto's individually. I'll probably design the PCB for resistors on each LED and opto. At least then I'll have the option to use either resistors or bridges depending on the specs of the components.

Reply to
Dave

This is what I was planning on:

formatting link
Although I can always chose ones with different more perfect specs later.

Like I said above I'll put in pads for resistors on the PCB and bridge if I can depending on specs. I was mainly concerned about the power limit. With 6 X 2 2mA components it almost looks like I'd have trouble going over 6 terminals. I'll be careful.

Thank you.

Reply to
Dave

paralllel leds are unlikely to work with resistors, without, you have a chance, if they are identical and you get the voltage right. In general parallel leds are a bad idea

--

Bye.
   Jasen
Reply to
jasen

They look good to me, but operating with such a low current there won't be much signal on the other side.

Given that they only want 1.5V you could possibly wire them in series with the LED and in that way get a little more current through them.

ok.

that limit is 25ma per pin... with 4mA per pin you're extremely safe,

Bye. Jasen

Reply to
jasen

Your idea of a resistor on each opto and LED is good. Controlling current to LEDs and optos individually is not just an advantage, it's a requirement - you can't put an LED in parallel with an opto and expect them both to work.

Ed

Reply to
ehsjr

you can get hi efficiency green LEDs but very generally red LEDs consume lower power for the same milli-candela (mCd) light output.

The datasheets give you the properties and maximum ratings and stuff but rarely give you what you *can* do with it - and rightly so - what might be acceptable to you might be completely wrong for someone else

- this is why you should get into the habit of experimenting - just make sure your calculations are right (double check and if possible calculate in two or more different ways) so you don't blow anything up

- a word of warning with LEDs... although they are diodes, they don't like being reverse biased (the cathode more positive than the anode) and can easily be destroyed like this - double check your LEDs before you connect them up.

you could experiment with your chosen LED... assuming a 9V batery :

9-2=7V (LED will "drop" 2 volts as it does it's thing - all semiconductors have a forward bias voltage drop - normal silicon is around 0.6, and germanium is around 0.2)

Now, using Ohms law, 7V/.002A (2mA) = 3500... you won't find a 3500 ohm resistor very easilly so try both 3.3K and 3.9K. The higher the resistance, the lower the current so if your LED gives acceptable brightness with a 3.9K at 9V so much the better. (Of course this resistor will be a different value if you are doing stuff at 5V but you can do the math for yourself here :o) Then you could start coming down in value until you get to the point where the brightness is just enough. watch out for the maximum current for your LED though.

PICs will source (i.e. from the output to 0V) or sink (from 5V into the output - oh, yes, current will flow *INTO* the output - simple voltage difference) 25mA. There is no limiting on this value - you have to do that - this just means that if you keep to 25mA or less, then you won't kill the PIC. This is the maximum current (roughly) for a normal LED... but just because you *can* do a thing doesn't necessarily mean you *should*. You should always design your stuff to be as miserly as possible on the current side of things but beware ofelectrical interference (noise) on lines with very small currents in them (high impedances). Neon and flourescent strip lights are top abusers here when they start and stop - anything heavilly capacitive or inductive (motors) or with shitty power factors will cause horrible spikes that can be the devil to find - often you can get round them with a bit more intelligence in the software - i.e. istead of sensing a switch input on the first rising edge you see, wait for 50mS and see if it is still pressed - this will give time for any mechanical bounce and noise spikes (that could be fooling your PIC when you turn a light on) to subside.

Just a few ideas to whet your appetite I hope - you are entering a great worls and you are gonna have a lot of fun and tears :o)

Reply to
feebo

yes - well spotted... sorry put them in series

Reply to
feebo

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.