I got an Arduino Pro Micro and some parts to play with. I want to control a little 5v motor from an external power supply by using the Arduino to trigger a transistor. Like this:
Is that at all correct? Will it work? I want to experiment but I don't want to break my new toy in the process. The transistor I am using is an NPN, 2N3904.
Best Answer
You want to use your transistor as a switch. I found a nice site about that which gives this circuit:
Now forget about all the garbage and strip the design down to this:
simulate this circuit – Schematic created using CircuitLab
Your circuit is correct, except that it's missing the base resistor (R1) and the pull-down resistor (R2). Also, the load (your motor) has to be on the collector of the transistor, not on the emitter. At last, use a flyback or flywheel diode with the cathode to Vcc, like in the first image, to avoid high voltages.
So in the end, your schematic would look like:
simulate this circuit
Explanation of the circuit:
One last thing to explain: why the motor has to be on the collector side and not on the emitter side of the transistor. Wouter explains this in his answer, in short: with the load on the collector side you are in charge of what voltage the motor gets; with the load on the emitter side, this voltage cannot be higher than the voltage on the base (minus something).