0

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?

1 Answers1

1

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.

Andy aka
  • 434,556
  • 28
  • 351
  • 777