← Field Notes

The transistor as a switch

The transistor as a switch

A transistor can amplify, but the first thing most people use one for is simpler: letting a small current switch a larger one. That is how a chip that can supply a few milliamps turns on a relay, a buzzer, or a string of LEDs.

The three leads

A common NPN transistor has a base, a collector and an emitter. A small current flowing into the base allows a much larger current to flow from collector to emitter. No base current, no collector current. The switch is off.

The standard circuit

  • Emitter to ground.
  • Load, for example an LED with its resistor, between the positive supply and the collector.
  • Control signal to the base, through a resistor.

The base resistor matters. The base-emitter junction behaves like a diode and will take as much current as you let it, so the resistor sets the limit.

Sizing the base resistor

To switch the transistor fully on, give the base roughly a tenth of the load current. For a 100 mA load that is 10 mA. From a 5 volt signal, allowing 0.7 volts across the base-emitter junction: (5 − 0.7) ÷ 0.010 = 430 Ω. The nearest common value, 470 Ω, is fine.

Two cautions

Check the transistor's maximum collector current in its data sheet. Small signal types handle a few hundred milliamps at most. And if the load is a relay or motor, fit a diode across it, cathode to the positive side, to absorb the voltage spike when it switches off.

If you want the fundamentals in one place, with hand-drawn diagrams, start with Getting Started in Electronics, or browse all four books.

See the guides