0
\$\begingroup\$

While tyring to figure out how to best control a 12V device from a raspberry pi or arduino I ran into the following image: enter image description here

Now I'm wondering, what is D1 doing there? What's the use of that one?

\$\endgroup\$
0
1
\$\begingroup\$

When the transistor switches open, energy stored in the motor can cause a back emf and destroy the transistor so the diode provides a current path for that energy to prevent this happening.

The same applies to switching any magnetic component such as a relay, a solenoid or a transformer.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.