1
\$\begingroup\$

I'll explain what I'm trying to achieve first. I basically want to control a 4 wheeled robot through an Arduino but I need the Arduino to get the commands from a computer. I've already setup the circuitry for controlling the robot motors (H-bridges, encoders, etc) and I just need to send GPIO signals to that circuit. As I need to get the instructions from the laptop, I need to power the Arduino through the USB connection. Now here's where the problem comes in.

If the Arduino gets its source power from the laptop but needs to communicate with an external circuit, what happens to the ground? I'm pretty sure the Arduino will need to have a common ground with the external circuit's power source for this to work. My worry here is what will happen if the battery sends a spike current through the ground connection and fries the Arduino (I've heard this can happen). Is there some way I can protect the Arduino from this or is this some better solution that I'm missing here?

\$\endgroup\$
1
  • \$\begingroup\$ I would say put a 5.5V TVS diode to suppress the spike. Arduino will just reset in such an event. \$\endgroup\$
    – aaditpj
    Oct 13, 2021 at 17:57

1 Answer 1

3
\$\begingroup\$

The grounds would generally need to be common.

That said, if the motor side has its own power source it is possible to isolate the PC/Arduino portion of the system from the motor part of the system by connecting all the motor control signals through opto-couplers. This would permit the motor subsystem ground to be separate. Note that really cheap opto-couplers can limit the bandwidth of the signals going to the motors so if you are using high frequency PMW controls make sure to evaluate and select components accordingly.

\$\endgroup\$
3
  • \$\begingroup\$ ok, so if I use an opto-coupler between the signals of Arduino and the rest of the circuit, the Arduino/PC part should be isolated from the rest of the circuit. If I add the isolator between the Arduino ground and the external battery ground, will that work? Also, will the opto-couplers be used in the same direction for input and output signals? \$\endgroup\$ May 12, 2014 at 16:25
  • \$\begingroup\$ If the coupler is put in between the two grounds, wouldn't that mean that the grounds are no longer common? If that is the case, that would sort of defeat the whole purpose, wouldn't it? \$\endgroup\$ May 12, 2014 at 17:27
  • \$\begingroup\$ You do not put opto couplers between the grounds. That does not even fly from a functionality standpoint. You use the optocouplers on signal lines that are referenced to either the supply or the ground on their respective sides. For signals going to the motor controllers the Arduino drives the LED side of the coupler and the output photo sensitive device side of the coupler is used to drive the motor signal to its load point. For signals that may flow back from the motor controller back to the Arduino you flip the opto-couplers back the other way so the LED is driven from the motor side. \$\endgroup\$ May 13, 2014 at 5:23

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.