Transistor Issue

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Transistor Issue

Post by zener »

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.

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Transistor Issue

Post by zener »

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

analogWrite( GREEN, 255 - greenVal );
That subtraction there does the inverting

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Transistor Issue

Post by modeller »

Zener wrote:It's called series/parallel, and mstone is right as usual.
Here's what he said-
[email protected] 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
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Transistor Issue

Post by zener »

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.

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Transistor Issue

Post by modeller »

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
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Transistor Issue

Post by adafruit_support_bill »

Gentlemen. Keep it civil.

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

Re: Transistor Issue

Post by kculm »

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 7:34 pm

Re: Transistor Issue

Post by kculm »

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

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Transistor Issue

Post by adafruit_support_bill »

Ignore the last few posts and go back to this one: http://forums.adafruit.com/viewtopic.ph ... 26#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.

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

Re: Transistor Issue

Post by kculm »

adafruit_support wrote:Ignore the last few posts and go back to this one: http://forums.adafruit.com/viewtopic.ph ... 26#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 7:34 pm

Re: Transistor Issue

Post by kculm »

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

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Transistor Issue

Post by adafruit_support_bill »

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.

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

Re: Transistor Issue

Post by kculm »

Would I ever need to do it like this?

Image

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Transistor Issue

Post by adafruit_support_bill »

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.

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

Re: Transistor Issue

Post by kculm »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”