please explain the working of transistor as a switch
When used as an AC signal amplifier, the transistors Base biasing voltage is applied in such a way that it always operates within its "active" region, that is the linear part of the output characteristics curves are used. However, both the NPN & PNP type bipolar transistors can be made to operate as "ON/OFF" type solid state switches by biasing the transistors base differently to that of a signal amplifier. Solid state switches are one of the main applications for the use of transistors, and transistor switches can be used for controlling high power devices such as motors, solenoids or lamps, but they can also used in digital electronics and logic gate circuits.
If the circuit uses the Bipolar Transistor as a Switch, then the biasing of the transistor, either NPN or PNP is arranged to operate the transistor at both sides of the I-V characteristics curves we have seen previously. The areas of operation for a transistor switch are known as the Saturation Region and theCut-off Region