Shop OBEX P1 Docs P2 Docs Learn Events
Biasing Transistors in the linear region? — Parallax Forums

Biasing Transistors in the linear region?

xanatosxanatos Posts: 1,120
edited 2012-11-15 16:03 in General Discussion
I've been using transistors mostly as digital switches most of my life, but I want to start understanding them a little better for some of my analog projects. Here's an example:

I have a device that produces a smooth voltage ramp anywhere between 0 and 5vdc. I want to feed that to a transistor and have the transistor output anywhere between 0 and 24 vdc (obviously, I'm using a 24vdc supply on the collector side of the (NPN I'm guessing) transistor.)

Right now, I know quite well how to get the thing to give me a rapid switch at some point from 0 to full-on saturation, but that's not what I need - I need the output to follow the input, just over the greater range of the 24vdc supply.

I'm pretty sure there are op-amps that do this, but I'm looking to do it with a transistor or two, and some basic biasing calculations that will probably involve a few resistors. Who on here is a transistor guru that can point me in the right direction to get started in making a circuit or two that can do this? As well as how to select a transistor for the task - I'm not sure, but I am guessing my old faithful 2N2222 and 2N3904 devices are pretty much designed to function as switches, not as linear devices, correct?

Thanks!

Dave
«1

Comments

  • davejamesdavejames Posts: 4,047
    edited 2012-11-07 15:57
    Hi Dave,

    Guru I am not, but I know where to find the info. This site has helped a lot:

    http://www.electronics-tutorials.ws/transistor/tran_1.html

    BTW, both referenced xistors will operate in a linear region just fine.
  • xanatosxanatos Posts: 1,120
    edited 2012-11-07 16:14
    Thanks DaveJames! That's a FANTASTIC starting point, looks like I'll be able to figure just about everything out from there.

    THANKS!

    Dave
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-07 16:36
    Can I give you a great big heads up and tell you to use an opamp and two resistors as you will get guaranteed and reliable results. You won't do this with a single transistor but you could put that single transistor into the output of the 25 cent opamp as an emitter follower and it will amplify the current while the opamp worries about the voltage and multiplication thereof.
  • Mark_TMark_T Posts: 1,981
    edited 2012-11-07 16:51
    xanatos wrote: »
    As well as how to select a transistor for the task - I'm not sure, but I am guessing my old faithful 2N2222 and 2N3904 devices are pretty much designed to function as switches, not as linear devices, correct?

    Most NPN transistors behave like most others - unless you have special requirements (such as high gain, low noise, high current, high frequency, low Vsat, low leakage, high voltage). Check the voltage current and power ratings and gain are adequate, perhaps bandwidth matters too?

    For your circuit you can use a collector resistor about 5 times the emitter resistor - then the voltage drop across the collector resistor will be about 5 times the base voltage (less a Vbe drop). 0.7V in gives about 24V out, 3.7V in gives about 9V out... The emitter resistor provides negative feedback so the gain is fairly stable (but the output impedance is very high, unlike an opamp). The Vbe drop will depend logarithmically on the emitter current so will add a bit of non-linearity to the system.

    The only magic thing about a switching device is that its got low Vsat at reasonable currents and is usually fairly high speed - all the other parameters can be rather poor, but even a poor silicon bipolar transistor will work surprising well!
  • davejamesdavejames Posts: 4,047
    edited 2012-11-07 17:00
    xanatos wrote: »
    THANKS!

    Welcome man!
  • xanatosxanatos Posts: 1,120
    edited 2012-11-07 17:30
    Can I give you a great big heads up and tell you to use an opamp and two resistors as you will get guaranteed and reliable results. You won't do this with a single transistor but you could put that single transistor into the output of the 25 cent opamp as an emitter follower and it will amplify the current while the opamp worries about the voltage and multiplication thereof.

    Hi Peter,

    Part of my desire here is to learn more about using transistors in capacities that are not switching :-) That said, I really do need to get something working to do what I'm looking to do, and the output should be fairly low impedance as it's driving a load. I have about 40 pages of tutorial to read through, hopefully there is something in there about the emitter-follower configuration of which you speak. I've tried using op-amps in the past for similar things, but they all seemed to require way more than two resistors... The last op-amp project I tried used three 741s and about 40 resistors and capacitors and was jumpy as hell despite being on a really clean, well-designed PC Board. Is there a specific op-amp you had in mind that isn't as hairy? :-)

    Thanks!
  • xanatosxanatos Posts: 1,120
    edited 2012-11-07 17:35
    Hi Mark_T,

    Thanks for this info. The application is not critical on accuracy (within 10% is probably OK), so a bit of non-linearity is fine. Speed is also not an issue - this will probably change literally about 10% per day on average, so that's fine as well.

    Ultimately, I'm on another foray into learning something new that I've been on the periphery of for decades now... :-)

    Thanks!
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-11-07 17:44
    For what you want to do, look into using transistors in a current mirror configuration.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-11-07 17:45
    Hi Xanatronics:

    Try this:
    xanatos1.png

    Not exact but close.

    Duane J

    Hi Beau:
    OK, this is half of a current mirror.
    Like minds huh %*)
    280 x 236 - 4K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-07 18:41
    I gathered that you needed current as well as voltage so that is why I suggested the opamp with emitter follower which will definitely do the job. Now, why the heck are you using 741 opamps? I suppose that's what the analog engineer from the 70's included in his cookbook! Just use a plain old LM358 which is a dual single supply opamp in an 8-pin pack and you will be happy.
    977 x 560 - 18K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-11-07 19:07
    Here is something that combines Duanes approach using a current mirror, and Peter's approach with a higher output current. :-)

    5TO24JPG.jpg


    Edit: Ignore the output stage of this circuit... see below
    1024 x 569 - 44K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-07 19:19
    Um, Beau, the "final" in the circuit you've shown is not an emitter follower. In fact, its base current could be excessive.

    -Phil
  • jmgjmg Posts: 15,175
    edited 2012-11-07 19:20
    xanatos wrote: »
    I have a device that produces a smooth voltage ramp anywhere between 0 and 5vdc. I want to feed that to a transistor and have the transistor output anywhere between 0 and 24 vdc

    You can get close, with what I knew as a Augmented pair, called Sziklai_pair by Wiki.

    http://en.wikipedia.org/wiki/Darlington_pair
    http://en.wikipedia.org/wiki/Sziklai_pair

    If you need 0-5 : 0-24 you need a gain of 4.8, and so a resistor of 5K from NPN Emitter to GND, and 19K from PNP collector, to NPN emitter, will give you 24V out for 5V on the emitter.
    This will be (nominally) linear, and can source current determined by the NPN emitter resistor & the PNP device gain.
    Current sink is much lower, just the pull down resistor.

    The problems come in the details : if you want to go to 0V, the Vbe of the NPN needs to be offset, using either a Diode, or an identical NPN device, wired as a Diode, or a PNP device as a Emitter follower level shifter, with a pullup to Vcc
    That nominally removes the Vbe effect, but it it still likely to be less than ideal, close to zero unless you have a negative supply.

    So you can get reasonable DC transfer performance with 3 transistors and 3 resistors, but may decide an OpAmp + 2 resistors is easier....

    (Schematic added) Q2.Q3 are the Augmented Pair, and Q1 is just a DC level shift. Assumes Vbe(pnp) is equal to Vbe(npn)
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-11-07 19:30
    Phil.... Dohh!! Dang Spell CHeck ... I mean Spice Check..... The simulator didn't complain Hmmmm, that's scarey

    Ok, here is a revised - simplified circuit
    5TO24v2.jpg
    1024 x 826 - 55K
  • jmgjmg Posts: 15,175
    edited 2012-11-07 19:33
    Here is something that combines Duanes approach using a current mirror, and Peter's approach with a higher output current. :-)

    5TO24JPG.jpg


    Edit: Ignore the output stage of this circuit... see below

    This circuit has a dead-zone from 0v to Vbe, and it does not give 24V out for 5V in.
  • xanatosxanatos Posts: 1,120
    edited 2012-11-08 07:53
    This has been a great bunch of information here! Thank you all very much. This is bringing me wayyy back to when I first got into solid state electronics (I started with tubes when I was a little kid!) For better or worse, I fairly quickly wandered into the digital realm and never really got deeply into transistor biasing. This is opening up a whole new world of possibilities for me in exploring stuff I should have explored 40 years ago!

    Thanks again, and I'm always open to more cool ideas and tricks with transistors like these.

    Dave
  • davejamesdavejames Posts: 4,047
    edited 2012-11-08 08:12
    Well, hey - if you're already familiar with tubes...:thumb:
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-11-08 10:38
    xanatos, did you understand well the circuit jmg attached to post #14 and his shorthand explanation? It is a great example for transistors and feedback.
  • Mark_TMark_T Posts: 1,981
    edited 2012-11-08 13:40
    I gathered that you needed current as well as voltage so that is why I suggested the opamp with emitter follower which will definitely do the job. Now, why the heck are you using 741 opamps? I suppose that's what the analog engineer from the 70's included in his cookbook! Just use a plain old LM358 which is a dual single supply opamp in an 8-pin pack and you will be happy.

    Just a little erratum: your schematic implies the LM358 can take upto a 35V supply, whereas its rated for 32V max.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-08 14:13
    Mark_T wrote: »
    Just a little erratum: your schematic implies the LM358 can take upto a 35V supply, whereas its rated for 32V max.
    My bad, just did the circuit off the cuff and the values are to show that there needs to be a minimum and a maximum which should be more like 26.5 to 32 although a nominal supply of 28V would be fine.This circuit can be used as a variable power supply and it would work the same with a Propeller except for a change in the gain ratio and an addition of an RC filter for the Prop's DAC.
  • xanatosxanatos Posts: 1,120
    edited 2012-11-08 15:28
    xanatos, did you understand well the circuit jmg attached to post #14 and his shorthand explanation? It is a great example for transistors and feedback.

    Hi Tracy,

    Can't say I understand it *well*, but as I look through it I am understanding it better. I found the configuration interesting as I've used Darlington's before to really amplify signals such as from IR phototransistors. I can see what's happening in a transistor circuit, usually, as I can for this example, but what eludes me is how the proper values are selected, quite often. This is probably one reason why I got into digital electronics. Using a transistor as a switch is much simpler! :-) Recently, I worked on a circuit that had two transistors configured to create a constant-current source, such that as one transistor started to turn on more, it fed back to the other transistor, which controlled the first transistor's base and kept it basically exactly in teh same spot, current-wise. It was a clever arrangement and very visible when looking at it. The Sziklai pair is equally visible to me, however, I have no idea how it is arrived at that that relationship exists between the resistors. This is somewhat embarassing to me as when it comes to microcontrollers, I can work magic at the top end of the scale (thanks to the ideas over the years from so many of you!), but when it comes to something as simple as transistors, I feel like a complete novice! Thanks everyone for all the incredibly useful help!
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-11-08 19:22
    Hi xanatos;

    The operation is nearly identical tp Peter's op-amp circuit in post #11.
    Its an non-inverting voltage amplifier with a resister divider feedback.
    In jmg's circuit the gain is (19K + 5K) / 5K = 4.8. So 5 * 4.8 = 24.

    While yes, Q3 R1 looks like a current source that's not the way to think about it.
    Q1 Q3 copies Vin to R1. However, the Sziklai pair also injects current into R1
    which reduces the current from Q3 a very small value.
    So what ever current passes through R1 is the same as through R2 resulting in
    a voltage gain.

    This is a very slick circuit!!!!!!!!!

    Duane J.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-11-09 00:35
    I don't think it's helpful to view this as a Sziklai connection, which is a specific high gain composite transistor.
    Sziklai.png



    Here is the circuit under consideration with the added resistors and power supplies.
    moreAmp.png

    Like the Sziklai it has the NPN and the PNP, but the main show is due to the power supplies and feedback through the resistors.

    First there is a PNP emitter follower Q1 at the input The voltage V1 is about 0.6V higher than Vin.
    V1 = Vin + 0.6
    It will serves as a level shifter to compensate for the -0.6V shift that comes up in Q3.

    Suppose Vin jumps from 0 up to 1 volt. Current then builds up through the base of Q3, and current in the collector-emitter circuit of Q3 follows suit. That current in turn causes Q2 to turn on (in the analog sense), and the voltage at the top of R2 rises toward the positive power supply. How far? As it rises, the voltage divider formed by R1 and R2 is causing an increase in the voltage V2 at the emitter of Q3. Negative feedback. As that voltage approaches 0.6V less than V1, Q3 turns off (again, in the analog sense), reducing the base current to Q2 and stopping further increase in Vout. It comes to an equilibrium point at a point with about 0.6V from base to emitter of Q2.

    If only the current I2 flows through the resistor R2 and R1, then the standard voltage divider equation applies to find the voltage at V2. More about the approximation in a minute. But if we can ignore I1, then
    V2 = Vout * R1 / (R1+R12)
    Rearranging and substituting:
    Vout = V2 * (R2/ R1 + 1)
    = (V1 - 0.6) * (R2/ R1 + 1)
    = Vin * (R2/ R1 + 1)
    Which with the resistors shown gives the necessary gain of 19/5 + 1 = 4.8.


    To be more accurate, V2 depends on more than just the R1/(R1+R2) voltage divider. The current through R1 is the sum of I2+I1. It is not a bad approximation to say I1=0 though, because the current I1 is related to the current I2 divided by the current gain (beta) of the output transistor Q2. A factor of ~100. It can be worked out from a next-step analysis starting with this equation.
    V2 = (I1 + I2) * R1
    One big effect would come from additional current drawn by an external load attached at Vout. Additional output current would also increase I1. For that reason, one might add an emitter follower at the output in order to isolate the load.

    There are a host of other relatively minor effects that would be handled by a Spice analysis with good device models. However, I believe it is important if possible to have an intuition about how the circuit works and a first cut at a quantitative analysis before handing it over to the black box.
    252 x 114 - 4K
    274 x 264 - 19K
  • xanatosxanatos Posts: 1,120
    edited 2012-11-11 17:19
    Tracy,

    Thanks VERY much for your very thorough walk-through on that circuit. It was very helpful. I agree with you wholeheartedly about having intuitions about circuits - that is how I have operated for decades. I have never used Spice and usually can put a circuit together just from memory and educated guesses at parts and get it right on the money most times. Of course, 90% of what I do is digital, so it's not that complicated :-)

    I'm really enjoying learning more of the linear/active region for transistors. Writeups like this are VERY helpful and very much appreciated!

    Thanks,

    Dave
  • xanatosxanatos Posts: 1,120
    edited 2012-11-14 18:03
    I gathered that you needed current as well as voltage so that is why I suggested the opamp with emitter follower which will definitely do the job. Now, why the heck are you using 741 opamps? I suppose that's what the analog engineer from the 70's included in his cookbook! Just use a plain old LM358 which is a dual single supply opamp in an 8-pin pack and you will be happy.

    Hi Peter,

    I've been looking at your schematic (Post #11) with the LM358. I'm sort-of following this, but it differs from what I know of non-inverting configurations of LM358s in a couple of ways, namely the fact that the 1K resistor (R3) would effectively be in parallel to the 1.8k and 6.839k. Is this to compensate for the Vbe of the Q? I am confused... a bit. Care to elaborate? I'm very familiar now with the standard two-resistor voltage divider form (where the ratio of the resistors determines the V gain, such as 20k and 5k yielding a 4x V gain) - but that 1k resistor is confusing me. The 1.8k and 6.839k form the usual voltage divider configuration, but what the 1k does - especially with a 250 ohm load resistance - is a mystery to me :-)

    Thanks for any guidance you can provide here.

    Dave
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-11-14 19:14
    Hi xanatos;
    xanatos wrote: »
    Hi Peter,

    I've been looking at your schematic (Post #11) with the LM358. I'm sort-of following this, but it differs from what I know of non-inverting configurations of LM358s in a couple of ways, namely the fact that the 1K resistor (R3) would effectively be in parallel to the 1.8k and 6.839k. Is this to compensate for the Vbe of the Q? I am confused... a bit. Care to elaborate? I'm very familiar now with the standard two-resistor voltage divider form (where the ratio of the resistors determines the V gain, such as 20k and 5k yielding a 4x V gain)
    Actually 20K and 5K would result in 5X.
    - but that 1k resistor is confusing me. The 1.8k and 6.839k form the usual voltage divider configuration, but what the 1k does - especially with a 250 ohm load resistance - is a mystery to me :-)
    The 1K is not part of the feedback network. Its simply a load to allow the output to have a faster fall time.
    The 1.8K and 6.839K is the feedback network = 4.8X

    BTW, I recommend a signal diode connected from the emitter to base on the output emitter follower transistor.
    Anode to the emitter cathode to the base.
    This is to prevent damage to the base of the transistor, if there is a high capacitive load, which generally have a limited breakdown voltage.


    Duane J
  • xanatosxanatos Posts: 1,120
    edited 2012-11-15 07:51
    Yes,,, 5x, I forgot in the post to add the 1... (1 + R2/R1)

    :-)

    I guess what's getting me is that the 1k is effectively in parallel with the 1.8 & 6.8, but I am guessing that in this circuit it's only the fraction of current that passes through that 1.8 & 6.8 leg that is being monitored by the 358, despite the fact that the total resistance between Q1's emitter and ground is less than 1k in total with that load resistor, am I correct?

    Thanks,

    Dave
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-11-15 08:24
    ...it's only the fraction of current that passes through that 1.8 & 6.8 leg that is being monitored by the 358

    That is the crux of the matter. No matter what load you put on the output, even a variable load, the op-amp will drive the transistor in exactly the right amount to maintain the voltage at its two inputs equal to one another, and that means a constant voltage into the pair of feedback resistors at the emitter output junction.

    I found Duane's comment about the extra reverse emitter-base diode interesting. The base-emitter junction of a NPN bipolar transistor, when reverse biased, acts like a zener diode with a breakdown of about 7 volts. If there is a reactance on the output (long cable?), and the input suddenly drops to zero, there could be a transient reverse breakdown condition in the transistor. Not for long with a 250Ω load, though. Food for thought. A high breakdown diode in series with the emitter to the load, rather from emitter to base, would be an alternative way to forestall that breakdown I think.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-11-15 10:24
    You could combine them and use only 2 resisters:
    187 ohm and 710 ohms.

    Duane J
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-11-15 10:52
    Hi Tracy;
    I found Duane's comment about the extra reverse emitter-base diode interesting. The base-emitter junction of a NPN bipolar transistor, when reverse biased, acts like a zener diode with a breakdown of about 7 volts. If there is a reactance on the output (long cable?), and the input suddenly drops to zero, there could be a transient reverse breakdown condition in the transistor. Not for long with a 250Ω load, though. Food for thought. A high breakdown diode in series with the emitter to the load, rather from emitter to base, would be an alternative way to forestall that breakdown I think.
    I was once trying to make a 2 terminal bi-directional current source with an NPN and PNP transistor pair. This circuit had current going through the emitter-base in the reverse direction. I was unsuccessful in making it work, but that's another story.

    I noticed the gain of the transistor had changed. But why? It still worked, just different. I then searched the literature, pre internet, and found others that had seen the problem. Apparently, the emitter-base is neither a zener nor an avalanche diode. Apparently the base structure is quite small and can be damaged with currents as small as 100uA.

    Yes, there are transistors that specifically can be used as zeners. I think it's good practice to not let this condition occur. Hence the anti-parallel emitter-base protection diode. Most specs tell us what the voltage is but they never say what happens if we exceed it.

    Duane J
Sign In or Register to comment.