How do transistors **function**? - Page 1
Forum section: electronics / beginners

author: Renegade
author_rank: Regular Contributor
timestamp: March 06, 2016, 04:18:25 am
content: I'm a newb, so please be gentle. My background is in computer programming.I understand **how** transistors **work**, but not really how they **function**.I get that NPN and PNP transistors allow electron flow or don't allow electron flow, i.e. how they work.But for the function, do they function like conditionals in a programming language?Is the base (or gate?) like the "if" clause, where applying a voltage (defined in the datasheet for the transistor) is equivalent/analogous to setting the "if" clause to "true"? e.g.:Code:if (base voltage >= X volts) {allow electron flow from collector to emitter;}Am I understanding this about right? Or where am I going wrong?

author: amyk
author_rank: Super Contributor
timestamp: March 06, 2016, 04:22:14 am
content: https://en.wikipedia.org/wiki/Bipolar_junction_transistor#Large-signal_models

author: Renegade
author_rank: Regular Contributor
timestamp: March 06, 2016, 04:32:45 am
content: Quote from: amyk on March 06, 2016, 04:22:14 amDo you know of a tutorial that explains that for a beginner?

author: IanB
author_rank: Super Contributor
timestamp: March 06, 2016, 04:36:09 am
content: Quote from: Renegade on March 06, 2016, 04:18:25 amIf you start thinking about electrons you will get confused. Forget that.In electric circuits the two quantities of interest are voltage and current. Whenever you think about how circuits work, it is voltage and current you should have in mind.As for transistors, they are not on/off (conditional) devices (though they are sometimes used that way). Transistors are analog devices (think floating point variables rather than booleans). The relationships between voltage and current at the various terminals of a transistor are modeled as a floating point functions where a range of input values produces a range of output values.

author: pmbrunelle
author_rank: Regular Contributor
timestamp: March 06, 2016, 04:38:22 am
content: Transistors don't exactly work as binary if/else things. Welcome to analog electronics, the world of continuity...Study datasheets of jellybean parts, such as 2N3904, and then look at the different curves which describe the parts' function.However, start by learning how a diode works first. So start by studying datasheets for the 1N400x, look at Vf vs If, etc...

author: Renegade
author_rank: Regular Contributor
timestamp: March 06, 2016, 04:43:16 am
content: Quote from: IanB on March 06, 2016, 04:36:09 amThanks. That helps make more sense of things.If I understand that right, whatever values for voltage and current are at the C/B/E will affect the other C/B/E, right? And the datasheet will tell me what the "function" (as in a mathematical function) is for those, right?Quote from: pmbrunelle on March 06, 2016, 04:38:22 amI ordered a set of transistors, and just built a simple circuit with a 2N3904, so I'm glad you mentioned that one. I'll print off the datasheet and examine the circuit more to see what's going on.Vf vs If - I'll print off one of those datasheets and check that out.Thanks again for the answers. What I'm really looking for is stuff to point me in the right direction, and you've all helped.

author: IanB
author_rank: Super Contributor
timestamp: March 06, 2016, 04:46:45 am
content: Quote from: Renegade on March 06, 2016, 04:43:16 amBroadly speaking, yes. The function may be presented as a graph with current or voltage on each axis, or in some cases the datasheet may just give parameter values for a particular standard model such as the ones described in the Wikipedia article.Coincidentally, forum contributor W2AEW just recently did a video where he electronically traced out some characteristic graphs of a transistor on an oscilloscope:

author: Renegade
author_rank: Regular Contributor
timestamp: March 06, 2016, 04:54:39 am
content: Quote from: IanB on March 06, 2016, 04:46:45 amThanks. I've printed off those datasheets, and will be studying them.Quote from: IanB on March 06, 2016, 04:46:45 amOh, he's got a great channel! I subscribed a while back. Not that I understand everything he's talking about yet, but that will come with time. I'll check that video out after I peruse these datasheets.Thanks again!

author: amyk
author_rank: Super Contributor
timestamp: March 06, 2016, 05:02:05 am
content: Quote from: Renegade on March 06, 2016, 04:32:45 amThose are just the equations that (approximately) result in the graphs you see in the datasheets.

