this is a super simple question. Does the diode work the same in this circuit if you place the motor after the transistor, instead of before? I'm trying to understand variations of where I can place the diode and how it really works. Thanks!
As shown, the diode will not protect the transistor, because it doen't prevent the collector voltage becoming very high.
You can 'visualize' the problem this way: the motor is an inductor, the transistor a switch. When the switch is closed, current flows downthrough the inductor (motor) and the switch (transistor). When the switch is opened, current will continue to flow through the coil, in the same direction. This is a property of a coil. It will cause the voltage on the junction to rise (because current flows to that point, and there is now ay to leave it), untill something breaks (probably the transistor). The same thing happens (but longer) if inertial causes the motor to spin after it is switched off.
When correctly placed, the diode will allow the current a path back to the other side of the motor, effectively shorting that current. This sounfds bad but it is actually good, because the motor produces a current, not a voltage.
Somtimes a zener diode is used, placed where you placed the diode, with a zener voltage >> the supply voltage, but << the transistor breakdown voltage. In that case the current will flow through the zener diode to earth. This dissipates the 'residial energy' faster than the diode over the motor.
Your circuit should really use two diodes in the following arrangement.
What's going on?
A motor is an inductor. When the transistor is on current flows through it to ground. When the transistor turns off the current will still flow but now the resistance to ground is LARGE. V = IR means the voltage on top of the transistor tends towards a very very large voltage. Large enough to fry the transistor, and also large enough to prevent you from listening to your favorite radio station.
The "flyback diode" across the motor limits the voltage at the top of the transistor to Rail + 0.7 V or so.
The Diode across the transistor has a similar function and protects the transistor from any negative voltage produced by the motor. This is especially required with brushed DC motors. The commutation effects cause the voltage across the motor to do some really nasty dances.
A flyback diode must be used this way:
Otherwise, the collector voltage can overshoot well above the maximum rating of the transistor (and possibly destroy it) when the coil in the motor raises the voltage trying to compensate for its sudden current cut-off. Your circuit only protects the transistor against reverse current, but not from the overvoltage generated during cut-off.
Take a look at this excellent video tutorial to see what happens with and without the flyback diode. Look at this snapshot from the video to see how big can the voltage spikes be:
Your question title refers to 'diode placement' and a lot of people gave good answers about the diode placement not being correct in your circuit, but your question asks about how the diode works if the transistor and motor are rearranged. I think the question is not written very clearly.
If you are actually asking about relocating the motor below the transistor, than the diode placement isn't affected. It should still primarily be in parallel with the motor, and you could use the second one across the transistor. But the problem is that the transistor wont turn on fully if it is above the motor since it is an NPN BJT and is driven from a lower voltage source than the motor. You would have to change it to an PNP type. If you did that, then yes the diodes work the same way.
The motor may run if you just move the NPN above the motor, but the BJT would not be saturated so it would be dissipating a lot of heat. What will happen is, as the power is turned on (and motor voltage is zero), the emitter voltage is zero, so the transistor starts to turn on (there is some base current). This allows current through the BJT and motor and the voltage increases. This tends to reduce the base current which will try to increase the collector-emitter voltage and reduce the motor voltage. This will stabilize at some point, but not in the saturation region (because if it was, the motor voltage would be nearly the full supply voltage and the emitter voltage would be higher than the base voltage, which can't be the case if it's saturated). So it may come on with a reduced voltage, but it's probably not what you are trying to do.