# Clarifying how a NPN transistor can act as a switch with a LED in a circuit

I'm experimenting with a simple transistor/LED circuit but after reading many articles online I still can't tell if I have a faulty transistor or things are working as expected.

Power source = 5V DC out of an Arduino 5V pin. Transistor data sheet: https://www.sparkfun.com/datasheets/Components/2N3904.pdf

Here are the scenarios and related questions;

1.

LED flickers like a candle, transistor gets extremely hot. The data sheet says transistor can put up with 6 volts at a minimum right? So why does not having a resistor to the base make this happen? My understanding was that excessive current is not damaging as long as voltage is kept in order? I'm only using 5 volts.

2.

LED flashes upon connecting the wires then turns off. Transistor not getting hot, not sure what's going on.

3.

LED turns on normally, as if it's connected to the circuit with no transistor.

4.

LED turns on but it's dimmer. I'm assuming this is related to the voltage drop characteristics of a transistor explained here? Base current and Vce relation in NPN transistor output characteristics

Does everything mentioned above sound normal?

• 1) The B-E junction acts like a diode. Without a base resistor unlimited current will flow trough the B-E and destroy the transistor... Commented Sep 22, 2022 at 17:58
• But that's like using a power adaptor on some equipment with matching voltage but with more ampere, it's supposed to work just fine isn't it?
– Dan
Commented Sep 22, 2022 at 18:00
• No, when the B-E junction is forward biased it will drop around 0.7V and allow as much current to flow as is available, just like a diode... Commented Sep 22, 2022 at 18:02
• In the future, please edit your original question instead of deleting it and posting a new question. Commented Sep 22, 2022 at 18:08
• I agree with @Hearth. I was half way through writing my answer when you deleted the previous question. Fortunately I had the wit to copy the schematic and text as I guessed that you would create a new one. Edit to fix is the correct procedure. Commented Sep 22, 2022 at 19:33

simulate this circuit – Schematic created using CircuitLab

Figure 1, 2, 3 and 4 redrawn conventionally with current flow from top to bottom and LEDs correctly in series.

The data sheet says transistor can put up with 6 volts at a minimum right?

No. The datasheet says VEBO, Emitter-Base Voltage (IC = 0) = 6 V. Notice that the E comes before the B so that means E is positive with respect to B. In other words, the reverse voltage that the base can tolerate, not the forward voltage.

1. You can see that there is 400 mA going through the base. Usually the base can tolerate less than the collector which the datasheet says can tolerate 200 mA max (not where you want to be operating). The transistor has a hFE of 300 (max) so 1 mA into the base would be way more than enough to turn on the transistor for a 5 mA LED.

2. As explained in my answer to your previous question, the base-emitter junction behaves like a diode and clamps the voltage at 0.7 V. That's not enough to turn on the LED. On the plus side, your base current is more reasonable.

3. You're feeding 9 μA into the base and getting 1.3 mA through the collector. This is a current gain of 1300 / 9 = 144 which is the right order of magnitude given the hFE figure given above.

4. Doubling the base resistor will halve the base current and should halve the collector current. It does.

Does everything mentioned above sound normal?

Yes.

• 400 mA sounds low for 5 volts base-emitter on a common bjt. Commented Sep 22, 2022 at 18:12
• @Hearth, blame CircuitLab! I thought so too. It's a 2N3904 and sticking a voltmeter on there the base reads 780 mV. Commented Sep 22, 2022 at 18:17
• I guess circuitlab models a nonzero resistance for ammeters! Commented Sep 22, 2022 at 18:19
• @Hearth, I popped a voltmeter across the ammeter and it reads 0 V. They're ideal ammeters. I seem to remember the voltmeter loading a circuit in the past. Commented Sep 22, 2022 at 18:22
• I can't wrap my head around this 0.7 V value, and the junctions, did go over it multiple times here en.wikipedia.org/wiki/Bipolar_junction_transistor but still don't get it. In my circuit are electrons going from emitter to collector? What happens to the path created by base? What is the voltage drop and why is it related to base?
– Dan
Commented Sep 22, 2022 at 18:33
1. Works as expected. Transistor heats up and damages from base overvoltage and current because there is no base resistor.

2. Works as expected. Transistor turns on but because base voltage is about 0.7V and the LED is powered from base voltage, the 0.7V or less is not enough to light up a LED.

3. Works as expected.

4. Works as expected.

• for (1), why do you say there is an overvoltage? my 5v input is less than every other voltage max capacity mentioned in the datasheet.
– Dan
Commented Sep 22, 2022 at 17:55
• @Dan The base-emitter junction of a bipolar transistor is a diode. A diode should not be forward-biased by more than its forward voltage. Commented Sep 22, 2022 at 18:09
• Then you are reading the datasheet wrong. VEB of 6V means base is allowed to be 6V reverse biased, or less than emitter. VBE means how much base can be positive to emitter. It's about 1V max, and the rule of thumb is to assume it's about 0.7V. Commented Sep 22, 2022 at 18:12

The base/emitter junction of a transistor acts like a diode. So you have a diode from the +5V down to ground.

Now, a diode conducts as much current as it needs to until the voltage drops down to about 0.6-0.8 volts (depending). In circuit 1, the diode is trying to take as much current as it can, to make the voltage about that much. Hence, it takes lots of current and gets really hot. If you put a resistor in series with the whole thing (like circuit 2), now the resistor limits the current, and the voltage after the resistor is about that voltage (the base diode voltage), which is too low to light up an LED.

What controls a transistor is the current through the base. If you put a resistor in series with the base, the current will be drawn through the resistor, and the current will be the amount that makes the voltage after the resistor be the diode voltage. This is the same reason we put resistors in series with LEDs. This is circuit 3 and it works.

Circuit 4 makes the LED dim because if the base gets a very low current, it only lets a low current through the collector. This is how we use transistors as amplifiers. The more current goes through the base, the more current will go through the collector.

In circuit 3, the base current is high enough, that the amount of current the transistor will let through the collector is more than the current that can go through the collector, so the transistor lets all of it through. We call this "saturation". This is how we use transistors as switches - we make the base current high enough, so the transistor lets through all of the current it gets, or we make it zero so the transistor lets none of it through.

Actually, I bet that in circuit 3, the transistor is still limiting the current, but it's bright enough that you don't notice. If you made the base resistor a lot lower, like 1k, the transistor would definitely be in saturation.

What you are missing is that the 6V spec is Veb, not Vbe. In other words base is negative wrt emitter. The transistor is off under those conditions.

If you bias the base more positive than a few hundred mV, depending on temperature, it will conduct excessive current, and the transistor may be permanently damaged.