author: Shadetreeprops
author_rank: Regular Contributor
timestamp: March 06, 2016, 05:02:47 am
content: I am new as well, do not feel bad at all, i am still waiting for the full mental click that opens up transistor understanding to me.my current basic knowlege consisits of knowing that. dpending on the transistor NPN, Negitive positive Negitive, or PNP, Positive Neg, Positive...have diffrent uses.I think of them right now as voltage controled GATES, that you apply voltage to open the flood gate and let the current flow.PNP will have use becasue postive flows to positive. and NPN will control the flow diffrently.But right now i use them as a timed gate to allow flow at a timed intervals, to allow the current to flow at the rate or time i need them to, and to what components at the right time.Best explination i have heard, its a one way check valve, much like a dioed, but the vlave will only open when voltage is applied to it. PNP to my understanding flows A to C, when voltage is applied to B..and NPN flows C to A when voltage is appiled to B. there are several youtube videos that will help you understand them. so that is what i spend my time doing when i do not understand..but i currently think of electronics as flowing water pipes and each peice makes the water flow the way i need it to preform functions i need it to....or to get a insteresting understanding....MINECRAFT REDSTONE....vannilla style not modded... you have T flip flops, and, or, and or and xor gates. clocks, comparitors, so on and so forth...

author: pmbrunelle
author_rank: Regular Contributor
timestamp: March 06, 2016, 05:08:59 am
content: In case it's not already clear, the base-emitter junction of a transistor is a silicon diode.The collector-emitter characteristics are controlled by the voltage & current of the base-emitter junction.So a transistor is like a diode, but with extra features. Thus it makes sense to understand silicon diodes first, before tackling the transistor.If you can't make a diode sing and dance the way you want in a circuit, hold on before moving to transistors.

author: Shadetreeprops
author_rank: Regular Contributor
timestamp: March 06, 2016, 05:19:11 am
content: Quote from: blueskull on March 06, 2016, 05:09:56 amThank you blue, i will be adding that to my collection

author: amyk
author_rank: Super Contributor
timestamp: March 06, 2016, 05:26:51 am
content: To a first approximation, a transistor is a current limiter. In a BJT, current through the base determines how much current can flow between the collector and emitter. Consider a BJT with a constant base current, and increasing the voltage between collector and emitter while measuring the same current - at first it will rise almost linearly, like a resistor (this is known as thesaturatedregion), and then flatten off (theactiveregion) at some value of current that is a multiple of (thegain) of the base current, and further increases in voltage result in very little additional current increase. This is the most common graph you'll see if you look for "transistor characteristic curves"The other scenario is varying the base current while the Vce is kept constant, and measuring the Ice - this shows that Ice is almost exactly proportional to Ib, and the slope of this line is the gain.

author: ez24
author_rank: Super Contributor
timestamp: March 06, 2016, 05:33:46 am
content: If you have time go through these posts, there might be something there that can helphttps://www.eevblog.com/forum/beginners/electronics-primers-course-material-and-books/

author: Renegade
author_rank: Regular Contributor
timestamp: March 06, 2016, 05:34:21 am
content: Quote from: Shadetreeprops on March 06, 2016, 05:19:11 amOuch! At over $200 USD, I won't be adding that... (for now -- I can't justify that expense)Quote from: Shadetreeprops on March 06, 2016, 05:02:47 amOh, I never feel bad. This isn't my area of expertise (obviously), but I'll get there eventually. I'm an autodidact, but not really rising to the level of a polymath.Quote from: Shadetreeprops on March 06, 2016, 05:02:47 amThe water flow example seems to make sense for me. But I'm having trouble finding a tutorial that explains it in analogous terms. All the tutorials seem to jump right into electricity with no comparisons.Quote from: pmbrunelle on March 06, 2016, 05:08:59 amThat's where it just doesn't make sense to me and I don't understand. The part I don't get is "the base-emitter junction". Looking at the transistor, I see 3 discrete leads that are all capable of input/output. What the "base-emitter junction" is eludes me. How am I to know where the voltage/current goes from any given input/output? I think this is the root of my confusion -- I don't understand how the "flow" works. I know that it is deterministic, but I don't know the rules for that, and so far have not been able to find anything that explains it. It's like some secret society that I'm not a part of.Quote from: pmbrunelle on March 06, 2016, 05:08:59 amFair enough. Perhaps I should take it back a notch. Can you recommend some kind of a tutorial that could help? I learn very well from Youtube videos, and especially if they have written materials to go along with them.Again, thanks for the help.

author: IanB
author_rank: Super Contributor
timestamp: March 06, 2016, 05:59:49 am
content: Quote from: Renegade on March 06, 2016, 05:34:21 amYou can think of a (bipolar junction) transistor like a sandwich. The collector and emitter are the two slices of bread and the base is the filling. The main current flows between the collector and emitter and a small additional current is diverted in or out through the base. So the base-emitter junction is the junction between the filling of the sandwich and the slice of bread forming the emitter.

author: Renegade
author_rank: Regular Contributor
timestamp: March 06, 2016, 06:31:21 am
content: Quote from: IanB on March 06, 2016, 05:59:49 amSo, when people talk about the collector-emitter, what they mean in other words is the combination of the collector-base and the base-emitter junctions, right? With "junction" just meaning a connection between the two, whatever they are.

