Skip to content

Transistor as a Switch

A small current into the base switches a much larger current through the collector. This is how a microcontroller drives an LED, a relay or a motor that needs more current than its output pin can give.

Schematic of the Transistor as a Switch circuit

Simulation result

The simulator computed these waveforms from the circuit above, over the first 1 s.

CH1 2 V/divInput signalCH2 5 V/divQ1 collector voltage100 ms/div

Numbers from the simulation

Computed by the simulator from the part values in the schematic.

Collector voltage when on (saturated)
81.4 mV
Collector voltage when off
8.32 V

The circuit is copied into a new project in your workspace. If you are not signed in, you sign in with Google first.

Open in the simulator

How it works

When the signal is at 5 V, current flows through RB into the base, about (5 V − 0.7 V) / 10 kΩ = 0.43 mA. That is enough to saturate the transistor: the collector drops close to 0 V and the LED lights.

When the signal is at 0 V, there is no base current. The transistor is cut off, the collector current stops and the LED goes dark.

To saturate fully, the base current must be larger than the collector current divided by hFE. Pick an RB that gives several times that much.

Try changing

  1. Raise RB to 1 MΩ. The base current is too small, the transistor does not saturate, and the collector stays well above 0 V when on.
  2. Lower RC to 220 Ω. The LED current climbs to about 30 mA and the simulator warns about the LED.

More examples