0
\$\begingroup\$

Given a circuit made of an MCU powered by a laptop's USB port (such as tm4c123gh6pm), and an external power supply, should the MCU's GND pin be wired to the external power supply negative terminal?

For instance, in a circuit made of the above MCU exposing an I2C master and a slave, with two external pull-up resistors powered by a 3.3V buck converter, which in turn is powered by a 9V battery. Should the 9V battery negative terminal be connected to one of the MCU GND pins?

\$\endgroup\$
2
  • 3
    \$\begingroup\$ Does this answer your question? Why connect two power supply grounds? \$\endgroup\$ Commented Dec 24, 2021 at 19:49
  • \$\begingroup\$ From that post it seems to me that I should connect them. However, it seems this is kind of optional. How can a I2C master/slave work then? Maybe the master sends what, for him, is 3.3 V but what will this be for the slave if they don't have a common ground? In addition, I'm concerned about if connecting these two GNDs can cause some current flowing through the MCU damaging it, or even through the laptop since the MCU is connected to the laptop. \$\endgroup\$
    – Martel
    Commented Dec 24, 2021 at 20:14

1 Answer 1

2
\$\begingroup\$

There's no way for the circuit to work if you don't connect the grounds. In fact, whenever you connect anything at all to your computer, the device's ground is connected to the computer's ground. There won't be much current flowing through the ground connection as long as your power supply is isolated or earthed (which it legally has to be). It is actually dangerous for your microcontroller if you don't connect the grounds since this means that stray currents (i.e. from EMI suppression capacitors) will flow through the microcontroller's data pins. This can damage the microcontroller.

In general, your circuit should only have a single ground (unless you really know what you're doing). All ground pins of all devices should be connected to this ground.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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