author: Shadetreeprops
author_rank: Regular Contributor
timestamp: March 06, 2016, 07:19:11 am
content: Quote from: blueskull on March 06, 2016, 05:54:33 amor do what i did, get a PDF viewer, and go download it for free from prirates bay..like i did for the more expensive books. art of electronics.

author: forrestc
author_rank: Unknown
timestamp: March 06, 2016, 07:27:29 am
content: Quote from: Renegade on March 06, 2016, 04:18:25 amNo, it's math, here it is, oversimplified:CurrentPermittedFromCollectorToEmitter = CurrentFlowingFromBaseToEmitter * hFe(DCCurrentGain);Let's assume you have a perfect transistor with no maximum current or power dissipation rating (for ease of the discussion - but remember these do not exist).Let's also assume that this has a hFE of 100 throughout it's operating range (also not likely true, but again, this is to build a model in your head).Then assume you hook a power supply across the Collector and Emitter (Assume a NPN here - positive would go to the collector, negative to the emitter).... and then hooked a current source from the base to the emitter, so you could put a current in the base and it would come out the emitter.If you put 1mA of current through the base, the transistor would allow 100mA of current through the collector->emitter junction. With 10mA in, the transistor would allow 1000mA through the emitter/base, and so on.Realize this is an 'up to' value. So if, say the power supply was limited to 1000mA of current, adding more current to the base would not increase the current from collector to emitter. Transistors used in switching mode are used in exactly this manner. For instance, to turn on a higher current device (for instance a high current LED or a relay, or something similar) using a low-current capable source (such as an output pin on a microcontroller), you would run the low current signal through a resistor and into the transistor's base. The resistor limits the current flowing into the base to some value (see ohms law, I = V/R). The resistor is selected to ensure that there is plenty of current through the base to ensure that when applying the math above, the transistor will permit enough current through the collector/emitter junction.For example, if you wanted to switch the power on for a load which takes 100mA, you would need to make sure you have at least 1mA of current flowing through the base to turn the transistor on fully, assuming a transistor with a hFE of 100. If you are running 3.3V logic, you would immediately think that you'd need to use a 3300 ohm value (3.3V/1mA=3300Ohms) , but in reality the transistor has a bit of voltage drop, and you also want to make sure things are fully on, so you'd probably use something more like a 1Kohm value which would result in a bit more current through the base to ensure the collector-emitter junction is fully on. At this point, the load could draw as much as it wanted assuming it doesn't exceed the transistor ratings (and the amount of current permitted due to the hFE relationship)When you use a transistor not in switching mode - i.e. for amplifying an analog signal - you generally 'bias' the transistor in a way which helps it automatically stay in operation range. I've assumed a 'perfect' transistor above. In reality, a transistor is much messier. The gain can and does vary at temperature, voltage and current. There's leakage and gain bandwidth and noise figures and a whole bunch of other parameters to consider and so on. These all can and do vary from transistor to transistor as well. As a result, you can't really use any of the figures as an absolute - for instance, if you were to design a circuit which relied on the transistor gain to be exactly the same all the time, you would find that your circuit wouldn't work very well because you can't rely on that value to be set. Instead, you have to arrange your circuit to self-correct.For example, a common circuit I use is a emitter follower. Instead of going into details (you can read about it athttps://en.wikipedia.org/wiki/Common_collector), what you need to know is that if you arrange a transistor in this circuit arrangement, the voltage in and out will be (approximately) the same, but the output will have a much increased current drive capability. There are lots of these 'standard' arrangements which work, but they all have a separate function.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 06, 2016, 04:45:32 pm
content: Anif-thenprocedural explanation is subtly difficult and very dangerous to attempt.Consider first of all, what happens if we should use a binary condition:if (Vin < VBE)Vce = 0;elseIc = 0;that is, a basic switch.Then, as soon as we try to look a little bit closer, we see myriad nonphysical and undesirable effects.First: a real transistor is continuous. This is explicitly discontinuous. If we should put resistors around it, so that a variable input Vin should yield a proportional Vout or Iout, then every time the above statement evaluates, it will flip, fully from 'off' to 'on'. The frequency is limited only by how fast the statement can be evaluated. How should we even define that frequency? Should it be implementation-dependent (i.e., how fast a CPU we simulate upon)? Should it be at a fixed 'heartbeat'?This is all very arbitrary, and ineffective anyway. A real transistor is proportional (sort of) and does not oscillate. Reality is also continuous-time; at best, you can only approximate this with a discrete-time simulation method.To achieve this, you must identify a limiting time constant: an interval of time, during which, no significant change can occur. Knowing this, you can define an output, which is proportional to the input, and to the output, and their rates of change, and which will never change more than a nominal amount between evaluations (certainly not fully on-to-off as the most basic case!).This gives you a function which is executed for each 'event', but you need a system to keep track of how often the events need to be scheduled.Basically, all of this is compiled into a comprehensive numerical system: SPICE. A SPICE circuit is a netlist, a list of components connected between nets. The nets form rows and columns in a matrix, and the components correspond to connections from a row to a column (and vice versa, because of conservation laws: currents and voltages must add up properly). The matrix is a compact format describing a dynamic system (i.e., a function of many variables, which evolves over time). The mathematical analysis consists of performing a matrix inversion, to calculate the voltages and currents in the next timestep (event, as it were), and so on. At each step, the rate-of-change is evaluated, so that a small enough timestep can be chosen to prevent it from devolving into nonsense (which doesn't always work*). One must use continuous functions, because a discontinuous function implies infinite rate-of-change, which breaks the system.*You can set up an oscillator, which should have a rate of change characteristic of its period, but which doesn't start because the perturbations are too small at the initial timestep. The system is unstable (sitting at some bias point, ready to slide off and begin oscillating), but the change between events is too small and truncated as numerical error. These systems need to be set up with a perturbation, so the error becomes large enough to persist, and the system begins to oscillate.So, for simulating a basic transistor, it's not simply that you can have a function. You need a comprehensive system that is capable of evaluating that function at the right time!(By the way, the functions used by SPICE come from the Gummel-Poon model, for the BJT. Usually, it's good enough to use an instantaneous V(I) function, toned down with some capacitances and resistances. These are all included in the SPICE primitive BJT model.)Tim

