output resistor...why 10K?

lettcco

New Member
Hi all,

I hope I am not asking an obvious question, but I can't seems to find the answer to why 10K resistor is chosen in the manual when connecting an output pin to a transistor.

I understand the resistor is there for chip protection purpose (correct me if I am wrong there too,) so if we assume Vdd is 5V and a typical output pin of a picaxe chip is ~20mA, Shouldn't we use resistor that is ~250ohm instead?
 

cactusface

Senior Member
Why 10K

Hi lettcco,
Just because the pic can supply 25mA, you would'ent want 25mA going into the base of a trany, it would satrurate it... Remember the trany is an current amplifier, 1mA in the base and lots more out on the collector. So 10K is not too bad, it can vary depending on the trany.

In this case the resistor protects the trany, not the pic, or at least that's it's main job
Regards
Mel (Cactus)
 
Last edited:

BeanieBots

Moderator
10k is very much a finger in the air value.
If you want to know the optimum value to use, then you will need to know what the "hfe" (gain) of your transistor is and the maximum load current of whatever it is that your transistor is switching.

The maximum collector current is given by hfe*base current.
Base current will be (Vdd-0.6)/[base resistor value.]

If you use excessive base current, then the transistor will take a long time to switch off and it simply wastes power for no particular reason.

So, the resistor is not there for output protection but to keep the transistor happy with whatever load it is switching.
 

westaust55

Moderator
As already mentioned, the resistor value depends upon exactly what you are trying to do.

I do often use "standard" bipolar junction transistor as opposed to FET's as a switch and tghen drive it with sufficient base current to put it into saturation so that the voltage from the collector to the emitter is minimised (maybe only 0,2V for small Ic rated transistors) which ensures that the heating effect on the transistor is minimised.

Again you need to do a calculation based upon the transistor datasheet to determinal the optimal value that will give saturation for the desired load current without excessive (wasted) current (and thus heat) out of the PICAXE and into the transistor base.
 

lettcco

New Member
thank you

Thank you for all the valuable inputs!

I thought I could neglected all the factors involved when using a BJT as a switching device (to drive a small 3V motor for a second or two), but after looking closer at the spec sheet, looks like there is quite a range (2N3904 vs 2N2222) but a typical BJT's max collector current is at 800mA at most, so a 20mA base current with a typical hfe of 200 would probably cause an excessive collector current indeed.

as an off topic question, can I control my collector current through the addition of resistance on the load? would that give me the best of both world--fast switching and minimized excessive waste current?
 

BeanieBots

Moderator
I think you might have got a little confused.
The collector current is determined by whatever your load is.
The maximum amount of current which the load can be supplied with is determined by the base current X hfe.

The maximum possible current needs to be slightly higher than the maximum that will ever be required or else the transistor will limit the current (rather than the load) and go into linear mode when heat is dissipated by the transistor. Also, the load will not behave as expected.

When calculating the base resistor value, start with load current.
What will be the maximum current your load would pull when connected directly to the supply?

Then divide that value by the MINIMUM value of hfe specified for your transistor. That is the required base current. (Ib)

Then determine the required base resistor value.
R=Ib(supply voltage - 0.6v)

That will give you a MAXIMUM resistance.

Now for the not so scientific bit.
To be safe, (avoid linear mode) you need to reduce that value.
To avoid excessive base current, don't reduce too much.

To get a suitable range, you can take the calculated value and divide by about 3 for the minimum and 1.5 for the maximum.

The value is not critical but must be less than the ideal value you calculated earlier but not less than about 1/3 of that value.

Putting a resistor in series with your load will simply waste power in that resistor and reduce the maximum current available to the load which should be allowed to take what it wants (unless it's an LED or similar device).

Hope that helps. If not, ask again.
 
Top