Components:
- breadboard
- 5V power supply
- 3mm red LED
- SPST pushbutton switch
- BC547 NPN transistor
- 220Ω, 2.2KΩ resistors
Explanation: We added a pushbutton switch and 2.2KΩ in order to bias the transistor base. It is obvious that when we press the switch, the LED is lit and the transistor acts as a switch. The way we have chosen the resistor value is according to the formula:
The value of the current gain amplification factor hFE can be assumed 10 for switching circuits and Ic is 20mA for the diode to glow. The idea to use a transistor as a switch in a circuit that has a switch seems like nonsense, but we can easily imagine that the bias voltage could be caused by some other digital component.