I'm new to electrical engineering, and I still have many stupid questions. Here's one of them.

This is what I'm reading. https://itp.nyu.edu/physcomp/labs/motors-and-transistors/using-a-transistor-to-control-high-current-loads-with-an-arduino

In it, it says to link the external power supply's ground (negative) to the Arduino's ground (negative). Why do we do this? Also, could you link the positives instead?

The ground of the motor power supply should connect to the ground of the microcontroller, on the breadboard.

Also, why do we have to do this:

Next, add a diode in parallel with the collector and emitter of the transistor, pointing away from ground. The diode to protects the transistor from back voltage generated when the motor shuts off, or if the motor is turned in the reverse direction.

Thank you.


In the application you linked, the transistor is part of two circuits, so we need a common reference between the circuits to enable the transistor to operate correctly.


simulate this circuit – Schematic created using CircuitLab

If there was no connection between points A and B, the microcontroller could not control the transistor bewcause there would be no path for the base current from the microcontroller to get back to the microcontroller's power supply.

If the connection between points B and C was removed, the relay would not operate, regardless of the state of the transistor, because there would be no path for the relay coil current to make it back to the 12 volt battery.

Having the common ground connection between the two power supplies allows the circuit to operate as required.

It would be possible to have a scenario where the positive terminals of the supplies have to be connected instead of the negative - it all depends on where you need a common reference point.

...edit after revised question...

Diode D1 is a flyback or spike suppression diode. When the transistor turns off, the magnetic field in the motor or relay (or other inductive device) will colllapse rapidly, and would create a high voltage spike on the transistor's collector. The diode will conduct the current that the collapsing field generates, preventing the voltage spike from forming.

| improve this answer | |
  • \$\begingroup\$ Great answer! I edited my question after you loaded it, so you didn't see the change. Could you answer the rest? You do a good job of explaining. \$\endgroup\$ – Evan_K2014 Nov 24 '16 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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