Continue to Site

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.

biasing npn transistor without a resistor

Status
Not open for further replies.

fvnktion

New Member
Im designing a board with a pic microcontroller. In the past i have used darlington arrays, which can be driven directly from the microcontroller. I now need to use a single npn transistor as a switch. In most applications that i have seen there is a biasing resistor being used.

I am wondering if i can bias the transistor without using a resistor to drive it directly into saturation. With a maximum output of 20ma from the ucontroller this seems resonable, but i am not sure.

If this does not pose a problem to the transistor or microcontroller can i use this practice in general, even when there is a non regulated amount of current that can flow into the base, where i dont care what the collector current will be and only care that the transistor is in saturation?

In general i would like to know what my limitations are and when i may end up damaging the transistor??

Thanks for your input.
 
Hi
please study the DC parameters of transistors where the limit for Ibe (current of base emitter Junction ) is to be controlled even with saturated working. Else, the Junction would fail to short circuit.

Spend 15 minutes across transistor biasing chapter and you would appriciate
 
fvnktion said:
Im designing a board with a pic microcontroller. In the past i have used darlington arrays, which can be driven directly from the microcontroller. I now need to use a single npn transistor as a switch. In most applications that i have seen there is a biasing resistor being used.

I am wondering if i can bias the transistor without using a resistor to drive it directly into saturation. With a maximum output of 20ma from the ucontroller this seems resonable, but i am not sure.

If this does not pose a problem to the transistor or microcontroller can i use this practice in general, even when there is a non regulated amount of current that can flow into the base, where i dont care what the collector current will be and only care that the transistor is in saturation?

In general i would like to know what my limitations are and when i may end up damaging the transistor??

Thanks for your input.
Ah...biasing is for amplifiers, not switches. A series resistor from the PIC to the base of the transistor will hold it in cutoff when the pin is low. The PIC output will try to sink current but the transistor will provide only leakage current. When the PIC output goes high it will source several hundred microamps to several milliamps depending on the series resistor and the current sourcing ability of the PIC port pin.
Code:
Ib = (Vdd - 0.7) / R
Where R is the series resistor between the PIC and the NPN transistor. If the PIC pin becomes a high impedance input then the transistor cannot not sustain a Vbe of 0.7 volts and it will be cutoff.
 
If a PIC has a supply voltage of +5.0V and an output current of 20mA into a resistor in series with the base of a transistor, then the voltage at the output of the PIC will be below the supply voltage. What voltage will the output of the PIC be?

Looking at the curves of the outputs of 74HCxx logic ICs, if the PIC is the same then it looks like the output voltage of the PIC will be about +4.2V when it has a 20mA load.
 
I am wondering if i can bias the transistor without using a resistor to drive it directly into saturation.
Since resistors are so cheap, I see no advantage to doing this.
One problem you may run into is when you perform a read/modify/write operation on this pin. On some PICs there is no latch register and the CPU actually reads the voltage on the Output pin, does the logic function, and then writes the answer to the pin.
For example:
Your program writes the pin high.
Because of the VBE of the transistor, only 0.7 will be on the pin.
Your program performs the COMF function on the port; Your pin reads as a low because of the transistors VBE so the CPU mistakenly thinks it is being driven low and sets the pin high.
The result: no change in the pin state!
 
Most PICs have internal pullups, though they're generally pretty high (20-50k) which will limit you to about 250uamps at the low end. But really is a biasing resistor really that big a deal? And even if you're going to be driving the transistor in saturation it's a bad idea to leave absolutly no current protection on a transistors base.
 
Sceadwian said:
Most PICs have internal pullups.
Doesn't the pullup resistance apply when a pin is programmed to be an input?

Isn't a pin that is programmed to be an output a push-pull Cmos output with 25mA max allowed high or low current?
 
Last edited by a moderator:
The 25mA output limit is a limit, not a constant current regulator.

If you draw more than 25mA, you will risk damage the PIC output stage.
 
eblc1388 said:
If you draw more than 25mA, you will risk damage the PIC output stage.
Yeah. A guy posted a Mood Lamp project where the PIC was driving the bases of transistors without current-limiting resistors. A few guys who built it said their PIC worked for a minute then got very hot and stopped. One guy recommended adding resistors to limit the current from the PIC which worked and none of the hot PICs were permanently damaged.

