# Basic electronics: Transistor switch

I am new to electronics. I am reading this book called Practical Electronics for Inventors.

This is a portion about bipolar transistors from the book: There are two things I don't get from this:

1. When the switch is thrown to the "on" position, I think $$\I_{B}\$$ should be:

$$I_B = I_{R_1} = \frac{V_{cc} - V_B}{R_1} = \frac{V_{cc} - 0.6}{R_1}$$

Supposing $$\V_{BE}\$$ = 0.6V. Why does the author have $$\I_B = 0.6/R_1\$$ ?

1. When the switch is thrown to the "off" position, why do we need R2? How about this: If the author has to have R2, I still have a question: How does the current can goes from the collector to the base to R2 to ground? Look at this: I think the current would have trouble if it wants to follow from collector to base because there is a NP junction between the collector and the base. How does the current flow when the switch is "off" with R2 in the circuit?

• 1.incorrect formula. 2. Switch could ground base with no R2. As noted, floating base may allow leakage to turn on transistor in some situations. Jul 28 at 9:27
• Also really, do not ever think that current goes down the collector to the base (at least in this circuit configuration and with a working transistor) Jul 28 at 9:50
• Also, Vce is about 0.2 V when the transistor is fully on, so Vc will be 0.2 V above Ve, not 0.6 V as stated in the book.
– tim
Jul 28 at 10:33
• Dat - As an FYI, I recommend you search online for "practical electronics for inventors" "errata" then download the relevant one(s) for whichever edition of the book you have. Several are available (free). Jul 28 at 15:23
• Wow that's an abysmal error from such a popular book. Maybe you are using an old edition? R2 is used as a weak pull down here. It never hurts to have it, in case some accidental short happens. Jul 28 at 21:01

1. You are correct. The book is wrong, strike one.

2. Again, you make a good point - current can't flow out of the base (OK, it can, but it's picoamps, nanoamps at worst, just leakage current). However, while it's unlikely that leaving a bipolar transistor's base unconnected will cause any great current to flow (either into the base, or from collector to emitter), it is possible. The base is a relatively high impedance, and it's easy to couple current into it capacitively (from your own body in its vicinity), or electromagnetically (like an antenna). If the load being driven were less heavy, such as an LED, you would probably be able switch the LED on by just touching the base with your finger, injecting current into the base (thereby also raising its potential), current which is coupled capacitively to your body from the mains wiring around you. I've had fun making touch sensors this way. The author uses R2 to prevent that from happening, but actually that's an extra, unnecessary component. Connecting the base directly to ground would have the same effect, holding the base potential at zero. I think that's strike two for this book.

3. I know there's no question three, but I'm going to answer it anyway. The author states that the relationship Ic = hfe × Ib holds true unless Vc drops below 0.6V above Ve. This is also incorrect. It holds true right up until saturation, at which point the collector voltage is only 0.2V higher than the emitter (or somewhere in that vicinity, depending on the transistor - some transistors are better than others in this respect). That's strike three. It is most definitely out.

• Witty answer... In addition to these AC sensor switches, I would add a DC sensor switch - touch with one hand Vcc and with the other the transistor base:-) Jul 31 at 20:30
• @Circuitfantasist As a boy I made a "switchboard" by connecting alternating strips of a Veroboard, and using the finger pressed on them to bridge the strips and switch transistors on in that "DC" way. Ah, nostalgia. Aug 1 at 1:54
• The author makes me confused, he said: "R2 should be large so that very little current flows to ground". Does that mean: from the author's point of view, if we connect the base to ground by a wire (R2 is small) then there is a larger current flows to ground, then where does this larger current come from?
– Dat
Aug 1 at 4:20
• @Dat: You have well understood the author's claim, but the author is wrong. No current will flow to ground (except a tiny, tiny leakage current) because the base cannot source current. In other words, no current can leave the base and flow down to ground, because the transistor does not operate that way. Current can enter the base, but not leave, because it's effectively a diode. Disregard the author's opinion here, it's wrong. Aug 1 at 5:31
• @SimonFitch great, I understand now
– Dat
Aug 1 at 5:45

For the point 1) the current loop is VCC, R1, and the VBE junction which is more-or-less a 0.6V diode for most practical purposes.

So you have VCC=I*R1+VBE and the book has a serious mistake…

For the second point, you current diagram is wrong: you can't pull collector current from the base (in the usual biasing mode!). When you switch an NPN transistor you put current thru the VBE junction and it gives collector gain.

Turning it off empties the VBE junction from whatever charge remains and stop the collector flow. In practice with an open base you would only have the collector cut-off current (about 100nA, usually trascurable) but from parasitics some current could leak into the base and turn on the transistor.

