An NPN transistor needs a resistor in the base, the emitter on ground and the load between the supply and the collector.
What the message means
The base current is what turns the transistor on. Too small a current leaves it half on; no resistor can damage the pin or the transistor.
Fix it in this order
- Put the load between the positive supply and the collector, and the emitter to ground.
- Join the grounds of the load supply and the microcontroller.
- Use a base resistor of about 1 kohm as a start for a small load, and calculate it from the load current if you need more.
- Check the transistor current rating is above the load current, with margin.
- Check the pin order of your transistor from its datasheet, since packages differ.
- Put a diode across a relay coil or motor.
Why it happens
An NPN transistor works as a switch controlled by the current into its base. A small base current allows a much larger current from collector to emitter, and enough base current turns the switch fully on.
Too little base current leaves the transistor partly on, so it drops voltage and heats. With no resistor the base current is limited only by the pin and the base-emitter junction, which can overload the pin. The load and the control signal also have to share a common ground.
If you see this, do this
| You see | Do this |
|---|---|
| Load never turns on | Pin order, base resistor or ground. |
| Load dim, transistor hot | Base current too small or load too large. |
Related
MOSFET not switching, relay active low.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
An NPN transistor in a switch circuit has to be pushed into saturation, where the voltage across it falls to a few tenths of a volt. To do that, the base current needs to be much larger than the minimum implied by the gain. A common design rule is to assume a forced gain of about 10: base current = load current / 10. The base-emitter junction drops about 0.7 V, so the base resistor is (V drive – 0.7) / base current.
If the base current is lower than needed, the transistor works in its linear region. It drops voltage and gets hot while the load receives less power. If there is no resistor, the pin current is limited only by the pin and the junction, and the microcontroller pin can be overloaded. Part choice matters too: a BC547 is limited to about 100 mA, while a 2N2222 type handles several hundred mA, according to their datasheets.
How to confirm the cause
- With the load commanded on, measure the voltage between collector and emitter. A saturated switch reads a few tenths of a volt or less; a reading of several volts shows the transistor is not turned on enough.
- Measure the base to emitter voltage. About 0.6 to 0.7 V means it is conducting. Near 0 V means no base current: check the resistor, the pin and the pin order.
- Measure the voltage across the base resistor and divide by its value to find the real base current.
- Confirm the emitter is joined to the ground of the microcontroller. A load supply with a separate ground gives no switching at all.
- Check the pinout from the datasheet for your exact part and package. TO-92 parts from different makers can have different pin orders.
Worked example
A 50 mA load driven from a pin. With a forced gain of 10 the base current is 5 mA.
5 V logic: Rb = (5.0 - 0.7) / 0.005 = 860 ohm -> use 820 ohm (5.2 mA)
3.3 V logic: Rb = (3.3 - 0.7) / 0.005 = 520 ohm -> use 470 ohm (5.5 mA)
Check: 5.2 mA x 10 = 52 mA available, load needs 50 mA, OK
Part: BC547 limit 100 mA (datasheet) -> 50 mA is inside itCommon mistakes
- Placing the load between the emitter and ground, so the emitter rises and base drive is lost.
- Using a very large base resistor such as 100 kohm and wondering why the load stays off.
- Leaving out the diode across a relay coil or motor, so the transistor sees a voltage spike when the load turns off.
- Not joining the grounds of the load supply and the controller.
- Choosing a part whose current rating is close to the load current.
If this did not fix it
- Check whether the load needs a logic-level MOSFET instead, for currents above what a small transistor can safely carry.
- Check that the pin is set as an output and actually goes high. Test it with an LED and resistor first.
- Check that the load works when connected to the supply directly, to rule out a faulty load.