Sometimes the arduino connection is lost.

I have several ARDUINO on my computer.
I first assumption is the kick-back of several actuators (EM-LOCK, RFID module, LED controller) connected to each Arduino, caused disconnection.

At first, I connected a number of Arduino via USB HUB, but the power of USB seemed to be a problem, so I changed the USB hub (repeater type) and the frequency of disconnecting was reduced.

But I decided to use UTP shield instead of USB connection.

However, the connection was lost.

Currently, we are trying to just only automatically reset via USB, and the communication is only with UTP. I have a hardware reset via USB every time the connection is lost, and I want to solve the original problem.

I tried varistor, condensor, diode to prevent kick back of EM lock, but those stuff did not work perfectly. still disconnected !!!! (Frequency decreased)

The Arduino is powered by a barrel jack(9V) and is powered by also USB. I know that two currents are blocked in Arduino. What is the problem?

Checking the external SMPS 5v and the Arduino ground potential difference with the oscilloscope confirmed that it sprang for 20 microseconds. However, it does not make sense to disconnect the connection with Arduino, even if the potential difference is splashed by several volts.

So now I'm trying apply my opto coupler.

The adapter of the barrel jack is supplied with 220V, which has no ground. I do not know if this is a problem, or if I should collect ground pins of the arduinos and ground it directly to the earth.

I would really appreciate it if you could help someone with experience.