A NPN Transistor is a three terminal electronic component made from semiconductor material. The three terminals are called the Collector (C), Base (B) and the Emitter (E). The transistor can be used in amplifying and switching applications. The operation of the transistor is quite complex and it is a theory on its own so we’re not going to go into detail for our purpose.
The Collector terminal is normally connected to a positive supply and the Emitter to a negative supply with a resistor in either the collector or emitter circuit or both depending on the application. The voltage supplied to the Base terminal controls the ON/OFF state of the transistor. When the Base voltage is the same as the Emitter the transistor is off and as the Base voltage increases with respect to the Emitter the transistor becomes more switched on until it is fully switched on. Using this property the transistor can be used as a switch or an amplifier where a small variance in the Base voltage will be amplified on the Collector and Emitter side of the transistor.
The two basic functions of a transistor are to amplify signals or to switch circuits digitally on or off.