# Why add a diode to a transistor controlled DC motor circuit?

I'm new to the world of circuits. I have only a basic level of understanding. I know how to use resistors, know the difference between NPN and PNP transistors, and understand the one-way flow control offered by a diode.

But I don't understand why a diode has been introduced into the circuit (and many similar diagrams I've seen) when using a transistor to switch a DC motor on and off when it runs at a higher voltage than the controlling source (ie. an Audrino or PC).

I recognize that the 5v source current powering the motor would not short to ground because of the orientation of the diode. But I don't see why you would do that rather than just have the 5v run directly (and only) to the motor.

Is there something about the rotating nature of the DC motor that causes reverse current or something, and the diode is there to protect the audrino?

Appreciate any help offered. Thanks.

• This question has been asked SO MANY TIMES. It's because the motor is an inductor and sudden changes in current can cause flyback (high voltages) which is dangerous. The diode also known as the flyback diode which you can search on Wikipedia eliminates that effect. – Bradman175 Jan 6 '17 at 13:31
• @Bradman175 I'm not surprised at all that this has been asked SO MANY TIMES, yet when I did the search through the site (and looked through all the suggested related posts while typing in my question topic) I failed to find something that obviously answered my question. Since I didn't know it was called a flyback diode, it made it a bit harder to find what I was looking for. – Michael Oryl Jan 6 '17 at 14:23
• @MichaelOryl The StackExchange search isn't that great. Next time you want to search for related questions, I suggest you use google with this query: site:http://electronics.stackexchange.com/questions [your question here] – m.Alin Jan 6 '17 at 15:03