CIRCUIT FUNDAMENTALS · INTERMEDIATE
Use an NPN transistor as a switch
A small base current can control a larger collector current. This lets a microcontroller or logic signal switch an LED, relay driver or other load within the transistor's ratings.
Open the interactive transistor exampleLow-side switching
In a low-side NPN switch, the load connects to the positive supply. The transistor connects the other side of the load to ground. Raising the base voltage through a resistor allows base current to flow and turns the transistor on.
The base resistor is essential: it limits base current. A transistor intended as a switch should have enough base drive to reach saturation at the required load current, without exceeding the drive pin or transistor ratings.
Try it in resistor.dev
- Open the transistor example and run the simulation.
- Select the transistor to inspect collector, base and emitter currents.
- Increase the base resistor and observe the lower base drive.
- Change the LED load resistor and see how the collector current is limited by the whole circuit.
- Use Engineering accuracy mode to compare the educational approximation with a SPICE transistor model.
Design checks for real hardware
Confirm the transistor's maximum collector current, voltage rating, power dissipation and gain at the intended operating point. For inductive loads, add a flyback diode. For a microcontroller, check that GPIO current remains within the board's documented limit. A simulation is a design aid; it does not replace the data sheet or a bench measurement.
Saturation is not an ideal short circuit
A real transistor has a voltage drop when it is on, and that drop creates heat. Treat the collector-emitter voltage, current and power as a connected set of measurements rather than assuming the transistor is perfect.
More circuit learning topics