Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Transistor Switchin Problem

Status
Not open for further replies.

camlv

New Member
I have started a project using a micro controller to control a LED display and I am having trouble using transistors to switch the LEDs, I have 5 LEDs in parallel being switched by one transistor and each LED is individually switched by another transistor.

I have given each LED its own resistor and the problem I am having is that when all LEDs are on each LED gets dimmer then if only one was on. I don't really understand why this is happening but I'm not 100% comfortable with transistors and I have probably done something stupid.

I have attached a image of how I have wired it up but with only two LEDs.

Any help would be greatly appreciated, Thanks.

9276-FNSG2DYG2HDZWRM.MEDIUM.jpg
 

dougy83

Well-Known Member
Make sure your power supply is up to supplying the max current. Also try decreasing the 10k resistors to maybe 2k2 or so.
 

camlv

New Member
I'm running it of a 3A power supply so that it more then enough. I'll try lowering the 10k resister, it would be great if that was all it was.
 

camlv

New Member
Transistors amplify the base current don't they? So with a 10k resister on the last transistor i'm feeding in a much to low of a current to pass the 100mA needed for 5 LEDs. Is that right? So yeah 2K2 will fix my problem :D
 

Boncuk

New Member
The bottom tranistor must conduct fully to have the follow on transistors (emitters) pulled to ground as far as possible.

Use an 820Ω base resistor for the bottom transistor for a full base current of 5mA. With this base resistor value you'll get the collector voltage down to 0.3755 with minor increase with the number of transistors connected.

With a base resistor of 10KΩ the collector voltage is 0.886V, just enough to have one LED bright.

Decreasing the values of the base resistors of the LED switching transistors will increase the collector voltage of the bottom transistor, thus reducing LED brightness.

Here is the schematic for three LEDs, all at full brightness of 19.5mA. Reducing the base resistance further will not decrease collector voltage, since the transistor is fully saturated already.

Boncuk
 

Attachments

  • BASE-RESISTOR.gif
    BASE-RESISTOR.gif
    11.6 KB · Views: 96
Last edited:

camlv

New Member
Does 5mA base current allow the transistor to conduct fully? Does it not work on a measure of gain???
 
Last edited:

dougy83

Well-Known Member
By conduct fully, do you mean 'saturate'? You might need to poke a bit more current in than that for saturation. Anyway, just give it a try with a resistor and see if it acts how you want.

Does it not work on a measure of gain???
Yeah, but unfortunately the gain changes as the current does.
 
Last edited:

Boncuk

New Member
Does 5mA base current allow the transistor to conduct fully? Does it not work on a measure of gain???

It does with a BC338. Use an N-channel Fet to get least losses. :)
 

sameerk

New Member
Try if this BC338 datasheet helps you.

I think the bottom transistor should be given enough base drive (current) as the collector current it has to carry is summation of all 5 individual collector currents in worst case.
Lower the base resistor to 5V / [(20mAx5)/hFEmin] ... per data sheet hFEmin=100
This comes out to be '5000', you may try R <= 4.7kohm
 

Attachments

  • BC338.pdf
    76.8 KB · Views: 190

audioguru

Well-Known Member
Most Helpful Member
Lower the base resistor to 5V / [(20mAx5)/hFEmin] ... per data sheet hFEmin=100
No.
The datasheet for this transistor and for almost every other transistor shows the max saturation voltage loss when the base current is 1/10th the collector current. hFE is not used for a saturated transistor.

hFE is used only when there is plenty of collector to emitter voltage for a linear amplifying transistor.

So the base current should be 10mA for a collector current of 100mA and the base current should be 20mA if the lower transistor has a collector current of 200mA.

The max allowed output current from a PIC is 25mA. With an output of 20mA its max output voltage is about 4.5V when its supply is 5.0V.
 

camlv

New Member
No.
The datasheet for this transistor and for almost every other transistor shows the max saturation voltage loss when the base current is 1/10th the collector current. hFE is not used for a saturated transistor.

hFE is used only when there is plenty of collector to emitter voltage for a linear amplifying transistor.

So the base current should be 10mA for a collector current of 100mA and the base current should be 20mA if the lower transistor has a collector current of 200mA.

The max allowed output current from a PIC is 25mA. With an output of 20mA its max output voltage is about 4.5V when its supply is 5.0V.


Thanks for your help everyone, I might even think about running two transistors at the bottom to amplify the base current if i'm going to be drawing 20mA from the micro. Although that's with in the limits I am using a lot of pins from the micro and don't want to strain the thing to much.

I'm confused about collector-emitter voltage, is that the voltage drop from the collector to the emitter? I thought that is always 0.7V or is that base-emitter?
 

audioguru

Well-Known Member
Most Helpful Member
The collector to emitter voltage of a transistor that has a base current that is 1/10th the collector current is typically 0.13V (2N4401 transistor with a collector current of 150mA) but is 0.4V max.

The base-emitter voltage is about 0.7V.
 

dougy83

Well-Known Member
The collector to emitter voltage of a transistor that has a base current that is 1/10th the collector current is typically 0.13V (2N4401 transistor with a collector current of 150mA) but is 0.4V max.

The base-emitter voltage is about 0.7V.

For the BC338 you'll find that the VCE and VBE are a fair bit higher (about twice that mentioned) with high currents. When in doubt, refer to the datasheet. It (& many others) can be found at www.datasheetarchive.com
 
Last edited:

Boncuk

New Member
Hi camlv,

as I already suggested use a base resistor of 820Ω for the bottom transistor. The transistor draws less than 5mA with that resistor and shouldn't be a problem for the I/O of your MCU.

With three transistors and LEDs (each 20mA) the Emitter-Collector voltage is 0.37V while with a 10KΩ base resistor it is 0.886V, increasing with each transistor you connect in series with it.

You could also use a small N-channel MosFet (BS170) as bottom transistor. There the voltage loss is about 120mV for your application.

Please observe the LED forward current. With a saturated bottom resistor it exceeds 20mA with a current limiting resistor of 80Ω.

Boncuk
 

mneary

New Member
You could also use a small N-channel MosFet (BS170) as bottom transistor. There the voltage loss is about 120mV for your application.
The BS170 is not a logic level MosFet. Although it may 'typically' work at Vgs 5V, be aware that it gets much poorer with Vgs of less than 4.5V or drain current more than 500mA.

(And this is 'typical' performance; it isn't guaranteed.)
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top