Using Arduino to control relay for switching a USB cable on/off

Hey all,

I'm facing an interesting issue with my 2015 MacBook Pro. I've been using an Arduino Uno with relay module to switch a stand USB cable on and off. I run 5V+ and Data+ through the relay switch, and monitor that my application shows the correct state when a USB peripheral is connected.

What I find is that after 5-10 switches, the USB port will stop sending Data. Power is still sent. This will always happen, and the only fix I've found is an SMC reset on the machine.

Have I done something silly using a relay for this purpose?

Regards,

James

USB cables are designed to complete the connection of power before the data traces. Look at any USB plug, you'll see the outer two contact points being longer. It prevents power running up the data lines or some such. I believe it's more a precaution than a mandatory behavior.

Your device may not be happy with the simultaneous nature of your setup which bypasses the 'power before data' connection as intended.

I believe it's more a precaution than a mandatory behavior.

No it is part of the specification and essential to prevent a condition known as "latch up".

Ahhhh. Thanks guys. I'll try delay the data relay by some amount and see if that can prevent the problem