The author of the Mood Lamp project posted his revised circuit on another site. But the value of his current-limiting resistors was way too high!
 
Thanks for all of the input!? I wouldnt hassle with trying to remove the resistor, but size in this design is the driving factor. Its clear that there are many variables to take into consideration which is driving me back to the books.

Yes, it wouldn't be nice to fed a transistor directly, use a series resistor - my tutorial 'Hardware Extras' section gives examples.

audioguru, where can your hardware extras be found??

Thanks!
 
fvnktion said:
audioguru, where can your hardware extras be found??
Nigel editted my post (and really messed it up!). His tutorial has the details.
 
Hi,
I have a similar question. I want to switch a 9 volts relay using transistor. I've measured the resistance of the coil, it is around 220:eek:hm:, so it needs around 40mA to be turned on. The datasheet of 2N3904 shows that the maximum Ic allowed is 100mA, so this transistor can be used. Usually base current should be 1/10th of the collector current, so 4mA. I connected a 2.2k:eek:hm: resistor at the base, when the other end of the resistor connected to the supply voltage, the relay can be switched.
How if I want to switch the relay using PIC? I mean, the value of the resistor being used. The output pin of PIC is 25mA, 5 volts, is the base current still 4mA if a 1.2k:eek:hm: resistor is connected? What about the V=IR, 25mA*1.2k=30v? Impossible. I'm confused which to be used.

Thanks
 
With only a 4mA load, the ouput of the PIC will be nearly +5V. The base resistor for the transistor will have +5V on the PIC end and +0.7V at the transistor's base end. Then use OHM's LAW to calculate the resistance needed:
(5V-0.7V)/4mA= 1075 ohms. Use 1k ohms.
 
Oh I see, thanks. So the load current cannot be more than 25mA isn't it? Or a Darlington pair is needed?
 
bananasiong said:
So the load current cannot be more than 25mA isn't it? Or a Darlington pair is needed?
The maximum current allowed from an output of a microcontroller or a 74HCxx logic IC is 25mA. Any more current into a load will break the output transistor or its wiring. I don't know how many simultaneous 25mA loads will cause the IC to overheat or to blow up its supply or ground wiring on the IC. A 74HCxx logic IC has a max current of 50mA for its supply or ground pins.

Your relay needs 40mA. The base of its driver transistor needs only 4mA and a resistor was calculated to provide 4mA. No problem.
 
That's certainly the way to do it but just a couple of tips that might be worth considering.
I have seen in many circuits where the device being switched (in this case the relay) is fed from a higher supply (9V) than the driving circuit (5V), a diode is inserted in series with the base resistor. I suppose it protects the driving circuit in the event of a collector-base short circuit. Just imagine what would happen if you were using a 24V Relay! :eek:
The extra volts drop across the diode should not effect too much the choice of a 1k resistor here.

Also, some transistors when switching circuits with a lot less current and particularly if they are fast pulses, benefit by having a resistor (say 47k) placed between base and 0V. This ensures a quicker turn off of the transistor when it is presented with a logic 0 condition.
I think adding the diode in your particular circuit would also require this additional base to 0V resistor
Regards
Les
 
This is Darlington pair right? Resistors are added across bases and emitters.

What happen if I want to switch higher current from the output of the microcontroller? Let's say 500mA, then the base current required is around 50mA. Any other method besides Darlington?

Thanks
 
bananasiong said:
This is Darlington pair right? Resistors are added across bases and emitters.

What happen if I want to switch higher current from the output of the microcontroller? Let's say 500mA, then the base current required is around 50mA. Any other method besides Darlington?

Use a higher gain normal transistor, use two transistors, use an FET.
 
bananasiong said:
This is Darlington pair right? Resistors are added across bases and emitters.

What happen if I want to switch higher current from the output of the microcontroller? Let's say 500mA, then the base current required is around 50mA. Any other method besides Darlington?

Thanks

You can use a MOSFET. You probably need a bjt to bias the gate though.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top