Today I was trying to figure out how a transistor works (with my Arduino) and I found a great explanation. The simple answer is that a transistor is an electronic switch. It has a voltage in (collector), a voltage out (emitter), and a control wire (base). The switch is normally open, but when you apply voltage to the control wire it completes the circuit. This allows you to supply a small amount of voltage (5v) to complete a circuit that's higher voltage (12v).
All content licensed under the Creative Commons License