# PNP transistor base voltage acting weird

I'm afraid I forgets something in my circuit about PNP transistor use. I try to use the transistor to supply current to 2 small screens back light. For that I'm using this transistor- https://www.fairchildsemi.com/datasheets/MM/MMBT2907A.pdf And this is they way I connect it:

Screen_backlight net connects directly to the MCU (which is limited to 20mA source current). When I give it "1", I see its is really 3.3V as it supposed to be, and when I give it "0" it, for some reason, goes to 2.4V and backlight is working. So for functionality- it works fine, but why I'm seeing this strange behavior?

Is it related to the VCC I give directly to the Emitter? Is it related to series resistor I should put on the base net?

Thanks, Dudi

• "Is it related to series resistor I should put on the base net?". Yes. Most definitely. Feb 24, 2016 at 18:30

What you see is exactly what should be expected. The B-E junction looks like a diode to the driving circuit. This limits the base voltage to just this diode drop below Vcc. You are seeing 900 mV because you are overdriving it.

The solution is to put a resistor between the base and the digital output. Let's say you want 5 mA of base current to flow. Figure the B-E junction will drop about 700 mV, so that would leave 2.6 V across the resistor. By Ohm's law, (2.6 V)/(5 mA) = 520 Ω.

The actual value you want is a function of the current the transistor must pass and its gain. It must also not exceed what the digital output can do. If there is no common ground between the two, then you have to use a different topology, like two transistors or a P channel FET.

Your transistor has a minimum guaranteed gain of 100 at 150 mA collector current and 50 at 500 mA collector current. Using the example of 5 mA base current from above, a gain of 100 would mean the transistor can support 500 mA collector current. However, at that current it only has a gain of 50. At that gain it can support 250 mA, at which point it should have more gain than 50. So it can definitely support 250 mA collector current in this example, but probably 300 mA or a bit more.

This example was with 5 mA base drive, which I picked because most microcontroller outputs can probably handle that. Some, like many PIC 16 series can sink 20 mA, in which case you can make the base resistor smaller. However, I'd only make it small enough to support the collector current you need with some margin.

You also have to think about how the backlight is connected. If its just a LED, you shouldn't connect it directly between the collector and ground. Look at the datasheet and find the operating voltage of the backlight. You are starting with 3.3 V. Subtract off the backlight voltage, then figure about 200 mV for the saturated transistor. The rest must be dropped by a resistor. Use Ohm's law as above to calculate the resistor value that drops this voltage at the backlight operating current.

Your microcontroller output is only capable of sinking 20 mA. Therefore it doesn't have enough current capability to pull the PNB base more than ~0.9 V below the emitter.

To pull the base down to 0 V (which might be what you expect), you might have to pull many amps through the base (and if the device were ideal you might have to pull gigaamps or more). Of course this would be likely to cause the BJT and uC to evaporate in a cloud of smoke.

As it is, you are probably pulling substantially more than 20 mA, and abusing your microcontroller and BJT both. Add a base resistor to limit the current to less than 20 mA when the uC applies 0 V.

If you do not include a resistor between MCU pin and transistor's base bin, when you set the GPIO to '0' it will draw a high current from VCC. Doing that is the same as replacing the PNP by a diode between VCC and the MCU pin.

simulate this circuit – Schematic created using CircuitLab

That way you won't measure 0V at all but the voltage drop over the diode (3,3 - VD1 = 2,4V). Generally a resistor in the thousand ohms range should do the job.