Transistor as a switch