author: simpson
author_rank: Contributor
timestamp: March 06, 2016, 09:37:19 pm
content: It's the little man inside every transistor that does the work according toThe Art of Electronics.The little man watches the current flowing from B to E and he adjusts the current flowing from C to E accordingly.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 06, 2016, 11:28:15 pm
content: Of course, not to miss the central conceit, which they explain about that figure: it's not really a variable resistor, because that implies that the output voltage and current are proportional. But it's really not, it's much more of a current source (or sink, if you prefer). But only when the voltage is positive by some amount, as it won't pull below Vce(sat), so that's a better model but still over a limited range.And, although it's true that hFE works, the trouble is that hFE itself varies with current, so Ic = hFE(Ic) * Ib, which gets a little less useful! A very elegant, and much more useful function, is: Ic = Is * exp(Vbe/Vth*N). (Ib follows the same rule, but with its own Is, which is why hFE is relatively constant, but fluctuates.) This, too, is only true in the "linear" range, for Vce above Vce(sat).The next most accurate model is the Gummel-Poon model, which includes an explanation of saturation and inverted (Vce negative) behavior. And there's probably some further modifications for unconventional aspects (planar construction on an IC has in-plane and "sidewall" parts), and for graded and compound junctions (like HBTs), and tweaks for other semiconductors. And the various kinds of FETs which are so very important today).Tim

author: tggzzz
author_rank: Super Contributor
timestamp: March 07, 2016, 12:00:12 am
content: Quote from: Renegade on March 06, 2016, 04:43:16 amSince you are a softie, you should realise it is not a function in the software sense. Instead, think of a set ofsimultaneous equationsrelating the voltages and currents at each terminal.Now some of the coefficients in the simultaneous equations indicate a strong simple important coupling between variables, and some a weak unimportant coupling. The datasheetswillgiverangesfor the strong simple important coefficients. The datasheetswill notdiscuss the simultaneous equations, but will assume you know how the important coefficients affect the operation. For the significance of the coefficients and equations, you will have to look at a textbook.Much of electronic engineering is learning how to design circuits such that the coefficients are relativelyunimportant.

author: vk6zgo
author_rank: Super Contributor
timestamp: March 07, 2016, 02:06:27 am
content: Quote from: simpson on March 06, 2016, 09:37:19 pmSpot on!Almost every amplifying device,BJT,vacuum tube,FET or whatever,is really a variable resistor,used in a voltage divider circuit connected across a dc supply.Some mechanism (usually not a "little man") allows an input signal to control the resistance of the tube,transistor,FET,etc,thus causing the voltage drop across the amplifying device to "mimic" that of the input.Back in the day,a device called a "carbon microphone" existed.This varied its resistance with the incoming sound of the user's voice.Early attempts at amplification used a carbon mic feeding a telephone earpiece,which in turn spoke a bit louder into another carbon mic,which fed another earpiece speaking into another mic,& so on,until the last oneyelledinto the carbon mic!They got audio gain,but the distortion was horrible,even when they combined the earpiece/mic setups into modules.The next trick was to make devices where the change of resistance was caused by an electrical signal,not by a yelling earpiece!Enter the vacuum tube!