Above is a schematic for a DC motor wired up to an Arduino with the motor being powered via a 9V battery. I think I'm finally starting to grasp the concept of the flyback or snubber diode.
What I'm not understanding is that, when a reverse voltage spike occurs, if the flyback diode is meant to protect the transistor, what is stopping the current that is being pushed in the opposite direction to travel to the 9V battery and damage it, or to travel to the transistor through the capacitor?
In a "complete circuit" current flows in a circle, out of the battery (or power supply), through the load, and then back through the battery.
If you look at the circuit and think about current flow, the current flows out of the positive battery terminal and from positive-to-negative through the load (1) but inside the battery and from negative-to-positive.
Inductors (coils) "resist changes in current flow" (2). When power is removed, the magnetic field collapses. The changing magnetic field creates a voltage, turning the motor or solenoid (temporarily) into a generator.
The current through the coil is flowing the same direction as before but suddenly it's now a generator so like a battery the current is flowing negative-to-positive through the coil and the voltage is reversed.
With the voltage across the diode also reversed, the diode conducts with an approximately 0.7V forward voltage which keeps everything "safe".
Without the diode, when the transistor, there is (almost) no path for the current (nearly infinite resistance). You can get a very-high voltage spike as the coil tries to keep current flowing through an infinite resistance (Ohm's Law). That voltage can easily be high enough to fry the transistor or something else.
If you "play around" with a battery and a motor or solenoid you can easily get enough voltage when you disconnect it to feel a shock if you're holding the wires (assuming no diode).
(1) This is "conventional current", which is just a "concept". The electrons are flowing from negative to positive (through the load). If you take an electronics class they teach conventional current flow but if you take a chemistry or physics class they teach current flow.
Hi,
summing up,
every inductive load, and motor is an inductive load, generates an inverse voltage spike when removing the voltage across it.
In your schematic while the motor receives the current coming from the 9V through the transistor, it turns and there is a voltage on it.
By stopping this current by switching the transistor, the voltage across the motor goes to zero, and this causes a reverse voltage between the motor pins.
As this current stop can be very fast, the reverse voltage can be a spike of values much higher than 9V.
As the diode is also connected inverted between the poles of the motor, it "kills" this high voltage spike protecting the transistor.
The Capacitor is also in this circuit to dampen "electrical noise" generated by the motor in motion.
@jremington
Thank you all so much for the replies. I really appreciate as my professor was not much in understanding my question. So would it be safe to say that the circuit more or less works like this? The thing I really want to understand is the current path when to the collector pin of the transistor when the base pin is receiving the 5V from the Arduino vs. not:
Would you say these are kind of accurate as to what is going on?
It would be better to say Pin 9 voltage is 5V, or 0. The base voltage will be either around 0.7V or 0.
When switched off, the transistor collector will see around 9V + 0.7V, decaying to 9V. If the diode is not present, the collector voltage may be hundreds of volts at the turn-off instant.