Diagram 'A' shows an NPN transistor which is often used as a type of switch. A small current or voltage at the base allows a larger voltage to flow through the other two leads (from the collector to the emitter). The circuit shown in diagram B is based on an NPN transistor.