Transistor Issue
Moderators: adafruit_support_bill, adafruit

Re: Transistor Issue

by Zener on Fri Feb 22, 2013 12:44 pm

It's called series/parallel, and mstone is right as usual. The Vf of LED's are not all the same. You can put the odds more in you favor by using all the same PN but they will still not all have the same Vf. This is why each LED, or series LED string, needs its own series resistor.
Zener
 
Posts: 2539
Joined: Sat Feb 21, 2009 1:38 am

Re: Transistor Issue

by Zener on Fri Feb 22, 2013 12:50 pm

kculm wrote:I thought he meant I had to set the pins High.

What he said is when you have the anodes connected directly to the IO pins, then when the pin is high the LED lights. However, when you have a PNP transistor hooked up as you do, then the LED lights up when the pin is low. What this means is you have to invert your output. If your LED value is 255 (full on) then with the transistors, you would need to turn that into 0. Similarly a 0 would need to be 255. In the second code there are lines like this:

Code: Select all | TOGGLE FULL SIZE
analogWrite( GREEN, 255 - greenVal );


That subtraction there does the inverting
Zener
 
Posts: 2539
Joined: Sat Feb 21, 2009 1:38 am

Re: Transistor Issue

by modeller on Fri Feb 22, 2013 1:16 pm

Zener wrote:It's called series/parallel, and mstone is right as usual.


Here's what he said-

mstone@yawp.com wrote: For parallel circuits, the rule is "one LED, one resistor".


That may be his rule, but it's not a parallel LED circuit: such a circuit does not have one resistor per LED. A parallel LED circuit has all the LEDs in parallel and one resistor. The current is then the number of LEDs * the current of each LED. The fact is that it's possible to wire up LEDs in parallel, and whether or not you approve of it, it's done -

Image
User avatar
modeller
 
Posts: 108
Joined: Sat Jan 19, 2013 10:12 am

Re: Transistor Issue

by Zener on Fri Feb 22, 2013 1:35 pm

modeller wrote:The fact is that it's possible to wire up LEDs in parallel, and whether or not you approve of it, it's done -

A million wrong things can be done. We are just saying it is wrong from an engineering point of view. The Vf's can vary so current will not be shared in that case. Read any application note from any LED manufacturer, that covers LED arrays and they all will tell you the same thing. In my job I have to provide correct solutions that work and will not fail. That design would never pass any design review.
Zener
 
Posts: 2539
Joined: Sat Feb 21, 2009 1:38 am

Re: Transistor Issue

by modeller on Fri Feb 22, 2013 1:40 pm

Zener wrote:
modeller wrote:The fact is that it's possible to wire up LEDs in parallel, and whether or not you approve of it, it's done -

A million wrong things can be done. We are just saying it is wrong from an engineering point of view. The Vf's can vary so current will not be shared in that case. Read any application note from any LED manufacturer, that covers LED arrays and they all will tell you the same thing. In my job I have to provide correct solutions that work and will not fail. That design would never pass any design review.


I also said not to do it didn't I? But the fact is, we are discussing what series and parallel circuits are. Whether it's right or wrong, a parallel LED circuit is wired up the way I showed. If you don't believe it Google it. People also do make it work, even though you and I wouldn't want to do it. If you want to make people understand, you need to show the circuit plainly as it would really be, and one resistor per LED is not a correct representation of a parallel LED circuit. I don't know why you are complaining about what I posted since it's correct.
User avatar
modeller
 
Posts: 108
Joined: Sat Jan 19, 2013 10:12 am

Re: Transistor Issue

by adafruit_support_bill on Fri Feb 22, 2013 5:47 pm

Gentlemen. Keep it civil.
User avatar
adafruit_support_bill
 
Posts: 29218
Joined: Sat Feb 07, 2009 9:11 am

Re: Transistor Issue

by kculm on Fri Feb 22, 2013 7:39 pm

Guys thank you all for your reply's. I did not mean to open up a can of worms. As I said before I am totally Green.

And for me, doing something is the best way to learn. Even if i have to make a few mistakes along the way.

I get a lot out of the posts on this forum. More then any off the book I have read.

So once more...Thanks...

Keith
kculm
 
Posts: 35
Joined: Sun Dec 23, 2012 6:34 pm

Re: Transistor Issue

by kculm on Sun Feb 24, 2013 12:54 am

Ok guys once more Thanks for all The help. But I need to recap.

As I am rereading the post I see that and please correct me if I am wrong. What I was doing with the RED LEDS would be considered series/parallel Array
That is something that can be done, but is not recommend. And the way I should be doing it (and all of my parallel Arrays) is one resister on each LED.

Am I correct or should I give up on electronics and stick to networking.

Thanks

Keith
kculm
 
Posts: 35
Joined: Sun Dec 23, 2012 6:34 pm

Re: Transistor Issue

by adafruit_support_bill on Sun Feb 24, 2013 7:51 am

Ignore the last few posts and go back to this one: viewtopic.php?f=8&t=37326#p184338
When you put the LEDs side by side (both cathodes connected to GND), you want a resistor per LED.

There are three leds in your diagram that 'share' a resistor. These should each have their own resistor.
User avatar
adafruit_support_bill
 
Posts: 29218
Joined: Sat Feb 07, 2009 9:11 am

Re: Transistor Issue

by kculm on Sun Feb 24, 2013 9:57 am

adafruit_support wrote:Ignore the last few posts and go back to this one: viewtopic.php?f=8&t=37326#p184338
When you put the LEDs side by side (both cathodes connected to GND), you want a resistor

Thank you.
kculm
 
Posts: 35
Joined: Sun Dec 23, 2012 6:34 pm

Re: Transistor Issue

by kculm on Sun Feb 24, 2013 10:03 am

Am I correct in assuming that would be the same for common Anode ?
kculm
 
Posts: 35
Joined: Sun Dec 23, 2012 6:34 pm

Re: Transistor Issue

by adafruit_support_bill on Sun Feb 24, 2013 10:06 am

Am I correct in assuming that would be the same for common Anode ?

Yes. It doesn't matter whether the resistor is on the anode or cathode side, as long as it is in series with the led.
User avatar
adafruit_support_bill
 
Posts: 29218
Joined: Sat Feb 07, 2009 9:11 am

Re: Transistor Issue

by kculm on Sun Feb 24, 2013 10:15 am

Would I ever need to do it like this?

Image
kculm
 
Posts: 35
Joined: Sun Dec 23, 2012 6:34 pm

Re: Transistor Issue

by adafruit_support_bill on Sun Feb 24, 2013 10:34 am

If you can't afford the resistors and are 'feeling lucky', you might get away with it. But it is not good practice. Each led should have its own resistor to limit the current.
User avatar
adafruit_support_bill
 
Posts: 29218
Joined: Sat Feb 07, 2009 9:11 am

Re: Transistor Issue

by kculm on Sun Feb 24, 2013 10:45 am

adafruit_support wrote:If you can't afford the resistors and are 'feeling lucky', you might get away with it. But it is not good practice. Each led should have its own resistor to limit the current.



Thanks Once More.

I think it's embedded now. Don't be Cheep and lazy now, because it will cost me more in time and money latter.
kculm
 
Posts: 35
Joined: Sun Dec 23, 2012 6:34 pm