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!
-
\$\begingroup\$ If you mean you want to place the motor between pin 2 on the transistor and the ground, it likely won't work unless you change from an NPN to a PNP transitor - the diode should always be across the two power legs of the transistor to prevent high voltages from switching off the current to the inductive motor damaging the transistor \$\endgroup\$– user2813274Mar 5, 2017 at 15:44
-
\$\begingroup\$ What @user2813274 said..., PLUS you need another diode pointing up across the motor pins. \$\endgroup\$– Trevor_GMar 5, 2017 at 15:45
4 Answers
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.
-
\$\begingroup\$ Thanks. I understand the motor diode. How does the diode around the transistor protect the transistor from negative voltage from the motor? Does it allow electrons to bypass the transistor moving in the opposite direction from ground (conventionally)? \$\endgroup\$– pcnc777Mar 5, 2017 at 18:50
-
A flyback diode must be used this way:
simulate this circuit – Schematic created using CircuitLab
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.
-
\$\begingroup\$ Thanks. Yes, sorry for the unclear question. The motor does still work being placed at the transistor's emitter pin with an NPN when I wire it up. Perhaps its because the motor is rated for 3V and it's receiving 5V? If there was only 3V going to the collector would the motor not work when attached between the emitter and GND? My original question is asking does the diode achieve the same function if the motor is placed at the emitter, rather than the collector. \$\endgroup\$– pcnc777Mar 5, 2017 at 18:46
-
\$\begingroup\$ The regulator is 5V? What is the supply voltage? The motor may run, but probably the BJT is not saturated so it may be dissipating a lot of heat. \$\endgroup\$– AngeloQMar 5, 2017 at 19:02
-
\$\begingroup\$ I edited the answer to describe why the motor would run in that configuration. \$\endgroup\$– AngeloQMar 5, 2017 at 19:10
-
\$\begingroup\$ Not using the regulator. Basically everything in front of the motor/transistor is an Arduino. So 5V from arduino to collector, motor connected to emitter, Arduino pin connected to base. \$\endgroup\$– pcnc777Mar 5, 2017 at 19:11
-
\$\begingroup\$ OK, same would apply as long as the motor supply voltage is about the same or higher than the max base voltage. \$\endgroup\$– AngeloQMar 5, 2017 at 19:18