If you actually switched the transistor with a mechanical switch like in figure you could ground the base without issues. In practice using a throw switch is not useful and the 'usual' transistor setup is like this simulate this circuit – Schematic created using CircuitLab

(resistor values and voltages are not correct, it's just to show the shape of the circuit)

This is usually known as a common emitter switch. Common emitter since the control current flows from base to emitter (base current) and the load current from collector to emitter (collector current).

In this circuit you can see why the base-to-ground resistor should be somewhat big: otherwise all the control current would go thru it!

The calculation of the two resistor values is called biasing the transistor: you would substantially want some mA of base current when the switch is closed and less than 0.6V of VBE with the switch open. Hopefully your book will explain that a couple of pages later.

• "about 100nA, usually trascurable" – I think the word you want is "negligible." Jul 28 at 23:51
• "For the second point, you current diagram is wrong: you can't pull collector current from the base (in the usual biasing mode!)" Do you mean biasing mode is "on" mode of the transistor? No, my current diagram is when transistor is off
– Dat
Jul 29 at 8:14
• I would swap the "order" of R1 & R2 in this circuit - as it is drawn now it makes choosing R2 unnecessarily overcomplicated because you have to take into account the current that flows into R1 on top of what flows into the BJT base. Jul 29 at 9:00
• Although possible, this input configuration (an "ideal" voltage source and a switch in series) is rarely used in conventional digital circuits. Its main disadvantage is that it leaves the input of the controlled stage floating and this requires the inclusion of R2 but this is not desirable. The usual solution is a real voltage source (with a resistor in series) and a switch in parallel (as @Vladimir said). This configuration is implemented by a common-emitter transistor stage (i.e., the same transistor switch). In this case, the transistor base can be directly connected to the stage output... Jul 31 at 19:37
• ... The more sophisticated solution is the complementary stage (e.g., CMOS) that implements the SPDT switch. In this case, the transistor base must be connected through a base resistor to the stage output. Jul 31 at 19:38
1. Yes, you are correct, the book has an error.

2. Taking into account leakage, the collector current Ic = $$\\beta I_B +(\beta+1)I_{CBO}\$$ Adding the resistor in the absence of Ib reduces the collector current to $$\I_{CBO}\$$. The resistor needs to be low enough that the highest vaLue of $$\I_{CBO}\$$ only presents a few hundred mV at most at the base. A short is an acceptable value, though you may prefer a resistor in some cases when possible failure modes are considered (beyond the scope of this answer).

The difference between $$\I_{CBO}\$$ and $$\(\beta+1)I_{CBO}\$$ may not be all that great under benign conditions (room temperature) since $$\\beta\$$ is very low at nA collector current (it's not a constant as the simplified view holds- it decreases at both high and low collector currents).

Especially at high junction temperatures (or with leaky transistors such as the old germanium types) $$\I_{CBO}\$$ is exponentially higher and the total collector leakage can rise to objectionable levels. For example, an LED might appear visible illuminated with only a few uA of current. Or a battery supply could be drained prematurely in standby state.

• So I could replace R2 with a wire?
– Dat
Jul 28 at 10:28
• No, then the base will be forced to 0V and cannot be turned on with R1. Jul 28 at 10:33
• @JakobHalskov There's a SPDT switch, so a wire is fine. Jul 28 at 10:34
• @Dat As I said it's beyond the scope of this answer. Imagine the transistor fails in some way that puts load current through the switch and that is enough to damage the switch. Jul 28 at 10:46
• The circuit is conceptually wrong and it is not worth looking for a reason to insert R2 (OP intuitively guesses this). Both resistors are redundant. Only one (base) resistor is needed to switch between Vcc and ground. This corresponds to a CMOS transistor implementation of the SPDT switch that controls a classic BJT switch with only a base resistor. Jul 31 at 18:22
1. It should be a typo. I = (Vdd - 0.6)/R1.

2. If we don't have R2, the base could be floating. We need something to pull down. There can be some leakage current happening in the BJT.

• why should R2 be large? Can I replace R2 with a wire?
– Dat
Jul 28 at 9:25
• Also, when you apply 'real' logical signals (that doesn't go really to 0V) the pull down resistor helps when there's some risk that the voltage could go near 0.6V and turn the transistor one. Either way, just pick up the habitude since when you graduate to MOSFETs the pulldown is absolutely mandatory Jul 28 at 9:27
• @LorenzoMarcantonio have answered your question. Learning about why we require pulldown resistors could help. You can get many websites explaining the same. If you still have doubts then ask here. Jul 28 at 9:32
• 1) Is a bit more than a typo, it's worked out completely wrong. Jul 28 at 10:02
• Yeah it's blunder @Finbarr Jul 28 at 10:16