I have a problem with a PCB, powered directly by a switching power supply, which transforms 230 Vac into 5 Vdc. It has an ATmega328 (Arduino standalone) microcontroller for managing PC LED strips.
If it is not connected to the PC it works perfectly, but when I connect via USB the GND of the computer to the GND of the PCB it goes crazy.
Measuring the 5 V power supply, this voltage is seen on the oscilloscope:
Any ideas to reduce this?
Update:
Thanks @MarkU for your comment .. I didn't know!
Returning to us, touching the female USB port with the other male USB connected to the pc, I noticed small sparks. Therefore I tried to connect the power supply output GND to the lightning rod of my house. This drastically reduce the problem, without disappearing completely.
Another strange thing is that the problem disappears completely if, keeping the internal power supply, I feed the PCB to the PC through a CP2102 Breakout used previously to program the microcontroller.
I tried to search for the CP2102 Breakout scheme to understand the reason for this behavior, but alas to no avail ..